correctly reply whether keyword was removed
This commit is contained in:
parent
0b117ab6aa
commit
7ecf14be46
1 changed files with 10 additions and 2 deletions
|
@ -334,12 +334,20 @@ class Notifications(Cog):
|
|||
"""
|
||||
|
||||
log.debug(f"Removing keyword: {keyword} of {ctx.author} (ctx.author.id) on {ctx.guild} ({ctx.guild.id})")
|
||||
await ctx.bot.db.execute(
|
||||
cursor = await ctx.bot.db.execute(
|
||||
"DELETE FROM keywords WHERE guild_id=? AND keyword=? AND user_id=?",
|
||||
(ctx.guild.id, keyword, ctx.author.id),
|
||||
)
|
||||
await ctx.bot.db.commit()
|
||||
await ctx.send(f"Removed `{keyword}` from your list of keywords")
|
||||
if cursor.rowcount:
|
||||
log.debug("Removed keyword")
|
||||
await ctx.send(f"Removed `{keyword}` from your list of keywords")
|
||||
else:
|
||||
log.debug("Keyword not found")
|
||||
await ctx.send(
|
||||
f"Keyword `{keyword}` not found.\n**Note:** Removing keywords is case-sensitive, double check that the keyword is exactly as listed in `{await ctx.bot.get_guild_prefix(ctx.guild)
|
||||
}keyword list`"
|
||||
)
|
||||
|
||||
@keyword.command()
|
||||
@guild_only()
|
||||
|
|
Loading…
Add table
Reference in a new issue