Skip to content

Commit d25d1e8

Browse files
committed
Added events docs
1 parent 41c7ca8 commit d25d1e8

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

docs/discord_slash.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Submodules
55
----------
66

77
.. toctree::
8-
:maxdepth: 2
8+
:maxdepth: 4
99

1010
discord_slash.client
1111
discord_slash.error

docs/events.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
discord-py-slash-command Events
2+
================================
3+
This page is about events of this extension.
4+
These events can be registered to discord.py's listener or
5+
``event`` decorator.
6+
7+
.. function:: on_slash_command(ctx)
8+
9+
Called when slash command is triggered.
10+
11+
:param ctx: SlashContext of the triggered command.
12+
:type ctx: :class:`.model.SlashContext`
13+
14+
.. function:: on_slash_command_error(ctx, ex)
15+
16+
Called when slash command had an exception while the command was invoked.
17+
18+
:param ctx: SlashContext of the triggered command.
19+
:type ctx: :class:`.model.SlashContext`
20+
:param ex: Exception that raised.
21+
:type ex: Exception
22+

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Example:
3535
:caption: Contents:
3636

3737
discord_slash.rst
38+
events.rst
3839
discord_slash.utils.rst
3940

4041

0 commit comments

Comments
 (0)