1
0
Fork 0
mirror of synced 2024-05-18 19:42:28 +12:00

Add the ability to turn off birthday announcemtns

This commit is contained in:
Phxntxm 2017-07-03 21:01:57 -05:00
parent 9fd3891125
commit 4f816216f8

View file

@ -13,6 +13,27 @@ class Administration:
def __init__(self, bot):
self.bot = bot
@commands.command()
@commands.guild_only()
@utils.custom_perms(manage_guild=True)
@utils.check_restricted()
async def allowbirthdays(self, ctx, setting):
"""Turns on/off the birthday announcements in this server
EXAMPLE: !allowbirthdays on
RESULT: Playlists can now be used"""
if setting.lower() in ['on', 'yes', 'true']:
allowed = True
else:
allowed = False
entry = {
'server_id': str(ctx.message.guild.id),
'birthdays_allowed': allowed
}
self.bot.db.save('server_settings', entry)
fmt = "The birthday announcements have just been turned {}".format("on" if allowed else "off")
await ctx.send(fmt)
@commands.command()
@commands.guild_only()
@utils.custom_perms(manage_guild=True)