rolespace 0.2.4__tar.gz → 0.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rolespace
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: Official Rolespace bot SDK for Python
5
5
  Author: Rolespace
6
6
  License: MIT License
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "rolespace"
3
- version = "0.2.4"
3
+ version = "0.2.6"
4
4
  description = "Official Rolespace bot SDK for Python"
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rolespace
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: Official Rolespace bot SDK for Python
5
5
  Author: Rolespace
6
6
  License: MIT License
@@ -785,6 +785,26 @@ class Rolespace:
785
785
  self.post(f"/servers/{server_id}/channels/{channel_id}/messages", payload)
786
786
  )
787
787
 
788
+ def send_ephemeral(self, server_id: int, channel_id: int, recipient_user_id: int,
789
+ content: Union[str, RolespaceEmbed, "Components", None] = "",
790
+ *extras) -> dict:
791
+ """Send an ephemeral message to a single user in a channel — they see it,
792
+ nobody else does, and it's gone on reload. Accepts the same extras as
793
+ ``send_message`` (embeds and/or one Components panel).
794
+
795
+ Same scopes/permissions as a normal send, plus the recipient must be able
796
+ to view the channel.
797
+
798
+ Example::
799
+
800
+ # Reply ephemerally to whoever just typed "!secret":
801
+ rs.send_ephemeral(server_id, channel_id, msg.author.id,
802
+ "Here's your private info 👀")
803
+ """
804
+ payload = _build_message_payload(content, extras)
805
+ payload["recipientAccountId"] = recipient_user_id
806
+ return self.post(f"/servers/{server_id}/channels/{channel_id}/ephemeral", payload)
807
+
788
808
  def list_messages(self, server_id: int, channel_id: int, limit: int = 50,
789
809
  before: Optional[str] = None) -> List[RolespaceMessage]:
790
810
  """Recent messages, oldest → newest. Pass ``before`` (a message id) to page backwards."""
File without changes
File without changes
File without changes
File without changes