refactor: add helper for checkmark reaction
This commit is contained in:
parent
a8a4cb910a
commit
2f3cf9f81b
@ -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:
|
||||||
|
@ -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:
|
||||||
|
3
main.py
3
main.py
@ -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)
|
||||||
|
4
utils.py
4
utils.py
@ -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())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user