From 90d9c9b297abbe10da3a2e856ab52850f2afa2f1 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 27 Nov 2015 18:01:52 -0500 Subject: [PATCH] reply.py example now checks for self-authoring --- examples/reply.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/reply.py b/examples/reply.py index f3f56c72c..b106675fc 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()))