diff --git a/Chatbot.py b/Chatbot.py index 2c4d87d..53bd410 100644 --- a/Chatbot.py +++ b/Chatbot.py @@ -26,18 +26,24 @@ class Chatbot(object): @self.bot.event @asyncio.coroutine def on_message(message): - if message.author.bot: - return + if message.author.bot: + return #ignore your own messages, Stroop - if message.content.strip()[0] != '!': #don't respond to a command with a chat + if message.content.strip()[0] != '!': #don't respond to a command if message.content.lower() == "nihao": yield from message.channel.send("kankerlauw") return if "DMChannel" in type(message.channel).__name__: #respond to messages in PM channels yield from self.respondToMessage(message) + elif message.channel.id == 139061614178598912: #don't abuse the "belangrijk" channel + pass else: - pass #TODO respond to other channels at random + a = random.randint(0,999) + if message.channel.id == 137218228953939968 and a < 80: #shitpost channel + yield from self.respondToMessage(message) + elif a < 20: #all other channels + yield from self.respondToMessage(message) #process commands: yield from self.bot.process_commands(message)