discord.py/examples/reply.py
2020-11-28 03:16:14 -05:00

20 lines
503 B
Python

import discord
class MyClient(discord.Client):
async def on_ready(self):
print('Logged in as')
print(self.user.name)
print(self.user.id)
print('------')
async def on_message(self, message):
# we do not want the bot to reply to itself
if message.author.id == self.user.id:
return
if message.content.startswith('!hello'):
await message.reply('Hello!', mention_author=True)
client = MyClient()
client.run('token')