From c773adb4240ea87f19346641ea4aee0a03a21a50 Mon Sep 17 00:00:00 2001 From: FO-nTTaX Date: Wed, 25 Aug 2021 01:35:32 +0200 Subject: [PATCH] use framework is_owner --- ftsbot/cogs/rolecommands.py | 4 ++-- ftsbot/config.py | 2 -- ftsbot/functions/decoratorfunctions.py | 16 ---------------- 3 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 ftsbot/functions/decoratorfunctions.py diff --git a/ftsbot/cogs/rolecommands.py b/ftsbot/cogs/rolecommands.py index 163f726..f04321f 100644 --- a/ftsbot/cogs/rolecommands.py +++ b/ftsbot/cogs/rolecommands.py @@ -9,7 +9,7 @@ from dislash import * from discord.ext import commands from ftsbot import data -from ftsbot.functions import decoratorfunctions, rolefunctions +from ftsbot.functions import rolefunctions class rolecommands(commands.Cog): def __init__(self, bot): @@ -43,7 +43,7 @@ async def wikiroles(self, ctx): message = await ctx.send(embed=discord.Embed(colour=discord.Colour(0x00ff00), description='**Success**: Wiki Roles added to "' + ctx.author.name + '"')) await message.delete(delay=30) - @decoratorfunctions.is_bot_owner() + @slash_commands.is_owner() @slash_commands.command(description='Form setup (admin only)') async def setup(self, ctx): # Clean up channel diff --git a/ftsbot/config.py b/ftsbot/config.py index 966c06e..000c841 100644 --- a/ftsbot/config.py +++ b/ftsbot/config.py @@ -4,7 +4,5 @@ # Copyright 2016-2021 Alex Winkler # Version 3.0.0 -author = 138719439834185728 - logtarget = 339287109988909057 # Here the channel id of the channel we want the private channel logs to be stored in privcat = 360564294401916929 # This is the id of the "Private Channels" Category diff --git a/ftsbot/functions/decoratorfunctions.py b/ftsbot/functions/decoratorfunctions.py deleted file mode 100644 index 1843098..0000000 --- a/ftsbot/functions/decoratorfunctions.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python3 - -# License MIT -# Copyright 2016-2021 Alex Winkler -# Version 3.0.0 - -from discord.ext import commands -from dislash import * -from ftsbot import config - -def is_bot_owner(): - def predicate(ctx): - if ctx.guild is None: - return False - return ctx.author.id == config.author - return check(predicate)