refactor: add helper for sending messages in channel
This commit is contained in:
parent
c27998abc7
commit
ac2fc1c52d
@ -357,11 +357,11 @@ def play_next(message, once=False):
|
||||
)
|
||||
except Exception as e:
|
||||
client.loop.create_task(
|
||||
message.channel.send(f"error while trying to play: `{e}`")
|
||||
utils.channel_send(message, f"error while trying to play: `{e}`")
|
||||
)
|
||||
return
|
||||
client.loop.create_task(
|
||||
message.channel.send(f"**0.** {queued.format(show_queuer=True)}")
|
||||
utils.channel_send(message, f"**0.** {queued.format(show_queuer=True)}")
|
||||
)
|
||||
|
||||
|
||||
|
6
utils.py
6
utils.py
@ -39,6 +39,12 @@ async def reply(message, *args, **kwargs):
|
||||
)
|
||||
|
||||
|
||||
async def channel_send(message, *args, **kwargs):
|
||||
await message.channel.send(
|
||||
*args, **kwargs, allowed_mentions=disnake.AllowedMentions.none()
|
||||
)
|
||||
|
||||
|
||||
async def invalid_user_handler(interaction):
|
||||
await interaction.response.send_message(
|
||||
"You are not the intended receiver of this message!", ephemeral=True
|
||||
|
Loading…
x
Reference in New Issue
Block a user