69
69
if TYPE_CHECKING :
70
70
from .abc import GuildChannel , PrivateChannel , Snowflake , SnowflakeTime
71
71
from .channel import DMChannel
72
- from .interaction import Interaction
72
+ from .interactions import Interaction
73
73
from .member import Member
74
74
from .message import Message
75
75
from .poll import Poll
@@ -553,6 +553,15 @@ async def on_view_error(
553
553
The default view error handler provided by the client.
554
554
555
555
This only fires for a view if you did not define its :func:`~discord.ui.View.on_error`.
556
+
557
+ Parameters
558
+ ----------
559
+ error: :class:`Exception`
560
+ The exception that was raised.
561
+ item: :class:`Item`
562
+ The item that the user interacted with.
563
+ interaction: :class:`Interaction`
564
+ The interaction that was received.
556
565
"""
557
566
558
567
print (
@@ -570,6 +579,13 @@ async def on_modal_error(self, error: Exception, interaction: Interaction) -> No
570
579
The default implementation prints the traceback to stderr.
571
580
572
581
This only fires for a modal if you did not define its :func:`~discord.ui.Modal.on_error`.
582
+
583
+ Parameters
584
+ ----------
585
+ error: :class:`Exception`
586
+ The exception that was raised.
587
+ interaction: :class:`Interaction`
588
+ The interaction that was received.
573
589
"""
574
590
575
591
print (f"Ignoring exception in modal { interaction .modal } :" , file = sys .stderr )
@@ -1297,7 +1313,7 @@ def add_listener(self, func: Coro, name: str = MISSING) -> None:
1297
1313
TypeError
1298
1314
The ``func`` parameter is not a coroutine function.
1299
1315
ValueError
1300
- The ``name`` (event name) does not start with ' on_'
1316
+ The ``name`` (event name) does not start with `` on_``.
1301
1317
1302
1318
Example
1303
1319
-------
@@ -1361,7 +1377,7 @@ def listen(self, name: str = MISSING, once: bool = False) -> Callable[[Coro], Co
1361
1377
TypeError
1362
1378
The function being listened to is not a coroutine.
1363
1379
ValueError
1364
- The ``name`` (event name) does not start with ' on_'
1380
+ The ``name`` (event name) does not start with `` on_``.
1365
1381
1366
1382
Example
1367
1383
-------
0 commit comments