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

Commit e3de4a0

Browse files
author
kuso-senpai
committed
finished v2, changed docs
1 parent 3ed9396 commit e3de4a0

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

discord_message_components/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ async def add_commands(self):
256256
if commands["guilds"].get(_id) is None or commands["guilds"][_id].get(apic["name"]) is None:
257257
await delete_guild_command(self._discord, apic["id"], _id)
258258

259-
print("synchronized slash commands")
259+
# print("synchronized slash commands")
260260

261261
async def _get_api_command(self, name) -> Union[dict, None]:
262262
for x in await self._get_commands():

discord_message_components/receive.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,14 @@ def __init__(self, *, state, application_id, channel, data, user):
588588

589589

590590
class EphemeralComponent(Interaction):
591-
"""A component that will be received when it was created in a hidden response"""
591+
"""Represents a component in a hidden message
592+
593+
.. note::
594+
595+
You will only get this class for components if you set a component on a hidden response in an interaction and the component was used
596+
597+
This class only has the custom_id of the used component, the component type and values
598+
"""
592599
def __init__(self, application_id, state, user, data) -> None:
593600
Interaction.__init__(self, application_id, state, data, user)
594601
self.custom_id = data["data"]["custom_id"]
@@ -602,9 +609,15 @@ def __init__(self, value) -> None:
602609

603610

604611
class EphemeralMessage(Message):
605-
"""A hidden Message
612+
"""Represents a hidden (ephemeral) message
613+
614+
.. note::
615+
616+
You will get this class for a message only if you sent a hidden response
606617
607618
This class is almost the same as the :class:`~Message` class, but you can't edit, delete or reply to the message
619+
620+
If you want to "reply" to id, use the `interaction.send` method instead
608621
"""
609622
def __init__(self, *, state, channel, data):
610623
if data.get("attachments") is None:

docs/source/slash.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,24 @@ SlashedCommand
3131
~~~~~~~~~~~~~~~
3232

3333
.. autoclass:: SlashedCommand()
34+
:members:
35+
:inherited-members:
36+
37+
38+
Ephemeral (hidden) classes
39+
---------------------------
40+
41+
EphemeralComponent
42+
~~~~~~~~~~~~~~~~~~~
43+
44+
.. autoclass:: EphemeralComponent()
45+
:members:
46+
:inherited-members:
47+
48+
49+
EphemeralMessage
50+
~~~~~~~~~~~~~~~~
51+
52+
.. autoclass:: EphemeralMessage()
3453
:members:
3554
:inherited-members:

0 commit comments

Comments
 (0)