diff options
| author | Rapptz <[email protected]> | 2015-11-27 18:01:52 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2015-11-27 18:01:52 -0500 |
| commit | 90d9c9b297abbe10da3a2e856ab52850f2afa2f1 (patch) | |
| tree | 9d6904bdd2ff66fc864421b260aaa33ddb039584 /examples/reply.py | |
| parent | Document supported operations in discord.User (diff) | |
| download | discord.py-90d9c9b297abbe10da3a2e856ab52850f2afa2f1.tar.xz discord.py-90d9c9b297abbe10da3a2e856ab52850f2afa2f1.zip | |
reply.py example now checks for self-authoring
Diffstat (limited to 'examples/reply.py')
| -rw-r--r-- | examples/reply.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/reply.py b/examples/reply.py index f3f56c72..b106675f 100644 --- a/examples/reply.py +++ b/examples/reply.py @@ -5,6 +5,10 @@ client.login('email', 'password') @client.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'): client.send_message(message.channel, 'Hello {}!'.format(message.author.mention())) |