mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
build(dev-deps): Update biome to v2 (#4246)
* update biome to v2 * Run biome check --write * Update biome.jsonc Co-authored-by: Link <lts20050703@gmail.com> * Fix config error * Bump biome version * Update website/yarn.lock * Update biome to 2.1.3 --------- Co-authored-by: Link <lts20050703@gmail.com>
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
"@discordeno/utils": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@biomejs/biome": "2.1.3",
|
||||
"@swc/cli": "^0.5.2",
|
||||
"@swc/core": "^1.13.3",
|
||||
"@types/chai": "^5.2.2",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { CreateGatewayManagerOptions, GatewayManager } from '@discordeno/gateway'
|
||||
import { ShardSocketCloseCodes, createGatewayManager } from '@discordeno/gateway'
|
||||
import { createGatewayManager, ShardSocketCloseCodes } from '@discordeno/gateway'
|
||||
import type { CreateRestManagerOptions, RestManager } from '@discordeno/rest'
|
||||
import { createRestManager } from '@discordeno/rest'
|
||||
import type { BigString, GatewayDispatchEventNames, GatewayIntents, RecursivePartial } from '@discordeno/types'
|
||||
@@ -12,9 +12,9 @@ import type {
|
||||
TransformersObjects,
|
||||
} from './desiredProperties.js'
|
||||
import type { EventHandlers } from './events.js'
|
||||
import { type BotGatewayHandler, type GatewayHandlers, createBotGatewayHandlers } from './handlers.js'
|
||||
import { type BotGatewayHandler, createBotGatewayHandlers, type GatewayHandlers } from './handlers.js'
|
||||
import { type BotHelpers, createBotHelpers } from './helpers.js'
|
||||
import { type Transformers, createTransformers } from './transformers.js'
|
||||
import { createTransformers, type Transformers } from './transformers.js'
|
||||
|
||||
/**
|
||||
* Create a bot object that will maintain the rest and gateway connection.
|
||||
|
||||
@@ -132,10 +132,7 @@ export type EventHandlers<TProps extends TransformersDesiredProperties, TBehavio
|
||||
stageInstanceCreate: (data: { id: bigint; guildId: bigint; channelId: bigint; topic: string }) => unknown
|
||||
stageInstanceDelete: (data: { id: bigint; guildId: bigint; channelId: bigint; topic: string }) => unknown
|
||||
stageInstanceUpdate: (data: { id: bigint; guildId: bigint; channelId: bigint; topic: string }) => unknown
|
||||
guildEmojisUpdate: (payload: {
|
||||
guildId: bigint
|
||||
emojis: Collection<bigint, SetupDesiredProps<Emoji, TProps, TBehavior>>
|
||||
}) => unknown
|
||||
guildEmojisUpdate: (payload: { guildId: bigint; emojis: Collection<bigint, SetupDesiredProps<Emoji, TProps, TBehavior>> }) => unknown
|
||||
guildBanAdd: (user: SetupDesiredProps<User, TProps, TBehavior>, guildId: bigint) => unknown
|
||||
guildBanRemove: (user: SetupDesiredProps<User, TProps, TBehavior>, guildId: bigint) => unknown
|
||||
guildCreate: (guild: SetupDesiredProps<Guild, TProps, TBehavior>) => unknown
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
export * from './automod/index.js'
|
||||
export * from './scheduledEvents/index.js'
|
||||
|
||||
export * from './GUILD_AUDIT_LOG_ENTRY_CREATE.js'
|
||||
export * from './GUILD_BAN_ADD.js'
|
||||
export * from './GUILD_BAN_REMOVE.js'
|
||||
@@ -9,3 +7,4 @@ export * from './GUILD_DELETE.js'
|
||||
export * from './GUILD_INTEGRATIONS_UPDATE.js'
|
||||
export * from './GUILD_STICKERS_UPDATE.js'
|
||||
export * from './GUILD_UPDATE.js'
|
||||
export * from './scheduledEvents/index.js'
|
||||
|
||||
@@ -10,7 +10,7 @@ export * from './messages/index.js'
|
||||
export * from './misc/index.js'
|
||||
export * from './poll/index.js'
|
||||
export * from './roles/index.js'
|
||||
export * from './voice/index.js'
|
||||
export * from './webhooks/index.js'
|
||||
export * from './soundboard/index.js'
|
||||
export * from './subscriptions/index.js'
|
||||
export * from './voice/index.js'
|
||||
export * from './webhooks/index.js'
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
export * from './MESSAGE_CREATE.js'
|
||||
export * from './MESSAGE_DELETE_BULK.js'
|
||||
export * from './MESSAGE_DELETE.js'
|
||||
export * from './MESSAGE_DELETE_BULK.js'
|
||||
export * from './MESSAGE_REACTION_ADD.js'
|
||||
export * from './MESSAGE_REACTION_REMOVE.js'
|
||||
export * from './MESSAGE_REACTION_REMOVE_ALL.js'
|
||||
export * from './MESSAGE_REACTION_REMOVE_EMOJI.js'
|
||||
export * from './MESSAGE_REACTION_REMOVE.js'
|
||||
export * from './MESSAGE_UPDATE.js'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export * from './GUILD_SOUNDBOARD_SOUNDS_UPDATE.js'
|
||||
export * from './GUILD_SOUNDBOARD_SOUND_CREATE.js'
|
||||
export * from './GUILD_SOUNDBOARD_SOUND_DELETE.js'
|
||||
export * from './GUILD_SOUNDBOARD_SOUND_UPDATE.js'
|
||||
export * from './GUILD_SOUNDBOARD_SOUND_CREATE.js'
|
||||
export * from './GUILD_SOUNDBOARD_SOUNDS_UPDATE.js'
|
||||
export * from './SOUNDBOARD_SOUNDS.js'
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export * from './VOICE_CHANNEL_EFFECT_SEND.js'
|
||||
export * from './VOICE_SERVER_UPDATE.js'
|
||||
export * from './VOICE_STATE_UPDATE.js'
|
||||
export * from './VOICE_CHANNEL_EFFECT_SEND.js'
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// biome-ignore lint/correctness/noUnusedImports: <explanation>
|
||||
import type { RestManager } from '@discordeno/rest'
|
||||
import type {
|
||||
AddDmRecipientOptions,
|
||||
AddGuildMemberOptions,
|
||||
@@ -76,8 +74,8 @@ import type {
|
||||
GetInvite,
|
||||
GetMessagesOptions,
|
||||
GetReactions,
|
||||
GetScheduledEventUsers,
|
||||
GetScheduledEvents,
|
||||
GetScheduledEventUsers,
|
||||
GetThreadMember,
|
||||
GetUserGuilds,
|
||||
GetWebhookMessageOptions,
|
||||
@@ -894,9 +892,11 @@ export type BotHelpers<TProps extends TransformersDesiredProperties, TBehavior e
|
||||
options: Partial<EditAutoModerationRuleOptions>,
|
||||
reason?: string,
|
||||
) => Promise<AutoModerationRule>
|
||||
editBotProfile: (options: { username?: string; botAvatarURL?: string | null; botBannerURL?: string | null }) => Promise<
|
||||
SetupDesiredProps<User, TProps, TBehavior>
|
||||
>
|
||||
editBotProfile: (options: {
|
||||
username?: string
|
||||
botAvatarURL?: string | null
|
||||
botBannerURL?: string | null
|
||||
}) => Promise<SetupDesiredProps<User, TProps, TBehavior>>
|
||||
editChannel: (channelId: BigString, options: ModifyChannel, reason?: string) => Promise<SetupDesiredProps<Channel, TProps, TBehavior>>
|
||||
editEmoji: (guildId: BigString, id: BigString, options: ModifyGuildEmoji, reason?: string) => Promise<SetupDesiredProps<Emoji, TProps, TBehavior>>
|
||||
editApplicationEmoji: (id: BigString, options: ModifyApplicationEmoji) => Promise<SetupDesiredProps<Emoji, TProps, TBehavior>>
|
||||
|
||||
@@ -5,11 +5,11 @@ export * from '@discordeno/utils'
|
||||
export * from './bot.js'
|
||||
export * from './commandOptionsParser.js'
|
||||
export * from './constants.js'
|
||||
export * from './desiredProperties.js'
|
||||
export * from './events.js'
|
||||
export * from './handlers/index.js'
|
||||
export * from './handlers.js'
|
||||
export * from './helpers.js'
|
||||
export * from './transformers/index.js'
|
||||
export * from './transformers.js'
|
||||
export * from './events.js'
|
||||
export * from './desiredProperties.js'
|
||||
export * from './utils.js'
|
||||
|
||||
@@ -81,10 +81,10 @@ import type {
|
||||
} from '@discordeno/types'
|
||||
import type { Bot } from './bot.js'
|
||||
import {
|
||||
createDesiredPropertiesObject,
|
||||
type DesiredPropertiesBehavior,
|
||||
type SetupDesiredProps,
|
||||
type TransformersDesiredProperties,
|
||||
createDesiredPropertiesObject,
|
||||
} from './desiredProperties.js'
|
||||
import { transformIncidentsData } from './transformers/incidentsData.js'
|
||||
import {
|
||||
@@ -153,13 +153,6 @@ import {
|
||||
type Template,
|
||||
type ThreadMember,
|
||||
type ThreadMemberGuildCreate,
|
||||
type UnfurledMediaItem,
|
||||
type User,
|
||||
type UserPrimaryGuild,
|
||||
type VoiceRegion,
|
||||
type VoiceState,
|
||||
type Webhook,
|
||||
type WelcomeScreen,
|
||||
transformActivity,
|
||||
transformActivityInstance,
|
||||
transformActivityLocation,
|
||||
@@ -241,6 +234,13 @@ import {
|
||||
transformWelcomeScreen,
|
||||
transformWidget,
|
||||
transformWidgetSettings,
|
||||
type UnfurledMediaItem,
|
||||
type User,
|
||||
type UserPrimaryGuild,
|
||||
type VoiceRegion,
|
||||
type VoiceState,
|
||||
type Webhook,
|
||||
type WelcomeScreen,
|
||||
} from './transformers/index.js'
|
||||
import {
|
||||
transformAllowedMentionsToDiscordAllowedMentions,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { BigString, DiscordChannel, DiscordForumTag } from '@discordeno/types'
|
||||
import { type Channel, type ForumTag, type InternalBot, calculatePermissions, iconHashToBigInt } from '../index.js'
|
||||
import { Permissions } from './toggles/Permissions.js'
|
||||
import { type Channel, calculatePermissions, type ForumTag, type InternalBot, iconHashToBigInt } from '../index.js'
|
||||
import { ChannelToggles } from './toggles/channel.js'
|
||||
import { Permissions } from './toggles/Permissions.js'
|
||||
|
||||
const Mask = (1n << 64n) - 1n
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DiscordApplication, DiscordInviteCreate, DiscordInviteMetadata } from '@discordeno/types'
|
||||
import { type InternalBot, type Invite, ToggleBitfield, isInviteWithMetadata } from '../index.js'
|
||||
import { type InternalBot, type Invite, isInviteWithMetadata, ToggleBitfield } from '../index.js'
|
||||
|
||||
export function transformInvite(
|
||||
bot: InternalBot,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { BigString, DiscordMember } from '@discordeno/types'
|
||||
import { iconHashToBigInt } from '@discordeno/utils'
|
||||
import type { InternalBot } from '../bot.js'
|
||||
import { Permissions } from './toggles/Permissions.js'
|
||||
import { MemberToggles } from './toggles/member.js'
|
||||
import { Permissions } from './toggles/Permissions.js'
|
||||
import type { Member } from './types.js'
|
||||
|
||||
export const baseMember: InternalBot['transformers']['$inferredTypes']['member'] = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DiscordTeam } from '@discordeno/types'
|
||||
import { type InternalBot, type Team, iconBigintToHash } from '../../index.js'
|
||||
import { type InternalBot, iconBigintToHash, type Team } from '../../index.js'
|
||||
|
||||
export function transformTeamToDiscordTeam(bot: InternalBot, payload: Team): DiscordTeam {
|
||||
const id = payload.id.toString()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { BigString, DiscordRole, DiscordRoleColors } from '@discordeno/types'
|
||||
import { type InternalBot, type Role, type RoleColors, iconHashToBigInt } from '../index.js'
|
||||
import { type InternalBot, iconHashToBigInt, type Role, type RoleColors } from '../index.js'
|
||||
import { Permissions } from './toggles/Permissions.js'
|
||||
import { RoleToggles } from './toggles/role.js'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DiscordScheduledEvent, DiscordScheduledEventRecurrenceRule } from '@discordeno/types'
|
||||
import { type InternalBot, type ScheduledEvent, type ScheduledEventRecurrenceRule, iconHashToBigInt } from '../index.js'
|
||||
import { type InternalBot, iconHashToBigInt, type ScheduledEvent, type ScheduledEventRecurrenceRule } from '../index.js'
|
||||
|
||||
export function transformScheduledEvent(bot: InternalBot, payload: DiscordScheduledEvent): typeof bot.transformers.$inferredTypes.scheduledEvent {
|
||||
const props = bot.transformers.desiredProperties.scheduledEvent
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DiscordTeam } from '@discordeno/types'
|
||||
import { type InternalBot, type Team, iconHashToBigInt } from '../index.js'
|
||||
import { type InternalBot, iconHashToBigInt, type Team } from '../index.js'
|
||||
|
||||
export function transformTeam(bot: InternalBot, payload: DiscordTeam): Team {
|
||||
const id = bot.transformers.snowflake(payload.id)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DiscordWebhook } from '@discordeno/types'
|
||||
import { type InternalBot, type Webhook, iconHashToBigInt } from '../index.js'
|
||||
import { type InternalBot, iconHashToBigInt, type Webhook } from '../index.js'
|
||||
|
||||
export function transformWebhook(bot: InternalBot, payload: DiscordWebhook): typeof bot.transformers.$inferredTypes.webhook {
|
||||
const props = bot.transformers.desiredProperties.webhook
|
||||
|
||||
@@ -4,6 +4,7 @@ import chaiAsPromised from 'chai-as-promised'
|
||||
import { describe, it } from 'mocha'
|
||||
import { createBot } from '../../src/bot.js'
|
||||
import { token } from './constants.js'
|
||||
|
||||
chaiUse(chaiAsPromised)
|
||||
|
||||
describe('[Bot] Can start and stop the bot', () => {
|
||||
|
||||
Reference in New Issue
Block a user