First pass at supporting user apps

Co-authored-by: red <red@kalab.sk>
Co-authored-by: Vioshim <63890837+Vioshim@users.noreply.github.com>
This commit is contained in:
Danny
2024-05-04 23:25:01 -04:00
committed by GitHub
parent 2892401992
commit 2e2f51fd5c
19 changed files with 920 additions and 52 deletions

View File

@@ -179,7 +179,7 @@ class Namespace:
state = interaction._state
members = resolved.get('members', {})
guild_id = interaction.guild_id
guild = state._get_or_create_unavailable_guild(guild_id) if guild_id is not None else None
guild = interaction.guild
type = AppCommandOptionType.user.value
for (user_id, user_data) in resolved.get('users', {}).items():
try:
@@ -220,7 +220,6 @@ class Namespace:
}
)
guild = state._get_guild(guild_id)
for (message_id, message_data) in resolved.get('messages', {}).items():
channel_id = int(message_data['channel_id'])
if guild is None:
@@ -232,6 +231,7 @@ class Namespace:
# Type checker doesn't understand this due to failure to narrow
message = Message(state=state, channel=channel, data=message_data) # type: ignore
message.guild = guild
key = ResolveKey(id=message_id, type=-1)
completed[key] = message