Skip to content
This repository was archived by the owner on Mar 8, 2022. It is now read-only.

Commit 5e1aa32

Browse files
author
kuso-senpai
committed
updated docs + added tool import
1 parent 9259a12 commit 5e1aa32

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

discord_ui/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from .slash.types import OptionType, SlashPermission, SlashOption
3737
from .slash.tools import ParseMethod
3838
from .tools import components_to_dict
39+
from .slash.tools import create_choice
3940
from .receive import Interaction, InteractionType, ResponseMessage, Message, WebhookMessage, PressedButton, SelectedMenu, SlashedCommand, SlashedSubCommand, EphemeralMessage, EphemeralResponseMessage
4041

4142
from .override import override_dpy, override_dpy2_client

discord_ui/components.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class SelectMenu(Component):
201201
custom_id: :class:`str`
202202
The custom_id for identifying the menu, max 100 characters
203203
options: List[:class:`~SelectOption`]
204-
A list of optionns to select from
204+
A list of options to select from
205205
min_values: :class:`int`, optional
206206
The minimum number of items that must be chosen; default ``1``, min 0, max 25
207207
max_values: :class:`int`, optional

discord_ui/slash/types.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class SlashOption():
3232
3333
The choice value has to be of the same type as the type this option accepts
3434
35-
options: :class:`~SlashOption`
35+
options: List[:class:`~SlashOption`]
3636
This parameter is only for subcommands to work, you shouldn't need to use that, unless you know what you're doing
3737
"""
3838
def __init__(self, argument_type, name, description=MISSING, required=False, choices=[], options=[]) -> None:
@@ -132,6 +132,10 @@ def choices(self, value):
132132

133133
@property
134134
def options(self) -> typing.List['SlashOption']:
135+
"""The parameters for the command
136+
137+
:type: List[:class:`~SlashOptions`], optional
138+
"""
135139
return [SlashOption._from_data(x) for x in self._json.get("options", [])]
136140
@options.setter
137141
def options(self, options):
@@ -509,6 +513,10 @@ def options(self, options):
509513
# region permissions
510514
@property
511515
def default_permission(self) -> bool:
516+
"""Whether this command can be used by default or not
517+
518+
:type: :class:`bool`
519+
"""
512520
return self._json.get("default_permission", False)
513521
@default_permission.setter
514522
def default_permission(self, value):

docs/source/slash.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,9 @@ EphemeralResponseMessage
103103
~~~~~~~~~~~~~~~~~~~~~~~~
104104

105105
.. autoclass:: EphemeralResponseMessage()
106-
:members:
106+
:members:
107+
108+
Tools
109+
=========
110+
111+
.. autofunction:: create_choice

0 commit comments

Comments
 (0)