Fix send function context handling and queueType key

Updated the send function to correctly handle TempCtx and only include 'ephemeral' if supported by the send function. Also fixed the key from 'queue_type' to 'queueType' in the Player's IPC message for consistency with expected API.
This commit is contained in:
Choco
2025-08-06 10:48:44 +08:00
parent 0b15f1d5f4
commit 07b2576729
2 changed files with 7 additions and 4 deletions

View File

@@ -211,8 +211,9 @@ async def send(
# Determine the sending function
send_func = (
ctx.send if isinstance(ctx, commands.Context) else
ctx.followup.send if ctx.response.is_done() else
ctx.send if isinstance(ctx, commands.Context) else
ctx.channel.send if isinstance(ctx, TempCtx) else
ctx.followup.send if ctx.response.is_done() else
ctx.response.send_message
)
@@ -221,7 +222,6 @@ async def send(
send_kwargs = {
"content": text,
"embed": embed,
"ephemeral": ephemeral,
"allowed_mentions": ALLOWED_MENTIONS,
"silent": settings.get("silent_msg", False),
}
@@ -231,6 +231,9 @@ async def send(
delete_after = 10
send_kwargs["delete_after"] = delete_after
if "ephemeral" in send_func.__code__.co_varnames:
send_kwargs["ephemeral"] = ephemeral
if view:
send_kwargs["view"] = view

View File

@@ -788,7 +788,7 @@ class Player(VoiceProtocol):
if self.is_ipc_connected:
await self.send_ws({
"op": "clearQueue",
"queue_type": queue_type
"queueType": queue_type
}, requester)
async def remove_filter(self, filter_tag: str, requester: Member = None, fast_apply: bool = False) -> Filters: