Skip to content

Commit 29b342e

Browse files
fix: Mentionable select type bug (#1122)
* fix: Mentionable select type bug * ci: correct from checks. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 400b94e commit 29b342e

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

interactions/api/gateway/client.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -873,14 +873,15 @@ def __select_option_type_context(self, context: "_Context", type: int) -> dict:
873873
elif type == ComponentType.ROLE_SELECT.value:
874874
_resolved = context.data.resolved.roles
875875
elif type == ComponentType.MENTIONABLE_SELECT.value:
876-
_resolved = {
877-
**(
878-
context.data.resolved.members
879-
if context.guild_id
880-
else context.data.resolved.users
881-
),
882-
**context.data.resolved.roles,
883-
}
876+
if (
877+
users := context.data.resolved.members
878+
if context.guild_id
879+
else context.data.resolved.users
880+
):
881+
_resolved.update(**users)
882+
if roles := context.data.resolved.roles:
883+
_resolved.update(**roles)
884+
884885
return _resolved
885886

886887
async def _reconnect(self, to_resume: bool, code: Optional[int] = 1012) -> None:

0 commit comments

Comments
 (0)