refactor: add helper for checkmark reaction

This commit is contained in:
Ryan 2024-12-30 14:56:12 -05:00
parent a8a4cb910a
commit 2f3cf9f81b
Signed by: ErrorNoInternet
GPG Key ID: 2486BFB7B1E6A4A3
4 changed files with 8 additions and 3 deletions

View File

@ -29,7 +29,7 @@ async def queue_or_play(message):
if args.clear: if args.clear:
player_queue[message.guild.id] = [] player_queue[message.guild.id] = []
await message.add_reaction("") await utils.add_check_reaction(message)
return return
elif query := args.query: elif query := args.query:
try: try:

View File

@ -70,7 +70,7 @@ async def on_message(message):
disnake_paginator.wrappers.MessageInteractionWrapper(message) disnake_paginator.wrappers.MessageInteractionWrapper(message)
) )
elif len(output.strip()) == 0: elif len(output.strip()) == 0:
await message.add_reaction("") await utils.add_check_reaction(message)
else: else:
await message.channel.send(output) await message.channel.send(output)
case C.CLEAR | C.PURGE: case C.CLEAR | C.PURGE:

View File

@ -7,6 +7,7 @@ import commands
import constants import constants
import core import core
import events import events
import utils
from state import client, start_time from state import client, start_time
@ -42,7 +43,7 @@ async def on_message(message):
): ):
rreload(reloaded_modules, module) rreload(reloaded_modules, module)
await message.add_reaction("") await utils.add_check_reaction(message)
return return
await events.on_message(message) await events.on_message(message)

View File

@ -3,6 +3,10 @@ import disnake
import constants import constants
async def add_check_reaction(message):
await message.add_reaction("")
async def reply(message, *args): async def reply(message, *args):
await message.reply(*args, allowed_mentions=disnake.AllowedMentions.none()) await message.reply(*args, allowed_mentions=disnake.AllowedMentions.none())