Sometimes post in the channels

This commit is contained in:
JP
2018-07-07 21:38:42 +02:00
parent 996b661082
commit 6883520568
+9 -3
View File
@@ -27,17 +27,23 @@ class Chatbot(object):
@asyncio.coroutine
def on_message(message):
if message.author.bot:
return
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)