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:
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user