mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 07:26:17 +00:00
23 lines
525 B
Python
23 lines
525 B
Python
import discord
|
|
|
|
client = discord.Client()
|
|
|
|
@client.async_event
|
|
def on_message(message):
|
|
# we do not want the bot to reply to itself
|
|
if message.author == client.user:
|
|
return
|
|
|
|
if message.content.startswith('!hello'):
|
|
msg = 'Hello {}!'.format(message.author.mention()
|
|
yield from client.send_message(message.channel, msg))
|
|
|
|
@client.async_event
|
|
def on_ready():
|
|
print('Logged in as')
|
|
print(client.user.name)
|
|
print(client.user.id)
|
|
print('------')
|
|
|
|
client.run('email', 'password')
|