1
0
Fork 0
mirror of synced 2024-06-01 18:29:38 +12:00

Check if noticiations are set to on for a server; assume off by default

This commit is contained in:
Phxntxm 2016-08-01 10:28:00 -05:00
parent 040c596f40
commit cce19493c1

18
bot.py
View file

@ -43,6 +43,24 @@ async def on_ready():
if not hasattr(bot, 'uptime'):
bot.uptime = datetime.datetime.utcnow()
@bot.event
async def on_member_join(member):
notifications = config.getContent('user_notifications') or {}
server_notifications = notifications.get(member.server.id)
if not server_notifications:
return
await bot.send_message(member.server, "Welcome to the '{0.server.name}' server {0.mention}!".format(member))
@bot.event
async def on_member_remove(member):
notifications = config.getContent('user_notifications') or {}
server_notifications = notifications.get(member.server.id)
if not server_notifications:
return
await bot.send_message(member.server,
"{0} has left the server, I hope it wasn't because of something I said :c".format(member))
@bot.event
async def on_message(message):