diff options
author | Mango0x45 <dogelikestopkekmemes@gmail.com> | 2020-06-26 11:45:11 +0000 |
---|---|---|
committer | Mango0x45 <dogelikestopkekmemes@gmail.com> | 2020-06-26 11:45:11 +0000 |
commit | a03418e080fb837899021783b7cf8e2c63cf7880 (patch) | |
tree | 845f67724aa0c0e6a9964f6f58c363854582ac01 | |
parent | 34ab35efecbcfd7eedd47c016fc669ee7f6be6dd (diff) | |
download | steve-bot-a03418e080fb837899021783b7cf8e2c63cf7880.tar steve-bot-a03418e080fb837899021783b7cf8e2c63cf7880.tar.gz steve-bot-a03418e080fb837899021783b7cf8e2c63cf7880.tar.bz2 steve-bot-a03418e080fb837899021783b7cf8e2c63cf7880.tar.lz steve-bot-a03418e080fb837899021783b7cf8e2c63cf7880.tar.xz steve-bot-a03418e080fb837899021783b7cf8e2c63cf7880.tar.zst steve-bot-a03418e080fb837899021783b7cf8e2c63cf7880.zip |
Fixed stuff, and removed password on logs
Diffstat (limited to '')
-rw-r--r-- | cogs/admin.py | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/cogs/admin.py b/cogs/admin.py index fa243bf..489d59a 100644 --- a/cogs/admin.py +++ b/cogs/admin.py @@ -13,20 +13,17 @@ class Admin(commands.Cog): async def is_mod(ctx): return ctx.author.guild_permissions.manage_channels - async def is_botmaster(self, ctx): - return ctx.author.id in self.bot.config[str(ctx.message.guild.id)]["bot_masters"] - @commands.command(aliases=['deleteEverything'], hidden=True) - @commands.check(is_botmaster) async def purge(self, ctx): - async for msg in ctx.channel.history(): - await msg.delete() + if ctx.author.id in self.bot.config[str(ctx.message.guild.id)]["bot_masters"]: + async for msg in ctx.channel.history(): + await msg.delete() @commands.command(aliases=['quit'], hidden=True) - @commands.check(is_botmaster) async def forceexit(self, ctx): - await ctx.message.delete() - exit() + if ctx.author.id in self.bot.config[str(ctx.message.guild.id)]["bot_masters"]: + await ctx.send('Self Destructing') + exit() @commands.command() @commands.check(is_mod) @@ -163,9 +160,8 @@ class Admin(commands.Cog): await ctx.send("{0.mention} has been unmuted by {1.mention}".format(i, ctx.author)) @commands.command() - @commands.check(is_mod) - async def logs(self, ctx, *, password): - if password == "beep boop": + async def logs(self, ctx, *): + if ctx.author.id in self.bot.config[str(ctx.message.guild.id)]["bot_master"]: await ctx.message.delete() file = discord.File("discord.log") await ctx.send(file=file) @@ -192,7 +188,7 @@ class Admin(commands.Cog): @commands.command() @commands.check(is_mod) - async def activity(self, ctx,*, activity=None): + async def activity(self, ctx, *, activity=None): if activity: game = discord.Game(activity) else: @@ -202,13 +198,13 @@ class Admin(commands.Cog): await ctx.send(f"Activity changed to {activity}") @commands.command() - @commands.check(is_botmaster) async def setvar(self, ctx, key, *, value): - with open('config.json', 'w') as f: - if value[0] == '[' and value[len(value)-1] == ']': - value = list(map(int, value[1:-1].split(','))) - self.bot.config[str(ctx.message.guild.id)][key] = value - json.dump(self.bot.config, f, indent=4) + if ctx.author.id in self.bot.config[str(ctx.message.guild.id)]["bot_masters"]: + with open('config.json', 'w') as f: + if value[0] == '[' and value[len(value)-1] == ']': + value = list(map(int, value[1:-1].split(','))) + self.bot.config[str(ctx.message.guild.id)][key] = value + json.dump(self.bot.config, f, indent=4) @commands.command() @commands.check(is_mod) |