This commit is contained in:
Skillz4Killz
2023-10-28 13:25:09 +00:00
parent ea9fca102a
commit 59631f2fac
17 changed files with 74 additions and 70 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ export function commandOptionsParser(interaction: Interaction, options?: Interac
break
case ApplicationCommandOptionTypes.Attachment:
args[option.name] = interaction.data.resolved?.attachments?.get(BigInt(option.value!))
break;
break
case ApplicationCommandOptionTypes.Mentionable:
// Mentionable are roles or users
args[option.name] = interaction.data.resolved?.roles?.get(BigInt(option.value!)) ?? {
+2 -2
View File
@@ -21,8 +21,8 @@ export function transformMember(bot: Bot, payload: DiscordMember, guildId: BigSt
const member: Member = Object.create(baseMember)
const props = bot.transformers.desiredProperties.member
if (userId && props.id) member.id = typeof userId === "string" ? bot.transformers.snowflake(userId) : userId
if (guildId && props.guildId) member.guildId = typeof guildId === "string" ? bot.transformers.snowflake(guildId) : guildId
if (userId && props.id) member.id = typeof userId === 'string' ? bot.transformers.snowflake(userId) : userId
if (guildId && props.guildId) member.guildId = typeof guildId === 'string' ? bot.transformers.snowflake(guildId) : guildId
if (payload.user && props.user) member.user = bot.transformers.user(bot, payload.user)
if (payload.nick && props.nick) member.nick = payload.nick
if (payload.roles && props.roles) member.roles = payload.roles.map((id) => bot.transformers.snowflake(id))
@@ -17,4 +17,3 @@ export * from './member.js'
export * from './presence.js'
export * from './team.js'
export * from './widgetSettings.js'
+4 -4
View File
@@ -32,11 +32,11 @@ const baseRole: Partial<Role> & BaseRole = {
},
/** Whether this role is available for purchase. */
get availableForPurchase() {
return !!this.toggles?.has('availableForPurchase');
return !!this.toggles?.has('availableForPurchase')
},
/** Whether this is a guild's linked role. */
get guildConnections() {
return !!this.toggles?.has('guildConnections');
return !!this.toggles?.has('guildConnections')
},
}
@@ -111,8 +111,8 @@ export interface Role extends BaseRole {
managed: boolean
/** Whether this role is mentionable */
mentionable: boolean
/**
* Use role.tags
/**
* Use role.tags
* @deprecated this is not deprecated, but this is here to prevent users from using this as this is an internal value open to breaking changes.
*/
internalTags?: {
@@ -23,7 +23,7 @@ export class ToggleBitfield {
}
toJSON(): number {
return this.bitfield;
return this.bitfield
}
}
@@ -52,6 +52,6 @@ export class ToggleBitfieldBigint {
}
toJSON(): string {
return this.bitfield.toString();
return this.bitfield.toString()
}
}
@@ -55,12 +55,12 @@ export class RoleToggles extends ToggleBitfield {
/** Whether this role is available for purchase. */
get availableForPurchase(): boolean {
return this.has('availableForPurchase');
return this.has('availableForPurchase')
}
/** Whether this is a guild's linked role. */
get guildConnections(): boolean {
return this.has('guildConnections');
return this.has('guildConnections')
}
/** Checks whether or not the permissions exist in this */
+1 -1
View File
@@ -10,4 +10,4 @@ export function bigintToSnowflake(snowflake: BigString): string {
export function snowflakeToTimestamp(id: bigint): number {
return Number(id / 4194304n + 1420070400000n)
}
}