reply.py example now checks for self-authoring
This commit is contained in:
parent
7c060ee7f6
commit
90d9c9b297
@ -5,6 +5,10 @@ client.login('email', 'password')
|
|||||||
|
|
||||||
@client.event
|
@client.event
|
||||||
def on_message(message):
|
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'):
|
if message.content.startswith('!hello'):
|
||||||
client.send_message(message.channel, 'Hello {}!'.format(message.author.mention()))
|
client.send_message(message.channel, 'Hello {}!'.format(message.author.mention()))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user