Skip to content

Commit 46b5cc8

Browse files
committed
Fixed error when allowed_mentions is None
1 parent 830e87c commit 46b5cc8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

discord_slash/model.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,15 @@ async def send(self,
6565
"tts": tts,
6666
"content": content,
6767
"embeds": [x.to_dict() for x in embeds] if embeds else [],
68-
"allowed_mentions": [x.to_dict() for x in allowed_mentions] if allowed_mentions else self._discord.allowed_mentions.to_dict()
68+
"allowed_mentions": [x.to_dict() for x in allowed_mentions] if allowed_mentions
69+
else self._discord.allowed_mentions.to_dict() if self._discord.allowed_mentions else []
6970
}
7071
} if not self.sent else {
7172
"content": content,
7273
"tts": tts,
7374
"embeds": [x.to_dict() for x in embeds] if embeds else [],
74-
"allowed_mentions": [x.to_dict() for x in allowed_mentions] if allowed_mentions else self._discord.allowed_mentions.to_dict()
75+
"allowed_mentions": [x.to_dict() for x in allowed_mentions] if allowed_mentions
76+
else self._discord.allowed_mentions.to_dict() if self._discord.allowed_mentions else []
7577
}
7678
initial = True if not self.sent else False
7779
resp = await self._http.post(base, self._discord.user.id, self.interaction_id, self.__token, initial)

0 commit comments

Comments
 (0)