fix interaction user

This commit is contained in:
DjDeveloper 2021-03-12 15:01:14 +05:30 committed by GitHub
parent 90159fa2da
commit 5b015c6c08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -147,7 +147,9 @@ export class Interaction extends SnowflakeBase {
const op = this.options.find((e) => e.name === name)
if (op === undefined || op.value === undefined) return undefined as any
if (op.type === SlashCommandOptionType.USER)
return this.resolved.users[op.value] as any
const u: InteractionUser = this.resolved.users[op.value] as any
if (this.resolved.members[op.value] !== undefined) u.member = this.resolved.members[op.value] as any
return u
else if (op.type === SlashCommandOptionType.ROLE)
return this.resolved.roles[op.value] as any
else if (op.type === SlashCommandOptionType.CHANNEL)