Skip to content

Commit 36ce1f6

Browse files
Use channel_id instead of channel to get id
Previously, this line caused a crash when sending responses in a guild that uses the applications.commands scope. In this case, SlashContext.channel is None and SlashContext.channel_id has the channel id. This appears to be a holdover from pre-1.0.9 when SlashContext.channel represented either a channel or a channel id.
1 parent 6955da8 commit 36ce1f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

discord_slash/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ async def send(self,
184184
resp = await self._http.post(base, self.interaction_id, self.__token, files=files)
185185
smsg = model.SlashMessage(state=self.bot._connection,
186186
data=resp,
187-
channel=self.channel or discord.Object(id=self.channel),
187+
channel=self.channel or discord.Object(id=self.channel_id),
188188
_http=self._http,
189189
interaction_token=self.__token)
190190
if delete_after:

0 commit comments

Comments
 (0)