Sometimes post in the channels

This commit is contained in:
JP
2018-07-07 21:38:42 +02:00
parent 996b661082
commit 6883520568
+10 -4
View File
@@ -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)