Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- import os # <------ don't use this if not using repl.it
- import requests # <------ don't use this if not using repl.it
- import json # <------ don't use this if not using repl.it
- import random # <------ don't use this if not using repl.it
- from replit import db # <------ don't use this if not using repl.it
- client = discord.Client()
- @client.event
- async def on_ready():
- print('bot is ready!')
- @client.event
- async def on_message(message):
- if message.author == client.user:
- return
- msg = message.content
- if msg.startswith('!ping'): #this is for the command
- await message.channel.send("pong") #bot respond
- client.run(os.getenv('TOKEN')) #enter token in 'TOKEN'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement