diff --git a/mod.ts b/mod.ts index 6e28e9fd9..be579876f 100644 --- a/mod.ts +++ b/mod.ts @@ -17,7 +17,6 @@ Client({ if (!message.guild_id) return; const guild = cache.guilds.get(message.guild_id); if (!guild) return logYellow("no guild"); - } } }, diff --git a/module/requestManager.ts b/module/requestManager.ts index e4b46d91f..48ac5026d 100644 --- a/module/requestManager.ts +++ b/module/requestManager.ts @@ -60,7 +60,7 @@ export const RequestManager = { }, }; -function createRequestBody (body: any, method?: RequestMethod) { +function createRequestBody(body: any, method?: RequestMethod) { return { headers: { Authorization: authorization, @@ -72,7 +72,7 @@ function createRequestBody (body: any, method?: RequestMethod) { body: JSON.stringify(body), method: method?.toUpperCase(), }; -}; +} async function checkRatelimits(url: string) { const ratelimited = ratelimitedPaths.get(url); @@ -109,7 +109,7 @@ async function runMethod( ) { if (retryCount > 10) throw new Error(Errors.RATE_LIMIT_RETRY_MAXED); await delay(json.retry_after); - return runMethod(method, url, body, retryCount++) + return runMethod(method, url, body, retryCount++); } return resolve(json); @@ -124,7 +124,7 @@ async function runMethod( processQueue(); } }); -}; +} function processHeaders(url: string, headers: Headers) { // If a rate limit response is encountered this will become true and returned @@ -160,4 +160,4 @@ function processHeaders(url: string, headers: Headers) { // Returns a boolean to check if we need to request again once the rate limit resets return ratelimited; -}; +} diff --git a/structures/guild.ts b/structures/guild.ts index e0da2444f..f45e67218 100644 --- a/structures/guild.ts +++ b/structures/guild.ts @@ -252,11 +252,13 @@ export const createGuild = (data: CreateGuildPayload) => { return RequestManager.post(endpoints.GUILD_PRUNE(data.id), { days }); }, fetchMembers: (options?: FetchMembersOptions) => { - if (!(identifyPayload.intents & Intents.GUILD_MEMBERS)) throw new Error(Errors.MISSING_INTENT_GUILD_MEMBERS) + if (!(identifyPayload.intents & Intents.GUILD_MEMBERS)) { + throw new Error(Errors.MISSING_INTENT_GUILD_MEMBERS); + } return new Promise((resolve) => { - requestAllMembers(data.id, resolve, guild.memberCount, options) - }) + requestAllMembers(data.id, resolve, guild.memberCount, options); + }); }, /** Returns the audit logs for the guild. Requires VIEW AUDIT LOGS permission */ getAuditLogs: (options: GetAuditLogsOptions) => { diff --git a/structures/message.ts b/structures/message.ts index e19518a1b..1198ed0c0 100644 --- a/structures/message.ts +++ b/structures/message.ts @@ -14,7 +14,7 @@ export function createMessage(data: MessageCreateOptions) { return { ...data, raw: data, - mentions: data.mentions.map(user => createUser(user)), + mentions: data.mentions.map((user) => createUser(user)), author: createUser({ ...data.author, avatar: data.author.avatar || "" }), timestamp: Date.parse(data.timestamp), editedTimestamp: data.edited_timestamp diff --git a/types/errors.ts b/types/errors.ts index 2aec5a375..384393480 100644 --- a/types/errors.ts +++ b/types/errors.ts @@ -22,5 +22,5 @@ export enum Errors { NICKNAMES_MAX_LENGTH = "NICKNAMES_MAX_LENGTH", PRUNE_MIN_DAYS = "PRUNE_MIN_DAYS", RATE_LIMIT_RETRY_MAXED = "RATE_LIMIT_RETRY_MAXED", - MISSING_INTENT_GUILD_MEMBERS = "MISSING_INTENT_GUILD_MEMBERS" + MISSING_INTENT_GUILD_MEMBERS = "MISSING_INTENT_GUILD_MEMBERS", } diff --git a/utils/cdn.ts b/utils/cdn.ts index 927093f6a..de1eb6565 100644 --- a/utils/cdn.ts +++ b/utils/cdn.ts @@ -5,7 +5,5 @@ export const formatImageURL = ( size: ImageSize = 128, format?: ImageFormats, ) => { - return `${url}.${ - format || url.includes("/a_") ? "gif" : "jpg" - }?size=${size}`; + return `${url}.${format || url.includes("/a_") ? "gif" : "jpg"}?size=${size}`; };