77
77
if TYPE_CHECKING :
78
78
from .abc import GuildChannel , PrivateChannel , Snowflake , SnowflakeTime
79
79
from .channel import DMChannel
80
- from .interaction import Interaction
80
+ from .interactions import Interaction
81
81
from .member import Member
82
82
from .message import Message
83
83
from .poll import Poll
@@ -554,6 +554,15 @@ async def on_view_error(self, error: Exception, item: Item, interaction: Interac
554
554
The default view error handler provided by the client.
555
555
556
556
This only fires for a view if you did not define its :func:`~discord.ui.View.on_error`.
557
+
558
+ Parameters
559
+ ----------
560
+ error: :class:`Exception`
561
+ The exception that was raised.
562
+ item: :class:`Item`
563
+ The item that the user interacted with.
564
+ interaction: :class:`Interaction`
565
+ The interaction that was received.
557
566
"""
558
567
559
568
print (
@@ -569,6 +578,13 @@ async def on_modal_error(self, error: Exception, interaction: Interaction) -> No
569
578
The default implementation prints the traceback to stderr.
570
579
571
580
This only fires for a modal if you did not define its :func:`~discord.ui.Modal.on_error`.
581
+
582
+ Parameters
583
+ ----------
584
+ error: :class:`Exception`
585
+ The exception that was raised.
586
+ interaction: :class:`Interaction`
587
+ The interaction that was received.
572
588
"""
573
589
574
590
print (f"Ignoring exception in modal { interaction .modal } :" , file = sys .stderr )
@@ -1270,7 +1286,7 @@ def add_listener(self, func: Coro, name: str | utils.Undefined = MISSING) -> Non
1270
1286
TypeError
1271
1287
The ``func`` parameter is not a coroutine function.
1272
1288
ValueError
1273
- The ``name`` (event name) does not start with ' on_'
1289
+ The ``name`` (event name) does not start with `` on_``.
1274
1290
1275
1291
Example
1276
1292
-------
@@ -1339,7 +1355,7 @@ def listen(self, name: str | utils.Undefined = MISSING, once: bool = False) -> C
1339
1355
TypeError
1340
1356
The function being listened to is not a coroutine.
1341
1357
ValueError
1342
- The ``name`` (event name) does not start with ' on_'
1358
+ The ``name`` (event name) does not start with `` on_``.
1343
1359
1344
1360
Example
1345
1361
-------
0 commit comments