Sometimes post in the channels
This commit is contained in:
+9
-3
@@ -27,17 +27,23 @@ class Chatbot(object):
|
|||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def on_message(message):
|
def on_message(message):
|
||||||
if message.author.bot:
|
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":
|
if message.content.lower() == "nihao":
|
||||||
yield from message.channel.send("kankerlauw")
|
yield from message.channel.send("kankerlauw")
|
||||||
return
|
return
|
||||||
|
|
||||||
if "DMChannel" in type(message.channel).__name__: #respond to messages in PM channels
|
if "DMChannel" in type(message.channel).__name__: #respond to messages in PM channels
|
||||||
yield from self.respondToMessage(message)
|
yield from self.respondToMessage(message)
|
||||||
|
elif message.channel.id == 139061614178598912: #don't abuse the "belangrijk" channel
|
||||||
|
pass
|
||||||
else:
|
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:
|
#process commands:
|
||||||
yield from self.bot.process_commands(message)
|
yield from self.bot.process_commands(message)
|
||||||
|
|||||||
Reference in New Issue
Block a user