diff --git a/bot.py b/bot.py index bf02283..b9eaa7e 100644 --- a/bot.py +++ b/bot.py @@ -4,8 +4,6 @@ import subprocess import json import discord from discord import app_commands -from discord.ext.commands import has_role, MissingRole - with open('config.json', 'r') as f: data = json.load(f) @@ -35,14 +33,14 @@ async def cool(ctx): await ctx.response.send_message(f'{ctx.author} is {cool_factor}% cool!') @tree.command(name = 'update', description = 'Pulls the latest version from the repository', guild=discord.Object(id='745287426402156555')) -@has_role(745295653651087381) +@app_commands.checks.has_role(745295653651087381) async def update(ctx): subprocess.Popen('./update.sh') print(f'Updating, see you on the other side') @update.error async def update_error(ctx: discord.Interaction, error): - if isinstance(error, MissingRole): + if isinstance(error, discord.app_commands.MissingRole): text = "Sorry {}, you do not have permissions to do that!".format(ctx.message.author) await ctx.response.send_message(text)