fix: only pass ephemeral on interaction paths, not raw-channel send
start() put ephemeral into send_kwargs unconditionally, so the raw Messageable.send() path raised TypeError (discord.py's channel send has no ephemeral param). ephemeral is now passed only on the interaction-response paths (followup.send / response.send_message), which support it; raw-channel send never receives it. Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
parent
f6caa6f016
commit
bca6b874c6
@ -374,15 +374,16 @@ class ButtonPaginator(Generic[PageT_co], discord.ui.View):
|
|||||||
kwargs.pop("view", None)
|
kwargs.pop("view", None)
|
||||||
|
|
||||||
self.reset_files(kwargs)
|
self.reset_files(kwargs)
|
||||||
send_kwargs["ephemeral"] = self.ephemeral
|
|
||||||
|
|
||||||
if isinstance(obj, discord.Interaction):
|
if isinstance(obj, discord.Interaction):
|
||||||
|
# ephemeral is an interaction-response concept; only these paths accept it
|
||||||
if obj.response.is_done():
|
if obj.response.is_done():
|
||||||
self.message = await obj.followup.send(**kwargs, **send_kwargs)
|
self.message = await obj.followup.send(**kwargs, ephemeral=self.ephemeral, **send_kwargs)
|
||||||
else:
|
else:
|
||||||
await obj.response.send_message(**kwargs, **send_kwargs)
|
await obj.response.send_message(**kwargs, ephemeral=self.ephemeral, **send_kwargs)
|
||||||
self.message = await obj.original_response()
|
self.message = await obj.original_response()
|
||||||
elif isinstance(obj, Messageable):
|
elif isinstance(obj, Messageable):
|
||||||
|
# Messageable.send (a raw channel) has no ephemeral param — never pass it
|
||||||
self.message = await obj.send(**kwargs, **send_kwargs)
|
self.message = await obj.send(**kwargs, **send_kwargs)
|
||||||
else:
|
else:
|
||||||
raise TypeError(f"expected Interaction or Messageable, got {obj.__class__.__name__}")
|
raise TypeError(f"expected Interaction or Messageable, got {obj.__class__.__name__}")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user