diff --git a/gateway/calculateMaxShards.ts b/gateway/calculateMaxShards.ts index 915112a4a..34b2664ec 100644 --- a/gateway/calculateMaxShards.ts +++ b/gateway/calculateMaxShards.ts @@ -1,7 +1,7 @@ /** Handler used to determine max number of shards to use based upon the max concurrency. */ export function calculateMaxShards(maxShards: number, maxConcurrency: number): number { if (maxShards < 100) return maxShards; - + return Math.ceil( maxShards / (maxConcurrency === 1 ? 16 : maxConcurrency), diff --git a/helpers/webhooks/editWebhook.ts b/helpers/webhooks/editWebhook.ts index 6caeb7bd0..069795d95 100644 --- a/helpers/webhooks/editWebhook.ts +++ b/helpers/webhooks/editWebhook.ts @@ -27,4 +27,4 @@ export interface ModifyWebhook { channelId?: bigint; /** The reason you are modifying this webhook */ reason?: string; -} \ No newline at end of file +} diff --git a/plugins/cache/mod.ts b/plugins/cache/mod.ts index 3615116fc..bea18f488 100644 --- a/plugins/cache/mod.ts +++ b/plugins/cache/mod.ts @@ -1,4 +1,4 @@ -import { Bot, Collection, DiscordGuildEmojisUpdate, } from "./deps.ts"; +import { Bot, Collection, DiscordGuildEmojisUpdate } from "./deps.ts"; import { setupCacheRemovals } from "./src/setupCacheRemovals.ts"; import { addCacheCollections, BotWithCache } from "./src/addCacheCollections.ts"; import { setupCacheEdits } from "./src/setupCacheEdits.ts"; diff --git a/plugins/cache/src/addCacheCollections.ts b/plugins/cache/src/addCacheCollections.ts index 8166f9731..b6b4801ee 100644 --- a/plugins/cache/src/addCacheCollections.ts +++ b/plugins/cache/src/addCacheCollections.ts @@ -1,13 +1,4 @@ -import { - Bot, - Collection, - Channel, - Guild, - Member, - Message, - PresenceUpdate, - User, -} from "../deps.ts"; +import { Bot, Channel, Collection, Guild, Member, Message, PresenceUpdate, User } from "../deps.ts"; export type BotWithCache = B & CacheProps; diff --git a/plugins/cache/src/setupCacheEdits.ts b/plugins/cache/src/setupCacheEdits.ts index f7c4b17fb..9f56dede0 100644 --- a/plugins/cache/src/setupCacheEdits.ts +++ b/plugins/cache/src/setupCacheEdits.ts @@ -1,4 +1,11 @@ -import type { Bot, DiscordGuildMemberAdd, DiscordGuildMemberRemove, DiscordMessageReactionAdd, DiscordMessageReactionRemove, DiscordMessageReactionRemoveAll } from "../deps.ts"; +import type { + Bot, + DiscordGuildMemberAdd, + DiscordGuildMemberRemove, + DiscordMessageReactionAdd, + DiscordMessageReactionRemove, + DiscordMessageReactionRemoveAll, +} from "../deps.ts"; import type { BotWithCache } from "./addCacheCollections.ts"; export function setupCacheEdits(bot: BotWithCache) { diff --git a/plugins/helpers/mod.ts b/plugins/helpers/mod.ts index 9d4af522b..f26209a97 100644 --- a/plugins/helpers/mod.ts +++ b/plugins/helpers/mod.ts @@ -1,13 +1,13 @@ import { ApplicationCommandOptionChoice, Bot, + Channel, Collection, CreateMessage, - Channel, - Member, - Message, FinalHelpers, ListGuildMembers, + Member, + Message, } from "./deps.ts"; import { cloneChannel } from "./src/channels.ts"; import { sendAutocompleteChoices } from "./src/sendAutoCompleteChoices.ts"; diff --git a/plugins/helpers/src/sendPrivateInteractionResponse.ts b/plugins/helpers/src/sendPrivateInteractionResponse.ts index 514f99b9e..21aa52b5e 100644 --- a/plugins/helpers/src/sendPrivateInteractionResponse.ts +++ b/plugins/helpers/src/sendPrivateInteractionResponse.ts @@ -1,7 +1,12 @@ import type { Bot, DiscordenoInteractionResponse, DiscordenoMessage } from "../deps.ts"; /** sendInteractionResponse with ephemeral reply */ -export function sendPrivateInteractionResponse(bot: Bot, id: bigint, token: string, options: DiscordenoInteractionResponse): Promise { +export function sendPrivateInteractionResponse( + bot: Bot, + id: bigint, + token: string, + options: DiscordenoInteractionResponse, +): Promise { if (options.data && !options.data?.flags) options.data.flags = 64; // private: true return bot.helpers.sendInteractionResponse(id, token, options); -} \ No newline at end of file +} diff --git a/plugins/helpers/src/threads.ts b/plugins/helpers/src/threads.ts index c98782b5a..602caa250 100644 --- a/plugins/helpers/src/threads.ts +++ b/plugins/helpers/src/threads.ts @@ -22,14 +22,19 @@ export async function unlockThread(bot: Bot, threadId: bigint) { /** Update a thread's settings. Requires the `MANAGE_CHANNELS` permission for the guild. */ export async function editThread(bot: Bot, threadId: bigint, options: ModifyThread, reason?: string) { - const result = await bot.rest.runMethod(bot.rest, "patch", bot.constants.endpoints.CHANNEL_BASE(threadId), { - name: options.name, - archived: options.archived, - auto_archive_duration: options.autoArchiveDuration, - locked: options.locked, - rate_limit_per_user: options.rateLimitPerUser, - reason, - }); + const result = await bot.rest.runMethod( + bot.rest, + "patch", + bot.constants.endpoints.CHANNEL_BASE(threadId), + { + name: options.name, + archived: options.archived, + auto_archive_duration: options.autoArchiveDuration, + locked: options.locked, + rate_limit_per_user: options.rateLimitPerUser, + reason, + }, + ); return bot.transformers.channel(bot, { channel: result, diff --git a/plugins/permissions/src/components.ts b/plugins/permissions/src/components.ts index 465917b04..69b683a2b 100644 --- a/plugins/permissions/src/components.ts +++ b/plugins/permissions/src/components.ts @@ -155,11 +155,13 @@ function makeEmojiFromString( ) { if (!emoji) return; - if (typeof emoji !== "string") return { - id: emoji.id ? BigInt(emoji.id) : undefined, - name: emoji.name, - animated: emoji.animated, - }; + if (typeof emoji !== "string") { + return { + id: emoji.id ? BigInt(emoji.id) : undefined, + name: emoji.name, + animated: emoji.animated, + }; + } // A snowflake id was provided if (/^[0-9]+$/.test(emoji)) { diff --git a/site/docs/nodejs/Structures/create-structure.md b/site/docs/nodejs/Structures/create-structure.md index 2d1ed7d3a..533127c96 100644 --- a/site/docs/nodejs/Structures/create-structure.md +++ b/site/docs/nodejs/Structures/create-structure.md @@ -25,15 +25,15 @@ However, you probably want to use something shorter, such as the following: ```js class Channel { - constructor(client, data) { - this.client = client; - this.id = data.id; - this.name = data.name; - } + constructor(client, data) { + this.client = client; + this.id = data.id; + this.name = data.name; + } - async send(options) { - return await client.helpers.sendMessage(this.id, options); - } + async send(options) { + return await client.helpers.sendMessage(this.id, options); + } } ```