Skip to content

Commit 6dc80fc

Browse files
committed
fix: Fix user rights
Change-Id: I9c1376cb22744b793849e5b3859463af0d72af54
1 parent bda4756 commit 6dc80fc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,18 @@
2424

2525
@bot.command()
2626
async def load(ctx, extension):
27+
if not ctx.author.guild_permissions.administrator:
28+
await ctx.respond("你沒有權限使用這個指令!", ephemeral=True)
29+
return
2730
bot.load_extension(f"cog.{extension}")
2831
await ctx.send(f"📖 {extension} loaded")
2932

3033

3134
@bot.command()
3235
async def unload(ctx, extension):
36+
if not ctx.author.guild_permissions.administrator:
37+
await ctx.respond("你沒有權限使用這個指令!", ephemeral=True)
38+
return
3339
bot.unload_extension(f"cog.{extension}")
3440
await ctx.send(f"📖 {extension} unloaded")
3541

0 commit comments

Comments
 (0)