refactor: add helper for sending messages in channel

This commit is contained in:
Ryan 2025-01-05 18:26:45 -05:00
parent c27998abc7
commit ac2fc1c52d
Signed by: ErrorNoInternet
GPG Key ID: 2486BFB7B1E6A4A3
2 changed files with 8 additions and 2 deletions

View File

@ -357,11 +357,11 @@ def play_next(message, once=False):
) )
except Exception as e: except Exception as e:
client.loop.create_task( 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 return
client.loop.create_task( 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)}")
) )

View File

@ -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): async def invalid_user_handler(interaction):
await interaction.response.send_message( await interaction.response.send_message(
"You are not the intended receiver of this message!", ephemeral=True "You are not the intended receiver of this message!", ephemeral=True