Restrict quote remove command to admins
This commit is contained in:
2
bot.py
2
bot.py
@@ -294,6 +294,8 @@ async def quote_command(ctx: commands.Context, author: Optional[str], *, quote:
|
|||||||
|
|
||||||
@bot.command(name='quote_remove', brief='Remove a quote')
|
@bot.command(name='quote_remove', brief='Remove a quote')
|
||||||
async def quote_remove_command(ctx: discord.Context, author: str, quote: str):
|
async def quote_remove_command(ctx: discord.Context, author: str, quote: str):
|
||||||
|
if not ctx.author.guild_permissions.administrator:
|
||||||
|
await ctx.channel.send("Only admins are allowed to remove quotes!")
|
||||||
quotes: Optional[dict[str, List[str]]] = config_get("guild_access", guild=ctx.guild.id)
|
quotes: Optional[dict[str, List[str]]] = config_get("guild_access", guild=ctx.guild.id)
|
||||||
if quotes is None:
|
if quotes is None:
|
||||||
await ctx.channel.send("No quotes available!")
|
await ctx.channel.send("No quotes available!")
|
||||||
|
|||||||
Reference in New Issue
Block a user