Skip to content

Commit 1dced2b

Browse files
Rename sent to responded
1 parent f013df4 commit 1dced2b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

discord_slash/context.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SlashContext:
2727
:ivar _logger: Logger instance.
2828
:ivar deffered: Whether the command is current deffered (loading state)
2929
:ivar _deffered_hidden: Internal var to check that state stays the same
30-
:ivar sent: Whether you sent the initial response.
30+
:ivar responded: Whether you have responded with a message to the interaction.
3131
:ivar guild_id: Guild ID of the command message. If the command was invoked in DM, then it is ``None``
3232
:ivar author_id: User ID representing author of the command message.
3333
:ivar channel_id: Channel ID representing channel of the command message.
@@ -50,7 +50,7 @@ def __init__(self,
5050
self.bot = _discord
5151
self._logger = logger
5252
self.deffered = False
53-
self.sent = False
53+
self.responded = False
5454
self._deffered_hidden = False # To check if the patch to the deffered response matches
5555
self.guild_id = int(_json["guild_id"]) if "guild_id" in _json.keys() else None
5656
self.author_id = int(_json["member"]["user"]["id"] if "member" in _json.keys() else _json["user"]["id"])
@@ -86,7 +86,7 @@ async def defer(self, hidden: bool = False):
8686
8787
:param hidden: Whether the deffered response should be ephemeral . Default ``False``.
8888
"""
89-
if self.deffered or self.sent:
89+
if self.deffered or self.responded:
9090
raise error.AlreadyResponded("You have already responded to this command!")
9191
base = {"type": 5}
9292
if hidden:
@@ -165,7 +165,7 @@ async def send(self,
165165
base["flags"] = 64
166166

167167
initial_message = False
168-
if not self.sent:
168+
if not self.responded:
169169
initial_message = True
170170
if files:
171171
raise error.IncorrectFormat("You cannot send files in the initial response!")
@@ -187,7 +187,7 @@ async def send(self,
187187
resp = await self._http.edit({}, self.__token)
188188
else:
189189
resp = {}
190-
self.sent = True
190+
self.responded = True
191191
else:
192192
resp = await self._http.post_followup(base, self.__token, files=files)
193193
if not hidden:

docs/migration.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ Sending hidden messages
5151
***********************
5252
The method ``.send_hidden`` on :class:`SlashContext` has been removed. Use ``.send(hidden = True, ..)`` instead.
5353

54-
55-
54+
SlashContext
55+
************
56+
``ctx.sent`` has been renamed to :attr:`ctx.responded <.SlashContext.responded>`
5657

5758

5859
Migrate To 1.0.9

0 commit comments

Comments
 (0)