Add the abilty to change whether or not the import command can be used
This commit is contained in:
parent
a752d3a3f7
commit
08a31d284b
|
@ -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 allowplaylists(self, ctx, setting):
|
||||
"""Turns on/off the ability to playlists
|
||||
|
||||
EXAMPLE: !allowplaylists 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),
|
||||
'playlists_allowed': allowed
|
||||
}
|
||||
self.bot.db.save('server_settings', entry)
|
||||
fmt = "The ability to use playlists has just been turned {}".format("on" if allowed else "off")
|
||||
await ctx.send(fmt)
|
||||
|
||||
@commands.command()
|
||||
@commands.guild_only()
|
||||
@utils.custom_perms(kick_members=True)
|
||||
|
|
Loading…
Reference in a new issue