have bot respond to role mentions too

This commit is contained in:
xenofem 2020-05-13 17:08:28 -04:00
parent e9889e28f1
commit c4f04c80c5

View file

@ -33,7 +33,10 @@ class MyClient(discord.Client):
print('logged in as {0.user}'.format(self), file=sys.stderr)
async def on_message(self, message):
if message.author == self.user or self.user not in message.mentions:
if message.author == self.user:
return
if self.user not in message.mentions and self.user not in [m for m in role.members for role in message.role_mentions]:
return
await message.channel.send(gen_sentence())