diff --git a/helpers/emojis/mod.ts b/helpers/emojis/mod.ts index 215808ad7..a7c824f51 100644 --- a/helpers/emojis/mod.ts +++ b/helpers/emojis/mod.ts @@ -4,4 +4,3 @@ export * from "./editEmoji.ts"; export * from "./getEmoji.ts"; export * from "./getEmojis.ts"; export * from "./getEmojiUrl.ts"; - diff --git a/helpers/guilds/mod.ts b/helpers/guilds/mod.ts index 9095379c4..f70ea8c7b 100644 --- a/helpers/guilds/mod.ts +++ b/helpers/guilds/mod.ts @@ -23,4 +23,3 @@ export * from "./getWidget.ts"; export * from "./getWidgetImageUrl.ts"; export * from "./getWidgetSettings.ts"; export * from "./leaveGuild.ts"; - diff --git a/helpers/interactions/commands/getApplicationCommand.ts b/helpers/interactions/commands/getApplicationCommand.ts index 8a28d0017..809a368cc 100644 --- a/helpers/interactions/commands/getApplicationCommand.ts +++ b/helpers/interactions/commands/getApplicationCommand.ts @@ -3,7 +3,11 @@ import { ApplicationCommand } from "../../../transformers/applicationCommand.ts" import { DiscordApplicationCommand } from "../../../types/discord.ts"; /** Fetches the global command for the given Id. If a guildId is provided, the guild command will be fetched. */ -export async function getApplicationCommand(bot: Bot, commandId: bigint, options?: GetApplicationCommand): Promise { +export async function getApplicationCommand( + bot: Bot, + commandId: bigint, + options?: GetApplicationCommand, +): Promise { const result = await bot.rest.runMethod( bot.rest, "GET", diff --git a/helpers/interactions/commands/upsertApplicationCommand.ts b/helpers/interactions/commands/upsertApplicationCommand.ts index 5256ddc8f..bd99ee30b 100644 --- a/helpers/interactions/commands/upsertApplicationCommand.ts +++ b/helpers/interactions/commands/upsertApplicationCommand.ts @@ -6,7 +6,7 @@ import { CreateApplicationCommand, CreateContextApplicationCommand, isContextApplicationCommand, - makeOptionsForCommand + makeOptionsForCommand, } from "./createApplicationCommand.ts"; /** diff --git a/helpers/members/mod.ts b/helpers/members/mod.ts index f18d3c543..65a43adcc 100644 --- a/helpers/members/mod.ts +++ b/helpers/members/mod.ts @@ -10,4 +10,3 @@ export * from "./kickMember.ts"; export * from "./pruneMembers.ts"; export * from "./searchMembers.ts"; export * from "./unbanMember.ts"; - diff --git a/helpers/messages/editMessage.ts b/helpers/messages/editMessage.ts index 770fab430..dd49d3ffa 100644 --- a/helpers/messages/editMessage.ts +++ b/helpers/messages/editMessage.ts @@ -7,7 +7,12 @@ import { AllowedMentions, FileContent, MessageComponents } from "../../types/dis import { MessageComponentTypes } from "../../types/shared.ts"; /** Edit the message. */ -export async function editMessage(bot: Bot, channelId: bigint, messageId: bigint, content: EditMessage): Promise { +export async function editMessage( + bot: Bot, + channelId: bigint, + messageId: bigint, + content: EditMessage, +): Promise { const result = await bot.rest.runMethod( bot.rest, "PATCH", diff --git a/helpers/messages/mod.ts b/helpers/messages/mod.ts index dc2d87cda..7ea88126a 100644 --- a/helpers/messages/mod.ts +++ b/helpers/messages/mod.ts @@ -13,4 +13,3 @@ export * from "./pinMessage.ts"; export * from "./publishMessage.ts"; export * from "./sendMessage.ts"; export * from "./unpinMessage.ts"; - diff --git a/helpers/misc/editBotProfile.ts b/helpers/misc/editBotProfile.ts index d9c783eb7..373f0d785 100644 --- a/helpers/misc/editBotProfile.ts +++ b/helpers/misc/editBotProfile.ts @@ -6,7 +6,10 @@ import { DiscordUser } from "../../types/discord.ts"; * Modifies the bot's username or avatar. * NOTE: username: if changed may cause the bot's discriminator to be randomized. */ -export async function editBotProfile(bot: Bot, options: { username?: string; botAvatarURL?: string | null }): Promise { +export async function editBotProfile( + bot: Bot, + options: { username?: string; botAvatarURL?: string | null }, +): Promise { const avatar = options?.botAvatarURL ? await bot.utils.urlToBase64(options?.botAvatarURL) : options?.botAvatarURL; const result = await bot.rest.runMethod(bot.rest, "PATCH", bot.constants.routes.USER_BOT(), { diff --git a/helpers/misc/mod.ts b/helpers/misc/mod.ts index 233bcf93f..9eb9010b6 100644 --- a/helpers/misc/mod.ts +++ b/helpers/misc/mod.ts @@ -4,4 +4,3 @@ export * from "./editShardStatus.ts"; export * from "./getGatewayBot.ts"; export * from "./getNitroStickerPacks.ts"; export * from "./getUser.ts"; - diff --git a/template/bigbot/src/bot/commands/mod.ts b/template/bigbot/src/bot/commands/mod.ts index 6277c44c9..856cdbcbd 100644 --- a/template/bigbot/src/bot/commands/mod.ts +++ b/template/bigbot/src/bot/commands/mod.ts @@ -1,7 +1,7 @@ import ping from "./ping"; export const COMMANDS = { - ping, -} + ping, +}; -export default COMMANDS; \ No newline at end of file +export default COMMANDS; diff --git a/template/bigbot/src/bot/events/messages/create.ts b/template/bigbot/src/bot/events/messages/create.ts index c4b48cae6..c95815018 100644 --- a/template/bigbot/src/bot/events/messages/create.ts +++ b/template/bigbot/src/bot/events/messages/create.ts @@ -4,9 +4,9 @@ import { processMessageCollectors } from "../../utils/collectors"; export function setMessageCreateEvent() { bot.events.messageCreate = async function (_, message) { processMessageCollectors(message); - + await Promise.allSettled([ - // SETUP-DD-TEMP: Add any functions you want to run on every message here. For example, automoderation filters. - ]).catch(console.log) + // SETUP-DD-TEMP: Add any functions you want to run on every message here. For example, automoderation filters. + ]).catch(console.log); }; } diff --git a/template/bigbot/src/bot/events/mod.ts b/template/bigbot/src/bot/events/mod.ts index a7fa8e042..5c0062394 100644 --- a/template/bigbot/src/bot/events/mod.ts +++ b/template/bigbot/src/bot/events/mod.ts @@ -1,9 +1,9 @@ -import { setInteractionCreateEvent } from "./interactions/mod" -import { setMessageCreateEvent } from "./messages/create" -import { setRawEvent } from "./raw" +import { setInteractionCreateEvent } from "./interactions/mod"; +import { setMessageCreateEvent } from "./messages/create"; +import { setRawEvent } from "./raw"; export function setupEventHandlers() { - setInteractionCreateEvent() - setRawEvent() - setMessageCreateEvent() - } \ No newline at end of file + setInteractionCreateEvent(); + setRawEvent(); + setMessageCreateEvent(); +} diff --git a/template/bigbot/src/bot/languages/english.ts b/template/bigbot/src/bot/languages/english.ts index 56ee40b8f..a4ef41a8d 100644 --- a/template/bigbot/src/bot/languages/english.ts +++ b/template/bigbot/src/bot/languages/english.ts @@ -1,28 +1,27 @@ const english = { - // Permissions - BUTTON_NOT_ALLOWED: '❌ You are not allowed to use this button.', - NEED_VIP: "❌ Only VIP users or servers can use this feature.", - - // Execute Command - EXECUTE_COMMAND_NOT_FOUND: '❌ Something went wrong. I was not able to find this command.', - EXECUTE_COMMAND_ERROR: '❌ Something went wrong. The command execution has thrown an error.', + // Permissions + BUTTON_NOT_ALLOWED: "❌ You are not allowed to use this button.", + NEED_VIP: "❌ Only VIP users or servers can use this feature.", - - // Language Command - LANGUAGE_NAME: 'language', - LANGUAGE_DESCRIPTION: '⚙️ Change the bots language.', - LANGUAGE_KEY_NAME: 'name', - LANGUAGE_KEY_DESCRIPTION: 'What language would you like to set?', - LANGUAGE_MISSING_KEY: '❌ No language was provided.', - LANGUAGE_INVALID_KEY: (languages: string[]) => - `❌ I could not find a language with that name. Valid languages are: ${languages.join(' ')}`, - LANGUAGE_UPDATED: (language: string) => `The language has been updated to ${language}`, - - // Ping Command - PING_NAME: 'ping', - PING_DESCRIPTION: '🏓 Check whether the bot is online and responsive.', - PING_RESPONSE: '🏓 Pong! I am online and responsive! :clock10:', - PING_RESPONSE_WITH_TIME: (time: number) => `🏓 Pong! ${time / 1000} seconds! I am online and responsive! :clock10:`, - } as const - - export default english \ No newline at end of file + // Execute Command + EXECUTE_COMMAND_NOT_FOUND: "❌ Something went wrong. I was not able to find this command.", + EXECUTE_COMMAND_ERROR: "❌ Something went wrong. The command execution has thrown an error.", + + // Language Command + LANGUAGE_NAME: "language", + LANGUAGE_DESCRIPTION: "⚙️ Change the bots language.", + LANGUAGE_KEY_NAME: "name", + LANGUAGE_KEY_DESCRIPTION: "What language would you like to set?", + LANGUAGE_MISSING_KEY: "❌ No language was provided.", + LANGUAGE_INVALID_KEY: (languages: string[]) => + `❌ I could not find a language with that name. Valid languages are: ${languages.join(" ")}`, + LANGUAGE_UPDATED: (language: string) => `The language has been updated to ${language}`, + + // Ping Command + PING_NAME: "ping", + PING_DESCRIPTION: "🏓 Check whether the bot is online and responsive.", + PING_RESPONSE: "🏓 Pong! I am online and responsive! :clock10:", + PING_RESPONSE_WITH_TIME: (time: number) => `🏓 Pong! ${time / 1000} seconds! I am online and responsive! :clock10:`, +} as const; + +export default english; diff --git a/template/bigbot/src/bot/languages/languages.ts b/template/bigbot/src/bot/languages/languages.ts index b42b07265..ede55921c 100644 --- a/template/bigbot/src/bot/languages/languages.ts +++ b/template/bigbot/src/bot/languages/languages.ts @@ -17,4 +17,4 @@ const languages: Record & Record = { export default languages; export type Language = Record string)>; -export type LanguageNames = "english"; \ No newline at end of file +export type LanguageNames = "english"; diff --git a/template/bigbot/src/bot/typings/discordeno.ts b/template/bigbot/src/bot/typings/discordeno.ts index 0e71bf7ed..532ca295c 100644 --- a/template/bigbot/src/bot/typings/discordeno.ts +++ b/template/bigbot/src/bot/typings/discordeno.ts @@ -2,7 +2,7 @@ import { InteractionResponse, Message } from "discordeno"; declare module "discordeno" { - // We want to add something to the Interaction object. + // We want to add something to the Interaction object. interface Interaction { // Normally, to send a response you would have to do something like bot.helpers.sendInteractionResponse(interaction.id, interaction.token, { type: InteractionResponseTypes.ChannelMessageWithSource, data: { content: "text here" } }) // But with this reply method we added, it is as simple as interaction.reply("text here"). diff --git a/template/bigbot/src/bot/utils/collectors.ts b/template/bigbot/src/bot/utils/collectors.ts index 8465696b5..e905075e8 100644 --- a/template/bigbot/src/bot/utils/collectors.ts +++ b/template/bigbot/src/bot/utils/collectors.ts @@ -27,7 +27,9 @@ export async function needMessage(memberId: bigint, channelId: bigint, options?: export function collectMessages(options: CollectMessagesOptions): Promise { return new Promise((resolve, reject) => { - bot.collectors.messages.get(options.key)?.reject("A new collector began before the user responded to the previous one."); + bot.collectors.messages.get(options.key)?.reject( + "A new collector began before the user responded to the previous one.", + ); bot.collectors.messages.set(options.key, { ...options, diff --git a/template/bigbot/src/bot/utils/internals/transformers/guild.ts b/template/bigbot/src/bot/utils/internals/transformers/guild.ts index af869cf5d..61c954ba6 100644 --- a/template/bigbot/src/bot/utils/internals/transformers/guild.ts +++ b/template/bigbot/src/bot/utils/internals/transformers/guild.ts @@ -1,4 +1,4 @@ -// SETUP-DD-TEMP: This file is an example, of how to customize an object properties that you do not want. +// SETUP-DD-TEMP: This file is an example, of how to customize an object properties that you do not want. // Only keep the properties your bot uses. If your bot does not use emojis in cache, you can save all that memory. // This file is currently disabled, but you can enable it should you choose when you go the customizer file. // Feel free to delete this comment or file as you wish. diff --git a/template/bigbot/src/bot/utils/internals/transformers/interaction.ts b/template/bigbot/src/bot/utils/internals/transformers/interaction.ts index 05f149022..20701c9b0 100644 --- a/template/bigbot/src/bot/utils/internals/transformers/interaction.ts +++ b/template/bigbot/src/bot/utils/internals/transformers/interaction.ts @@ -26,4 +26,4 @@ export function customizeInteractionTransformer(bot: BotWithCustomProps) { // Return the new customized object. return interaction; }; -} \ No newline at end of file +} diff --git a/template/bigbot/src/bot/utils/slash/updateDevCommands.ts b/template/bigbot/src/bot/utils/slash/updateDevCommands.ts index 3f2a1b660..241365093 100644 --- a/template/bigbot/src/bot/utils/slash/updateDevCommands.ts +++ b/template/bigbot/src/bot/utils/slash/updateDevCommands.ts @@ -29,7 +29,9 @@ export async function updateDevCommands(bot: Bot) { return { name: (translatedName || name).toLowerCase(), description: translatedDescription || command!.description, - options: command.options ? createOptions(bot.transformers.snowflake(DEV_SERVER_ID), command.options, command.name) : undefined, + options: command.options + ? createOptions(bot.transformers.snowflake(DEV_SERVER_ID), command.options, command.name) + : undefined, }; }), bot.transformers.snowflake(DEV_SERVER_ID), @@ -39,7 +41,6 @@ export async function updateDevCommands(bot: Bot) { // SETUP-DD-TEMP: You can make this able to be updated dynicamally by moving this value to something in the database and having a command to update it on the fly or as part of CI. export const CURRENT_SLASH_COMMAND_VERSION = 1; - /** Whether the guild has the latest slash command version */ export async function usesLatestCommandVersion(guildId: bigint): Promise { return (await getCurrentCommandVersion(guildId)) === CURRENT_SLASH_COMMAND_VERSION; diff --git a/template/bigbot/src/configs.ts b/template/bigbot/src/configs.ts index 62d7d882f..00a1c37ad 100644 --- a/template/bigbot/src/configs.ts +++ b/template/bigbot/src/configs.ts @@ -1,4 +1,4 @@ -import { Intents, getBotIdFromToken } from "discordeno"; +import { getBotIdFromToken, Intents } from "discordeno"; // General Configurations /** Whether or not this process is a local development version. Change to false for the main production bot. */ diff --git a/template/bigbot/src/prisma.ts b/template/bigbot/src/prisma.ts index a14cbb915..901f3a0d9 100644 --- a/template/bigbot/src/prisma.ts +++ b/template/bigbot/src/prisma.ts @@ -1,3 +1,3 @@ -import { PrismaClient } from '@prisma/client' +import { PrismaClient } from "@prisma/client"; -export const prisma = new PrismaClient() \ No newline at end of file +export const prisma = new PrismaClient();