From 4f816216f8c76fa120f1dfd7d2992dbcb3e1875f Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Mon, 3 Jul 2017 21:01:57 -0500 Subject: [PATCH] Add the ability to turn off birthday announcemtns --- cogs/admin.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cogs/admin.py b/cogs/admin.py index 0049a4c..6ac1802 100644 --- a/cogs/admin.py +++ b/cogs/admin.py @@ -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)