diff --git a/helpers/interactions/commands/upsertGlobalApplicationCommands.ts b/helpers/interactions/commands/upsertGlobalApplicationCommands.ts index bde1c4b8e..4bda82283 100644 --- a/helpers/interactions/commands/upsertGlobalApplicationCommands.ts +++ b/helpers/interactions/commands/upsertGlobalApplicationCommands.ts @@ -23,7 +23,7 @@ export async function upsertGlobalApplicationCommands( ): Promise> { const results = await bot.rest.runMethod( bot.rest, - "PATCH", + "PUT", bot.constants.routes.COMMANDS(bot.applicationId), commands.map((command) => bot.transformers.reverse.createApplicationCommand(bot, command)), ); diff --git a/helpers/interactions/commands/upsertGuildApplicationCommands.ts b/helpers/interactions/commands/upsertGuildApplicationCommands.ts index 08a93f6fc..4c2f46b6c 100644 --- a/helpers/interactions/commands/upsertGuildApplicationCommands.ts +++ b/helpers/interactions/commands/upsertGuildApplicationCommands.ts @@ -25,7 +25,7 @@ export async function upsertGuildApplicationCommands( ): Promise> { const results = await bot.rest.runMethod( bot.rest, - "PATCH", + "PUT", bot.constants.routes.COMMANDS_GUILD(bot.applicationId, guildId), commands.map((command) => bot.transformers.reverse.createApplicationCommand(bot, command)), ); diff --git a/packages/embeds/mod.ts b/packages/embeds/mod.ts index a915a3e2a..157bdf1f3 100644 --- a/packages/embeds/mod.ts +++ b/packages/embeds/mod.ts @@ -89,10 +89,10 @@ export class Embeds extends Array { setColor(color: string) { this.getLastEmbed().color = color.toLowerCase() === `random` - ? // Random color - Math.floor(Math.random() * (0xffffff + 1)) - : // Convert the hex to a acceptable color for discord - parseInt(color.replace("#", ""), 16); + // Random color + ? Math.floor(Math.random() * (0xffffff + 1)) + // Convert the hex to a acceptable color for discord + : parseInt(color.replace("#", ""), 16); return this; } diff --git a/plugins/cache/src/dispatchRequirements.ts b/plugins/cache/src/dispatchRequirements.ts index 95a0bb04c..fdcc28857 100644 --- a/plugins/cache/src/dispatchRequirements.ts +++ b/plugins/cache/src/dispatchRequirements.ts @@ -13,10 +13,10 @@ export async function dispatchRequirements( const id = bot.utils.snowflakeToBigint( (data.t && ["GUILD_UPDATE"].includes(data.t) - ? // deno-lint-ignore no-explicit-any - (data.d as any)?.id - : // deno-lint-ignore no-explicit-any - (data.d as any)?.guild_id) ?? "", + // deno-lint-ignore no-explicit-any + ? (data.d as any)?.id + // deno-lint-ignore no-explicit-any + : (data.d as any)?.guild_id) ?? "", ); if (!id || bot.activeGuildIds.has(id)) return; diff --git a/template/bigbot/src/bot/events/raw.ts b/template/bigbot/src/bot/events/raw.ts index 9e5632aa3..c1c08971f 100644 --- a/template/bigbot/src/bot/events/raw.ts +++ b/template/bigbot/src/bot/events/raw.ts @@ -16,10 +16,10 @@ export function setRawEvent() { const id = bot.transformers.snowflake( (data.t && ["GUILD_UPDATE", "GUILD_CREATE"].includes(data.t) - ? // deno-lint-ignore no-explicit-any - (data.d as any)?.id - : // deno-lint-ignore no-explicit-any - (data.d as any)?.guild_id) ?? "", + // deno-lint-ignore no-explicit-any + ? (data.d as any)?.id + // deno-lint-ignore no-explicit-any + : (data.d as any)?.guild_id) ?? "", ); // The GUILD_CREATE event came from a shard loaded event so ignore it diff --git a/template/bigbot/src/bot/utils/slash/createCommand.ts b/template/bigbot/src/bot/utils/slash/createCommand.ts index 6f4dfc6c7..5f5a12cd0 100644 --- a/template/bigbot/src/bot/utils/slash/createCommand.ts +++ b/template/bigbot/src/bot/utils/slash/createCommand.ts @@ -168,8 +168,8 @@ export type ConvertArgumentDefinitionsToArgs ? { + // INTEGER + : T[P] extends IntegerOptionalArgumentDefinition ? { [_ in getName]?: T[P]["choices"] extends readonly { name: string; value: number }[] // @ts-ignore ? T[P]["choices"][number]["value"] : number; @@ -179,11 +179,11 @@ export type ConvertArgumentDefinitionsToArgs ? { [_ in getName]?: boolean } + // BOOLEAN + : T[P] extends BooleanOptionalArgumentDefinition ? { [_ in getName]?: boolean } : T[P] extends BooleanArgumentDefinition ? { [_ in getName]: boolean } - : // USER - T[P] extends UserOptionalArgumentDefinition ? { + // USER + : T[P] extends UserOptionalArgumentDefinition ? { [_ in getName]?: { user: User; member: Member; @@ -195,14 +195,14 @@ export type ConvertArgumentDefinitionsToArgs ? { [_ in getName]?: Channel } + // CHANNEL + : T[P] extends ChannelOptionalArgumentDefinition ? { [_ in getName]?: Channel } : T[P] extends ChannelArgumentDefinition ? { [_ in getName]: Channel } - : // ROLE - T[P] extends RoleOptionalArgumentDefinition ? { [_ in getName]?: Role } + // ROLE + : T[P] extends RoleOptionalArgumentDefinition ? { [_ in getName]?: Role } : T[P] extends RoleArgumentDefinition ? { [_ in getName]: Role } - : // MENTIONABLE - T[P] extends MentionableOptionalArgumentDefinition ? { + // MENTIONABLE + : T[P] extends MentionableOptionalArgumentDefinition ? { [_ in getName]?: | Role | { @@ -218,14 +218,14 @@ export type ConvertArgumentDefinitionsToArgs ? { + // SUBCOMMAND + : T[P] extends SubcommandArgumentDefinition ? { [_ in getName]?: T[P]["options"] extends readonly ArgumentDefinition[] // @ts-ignore somehow this check does not work ? ConvertArgumentDefinitionsToArgs : {}; } - : // SUBCOMMANDGROUP - T[P] extends SubcommandGroupArgumentDefinition ? { + // SUBCOMMANDGROUP + : T[P] extends SubcommandGroupArgumentDefinition ? { [_ in getName]?: ConvertArgumentDefinitionsToArgs; } : never; diff --git a/template/bigbot/src/bot/utils/slash/updateCommands.ts b/template/bigbot/src/bot/utils/slash/updateCommands.ts index aa94f844b..c3422bb7d 100644 --- a/template/bigbot/src/bot/utils/slash/updateCommands.ts +++ b/template/bigbot/src/bot/utils/slash/updateCommands.ts @@ -136,8 +136,8 @@ function createOptions( choices, // @ts-ignore fix this options: option.options - ? // @ts-ignore fix this - createOptions(bot, guildId, option.options) + // @ts-ignore fix this + ? createOptions(bot, guildId, option.options) : undefined, } as ApplicationCommandOption); } diff --git a/transformers/invite.ts b/transformers/invite.ts index 19364bd64..8b1eb8e7d 100644 --- a/transformers/invite.ts +++ b/transformers/invite.ts @@ -24,8 +24,8 @@ export function transformInvite(bot: Bot, invite: DiscordInviteCreate) { targetUser: invite.target_user ? bot.transformers.user(bot, invite.target_user) : undefined, /** The embedded application to open for this voice channel embedded application invite */ targetApplication: invite.target_application - ? // @ts-ignore should not break anything even though its partial. if it does blame wolf :) - bot.transformers.application(bot, invite.target_application) + // @ts-ignore should not break anything even though its partial. if it does blame wolf :) + ? bot.transformers.application(bot, invite.target_application) : undefined, /** Whether or not the invite is temporary (invited users will be kicked on disconnect unless they're assigned a role) */ temporary: invite.temporary,