Skip to content

Commit e3bf048

Browse files
committed
Remove wait param since its always true
1 parent 24e876b commit e3bf048

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

discord_slash/context.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ async def respond(self, eat: bool = False):
8585
:param eat: Whether to eat user's input. Default ``False``.
8686
"""
8787
base = {"type": 2 if eat else 5}
88-
_task = self.bot.loop.create_task(self._http.post(base, False, self.interaction_id, self.__token, True))
88+
_task = self.bot.loop.create_task(self._http.post(base, self.interaction_id, self.__token, True))
8989
self.sent = True
9090
if not eat:
9191
with suppress(asyncio.TimeoutError):
@@ -108,7 +108,6 @@ def ack(self):
108108

109109
async def send(self,
110110
content: str = "", *,
111-
wait: bool = False,
112111
embed: discord.Embed = None,
113112
embeds: typing.List[discord.Embed] = None,
114113
tts: bool = False,
@@ -129,7 +128,6 @@ async def send(self,
129128
130129
:param content: Content of the response.
131130
:type content: str
132-
:param wait: Whether the server should wait before sending a response.
133131
:param embed: Embed of the response.
134132
:type embed: discord.Embed
135133
:param embeds: Embeds of the response. Maximum 10.
@@ -179,7 +177,7 @@ async def send(self,
179177
else self.bot.allowed_mentions.to_dict() if self.bot.allowed_mentions else {}
180178
}
181179

182-
resp = await self._http.post(base, wait, self.interaction_id, self.__token, files=files)
180+
resp = await self._http.post(base, self.interaction_id, self.__token, files=files)
183181
smsg = model.SlashMessage(state=self.bot._connection,
184182
data=resp,
185183
channel=self.channel or discord.Object(id=self.channel),

discord_slash/http.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,12 @@ def command_request(self, method, guild_id, url_ending="", **kwargs):
7878
route = CustomRoute(method, url)
7979
return self._discord.http.request(route, **kwargs)
8080

81-
def post(self, _resp, wait: bool, interaction_id, token, initial=False, files: typing.List[discord.File] = None):
81+
def post(self, _resp, interaction_id, token, initial=False, files: typing.List[discord.File] = None):
8282
"""
8383
Sends command response POST request to Discord API.
8484
8585
:param _resp: Command response.
8686
:type _resp: dict
87-
:param wait: Whether the server should wait before sending a response.
88-
:type wait: bool
8987
:param interaction_id: Interaction ID.
9088
:param token: Command message token.
9189
:param initial: Whether this request is initial. Default ``False``
@@ -94,13 +92,13 @@ def post(self, _resp, wait: bool, interaction_id, token, initial=False, files: t
9492
:return: Coroutine
9593
"""
9694
if files:
97-
return self.post_with_files(_resp, wait, files, token)
98-
req_url = f"/interactions/{interaction_id}/{token}/callback" if initial else f"/webhooks/{self._discord.user.id}/{token}?wait={'true' if wait else 'false'}"
95+
return self.post_with_files(_resp, files, token)
96+
req_url = f"/interactions/{interaction_id}/{token}/callback" if initial else f"/webhooks/{self._discord.user.id}/{token}"
9997
route = CustomRoute("POST", req_url)
10098
return self._discord.http.request(route, json=_resp)
10199

102-
def post_with_files(self, _resp, wait: bool, files: typing.List[discord.File], token):
103-
req_url = f"/webhooks/{self._discord.user.id}/{token}?wait={'true' if wait else 'false'}"
100+
def post_with_files(self, _resp, files: typing.List[discord.File], token):
101+
req_url = f"/webhooks/{self._discord.user.id}/{token}"
104102
route = CustomRoute("POST", req_url)
105103
form = aiohttp.FormData()
106104
form.add_field("payload_json", json.dumps(_resp))

0 commit comments

Comments
 (0)