mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-05 19:37:25 +00:00
Raise a TypeError if a non-View is passed to Webhook.send
This commit is contained in:
parent
42beec9fa9
commit
3718192b9c
@ -1471,6 +1471,10 @@ class Webhook(BaseWebhook):
|
||||
if view is not MISSING:
|
||||
if isinstance(self._state, _WebhookState):
|
||||
raise ValueError('Webhook views require an associated state with the webhook')
|
||||
|
||||
if not hasattr(view, '__discord_ui_view__'):
|
||||
raise TypeError(f'expected view parameter to be of type View not {view.__class__!r}')
|
||||
|
||||
if ephemeral is True and view.timeout is None:
|
||||
view.timeout = 15 * 60.0
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user