[READ-ONLY] Mirror of https://github.com/maybeanerd/MagiBot. MagiBot - the community building discord bot that adds joinsounds to your voice channels! discord.gg/2Evcf4T
bot bots community discord gaming hacktoberfest sound
1

Configure Feed

Select the types of activity you want to include in your feed.

fix: use new types to get command interaction options

also remove prettier and ensure eslint is used as formatter in VSCode

authored by

Sebastian Di Luzio and committed by
Sebastian Di Luzio
(Oct 5, 2025, 12:37 PM +0200) 45027e46 03923fea

+73 -130
+10 -27
.vscode/settings.json
··· 3 3 "files.eol": "\n", 4 4 "javascript.preferences.quoteStyle": "single", 5 5 "typescript.preferences.quoteStyle": "single", 6 - "eslint.validate": [ 7 - { 8 - "language": "typescript", 9 - "autoFix": true 10 - }, 11 - { 12 - "language": "javascript", 13 - "autoFix": true 14 - } 15 - ], 16 - "eslint.autoFixOnSave": true, 17 - "vetur.validation.template": false, 18 - "vetur.format.defaultFormatterOptions": { 19 - "prettier": { 20 - "semi": true, 21 - "singleQuote": true 22 - } 6 + "eslint.validate": ["typescript", "javascript"], 7 + "typescript.tsdk": "node_modules/typescript/lib", 8 + "editor.codeActionsOnSave": { 9 + "source.fixAll.eslint": "explicit" 23 10 }, 24 - "prettier.singleQuote": true, 25 - "prettier.endOfLine": "lf", 26 - "typescript.tsdk": "node_modules/typescript/lib", 27 - "editor.codeActionsOnSave": { 28 - "source.fixAll.eslint": "explicit" 29 - }, 30 - "editor.defaultFormatter": "esbenp.prettier-vscode", 31 - "editor.detectIndentation": false, 32 - "editor.insertSpaces": false, 33 - "editor.tabSize": 2 11 + "editor.detectIndentation": false, 12 + "editor.insertSpaces": false, 13 + "editor.tabSize": 2, 14 + "eslint.format.enable": true, 15 + "editor.defaultFormatter": "dbaeumer.vscode-eslint", 16 + "editor.formatOnSave": false 34 17 }
-2
README.md
··· 16 16 Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): 17 17 18 18 <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> 19 - <!-- prettier-ignore-start --> 20 19 <!-- markdownlint-disable --> 21 20 <table> 22 21 <tr> ··· 27 26 </table> 28 27 29 28 <!-- markdownlint-restore --> 30 - <!-- prettier-ignore-end --> 31 29 32 30 <!-- ALL-CONTRIBUTORS-LIST:END --> 33 31
-22
package-lock.json
··· 37 37 "@typescript-eslint/parser": "7.18.0", 38 38 "eslint": "8.57.1", 39 39 "eslint-config-airbnb-base": "15.0.0", 40 - "prettier": "3.6.2", 41 40 "rimraf": "6.0.1", 42 41 "typescript": "5.9.3" 43 42 }, ··· 6527 6526 "dev": true, 6528 6527 "engines": { 6529 6528 "node": ">= 0.8.0" 6530 - } 6531 - }, 6532 - "node_modules/prettier": { 6533 - "version": "3.6.2", 6534 - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", 6535 - "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", 6536 - "dev": true, 6537 - "bin": { 6538 - "prettier": "bin/prettier.cjs" 6539 - }, 6540 - "engines": { 6541 - "node": ">=14" 6542 - }, 6543 - "funding": { 6544 - "url": "https://github.com/prettier/prettier?sponsor=1" 6545 6529 } 6546 6530 }, 6547 6531 "node_modules/prettyjson": { ··· 13403 13387 "version": "1.2.1", 13404 13388 "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", 13405 13389 "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", 13406 - "dev": true 13407 - }, 13408 - "prettier": { 13409 - "version": "3.6.2", 13410 - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", 13411 - "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", 13412 13390 "dev": true 13413 13391 }, 13414 13392 "prettyjson": {
-1
package.json
··· 44 44 "@typescript-eslint/parser": "7.18.0", 45 45 "eslint": "8.57.1", 46 46 "eslint-config-airbnb-base": "15.0.0", 47 - "prettier": "3.6.2", 48 47 "rimraf": "6.0.1", 49 48 "typescript": "5.9.3" 50 49 },
+1 -1
src/applicationCommandHandler.ts
··· 15 15 16 16 async function catchError( 17 17 error: Error, 18 - interaction: Discord.CommandInteraction, 18 + interaction: Discord.ChatInputCommandInteraction, 19 19 ) { 20 20 console.error( 21 21 `Caught:\n${error.stack}\nin command ${interaction.commandName} ${interaction.options}`,
+1 -2
src/commands/admin/config.ts
··· 1 1 import { 2 2 ChatInputCommandInteraction, 3 - CommandInteraction, 4 3 GuildMember, 5 4 } from 'discord.js'; 6 5 import { APIEmbed } from 'discord-api-types/v10'; ··· 10 9 import { setJoinChannel } from './joinsound'; 11 10 12 11 async function viewCurrentConfiguration( 13 - interaction: CommandInteraction, 12 + interaction: ChatInputCommandInteraction, 14 13 ) { 15 14 const guild = interaction.guild!; 16 15 const guildId = guild.id;
+4 -6
src/commands/admin/joinsound.ts
··· 1 - import { ChatInputCommandInteraction, CommandInteraction, GuildMember } from 'discord.js'; 1 + import { ChatInputCommandInteraction, GuildMember } from 'discord.js'; 2 2 import { APIApplicationCommandOptionChoice } from 'discord-api-types/v10'; 3 3 import { SlashCommandBuilder } from '@discordjs/builders'; 4 4 import { ··· 48 48 } 49 49 50 50 async function toggleJoinsoundChannel( 51 - interaction: CommandInteraction, 51 + interaction: ChatInputCommandInteraction, 52 52 activate: boolean, 53 53 ) { 54 54 const voiceChannel = (interaction.member as GuildMember).voice.channel; ··· 60 60 ); 61 61 if (success) { 62 62 interaction.followUp( 63 - `Successfully ${activate ? '' : 'de'}activated joinsounds in **${ 64 - voiceChannel.name 63 + `Successfully ${activate ? '' : 'de'}activated joinsounds in **${voiceChannel.name 65 64 }**.`, 66 65 ); 67 66 } else { 68 67 interaction.followUp( 69 - `**${voiceChannel.name}** already has joinsounds ${ 70 - activate ? 'active' : 'disabled' 68 + `**${voiceChannel.name}** already has joinsounds ${activate ? 'active' : 'disabled' 71 69 }.`, 72 70 ); 73 71 }
+4 -5
src/commands/admin/salt.ts
··· 1 1 import { 2 - ChatInputCommandInteraction, 3 - CommandInteraction, Guild, User, 2 + ChatInputCommandInteraction, Guild, User, 4 3 } from 'discord.js'; 5 4 import { SlashCommandBuilder } from '@discordjs/builders'; 6 5 import { interactionConfirmation } from '../../helperFunctions'; ··· 41 40 await saltGuild(userid, guildID, 0, true); 42 41 } 43 42 44 - async function resetSaltOfGuild(interaction: CommandInteraction) { 43 + async function resetSaltOfGuild(interaction: ChatInputCommandInteraction) { 45 44 const confirmation = await interactionConfirmation( 46 45 interaction, 47 46 'Do you really want to reset all salt on this server?', ··· 55 54 } 56 55 } 57 56 58 - async function clearAllSaltOfUser(interaction: CommandInteraction, user: User) { 57 + async function clearAllSaltOfUser(interaction: ChatInputCommandInteraction, user: User) { 59 58 if (user.bot) { 60 59 interaction.followUp('Bots are never salty!'); 61 60 return; ··· 71 70 } 72 71 } 73 72 74 - async function removeSaltOfUser(interaction: CommandInteraction, user: User) { 73 + async function removeSaltOfUser(interaction: ChatInputCommandInteraction, user: User) { 75 74 if (user.bot) { 76 75 interaction.followUp('Bots are never salty!'); 77 76 return;
+3 -4
src/commands/bug.ts
··· 1 1 import { SlashCommandBuilder } from '@discordjs/builders'; 2 - import { ChatInputCommandInteraction, CommandInteraction } from 'discord.js'; 2 + import { ChatInputCommandInteraction } from 'discord.js'; 3 3 import { getUserMention, interactionConfirmation } from '../helperFunctions'; 4 4 import { MagibotSlashCommand } from '../types/command'; 5 5 import { sendBugreport } from '../webhooks'; ··· 15 15 ) 16 16 .setRequired(true)); 17 17 18 - async function main(interaction: CommandInteraction, input: string) { 18 + async function main(interaction: ChatInputCommandInteraction, input: string) { 19 19 const confirmed = await interactionConfirmation( 20 20 interaction, 21 21 `Do you want to send this bugreport?\n${input}`, ··· 26 26 await sendBugreport( 27 27 `**Bugreport** by ${interaction.member?.user.username} (${getUserMention( 28 28 interaction.member?.user.id, 29 - )}) on server ${interaction.guild!.name}( ${ 30 - interaction.guild!.id 29 + )}) on server ${interaction.guild!.name}( ${interaction.guild!.id 31 30 } ) :\n${input}`, 32 31 ); 33 32 await confirmed.followUp({
+5 -6
src/commands/help.ts
··· 1 1 import { SlashCommandBuilder } from '@discordjs/builders'; 2 2 import { APIEmbed, APIEmbedField } from 'discord-api-types/v10'; 3 - import { CommandInteraction, GuildMember } from 'discord.js'; 3 + import { ChatInputCommandInteraction, GuildMember } from 'discord.js'; 4 4 import { user } from '../shared_assets'; 5 5 import { 6 6 MagibotAdminSlashCommand, ··· 34 34 35 35 function getAllCommandsOfObject(commands: ObjectOfNestedCommands): string { 36 36 return Object.entries(commands).reduce( 37 - (previous, [key, value]) => `${previous}/${ 38 - Object.hasOwn(value, 'permissions') && Object.hasOwn(value, 'run') // this implies it's a command 39 - ? key 40 - : getAllNestedCommandsOfObject(value as ObjectOfCommands, key) 37 + (previous, [key, value]) => `${previous}/${Object.hasOwn(value, 'permissions') && Object.hasOwn(value, 'run') // this implies it's a command 38 + ? key 39 + : getAllNestedCommandsOfObject(value as ObjectOfCommands, key) 41 40 } `, 42 41 '', 43 42 ); ··· 83 82 84 83 export const help: MagibotSlashCommand = { 85 84 permissions: [], 86 - async run(interaction: CommandInteraction) { 85 + async run(interaction: ChatInputCommandInteraction) { 87 86 const helpEmbed: APIEmbed = { 88 87 color: (interaction.member as GuildMember).displayColor, 89 88 description: "I'm here to help! ",
+4 -4
src/commands/info.ts
··· 1 1 import { SlashCommandBuilder } from '@discordjs/builders'; 2 2 import { APIEmbed } from 'discord-api-types/v10'; 3 - import { CommandInteraction, GuildMember } from 'discord.js'; 3 + import { ChatInputCommandInteraction, GuildMember } from 'discord.js'; 4 4 import { getBotInviteUrl } from '../helperFunctions'; 5 5 import { user, SIGN } from '../shared_assets'; 6 6 import { MagibotSlashCommand } from '../types/command'; 7 7 8 - async function main(interaction: CommandInteraction) { 8 + async function main(interaction: ChatInputCommandInteraction) { 9 9 const info: Array<{ 10 10 name: string; 11 11 value: string; ··· 19 19 { 20 20 name: 'The code is open source!', 21 21 value: 22 - 'Check out [the repository on GitHub](https://github.com/maybeanerd/MagiBot) and leave a star to show your support.', 22 + 'Check out [the repository on GitHub](https://github.com/maybeanerd/MagiBot) and leave a star to show your support.', 23 23 inline: false, 24 24 }, 25 25 { 26 26 name: 'How to support the development', 27 27 value: 28 - 'Pledge on [MagiBots Patreon](https://www.patreon.com/MagiBot)\nLeave a review on [bots.ondiscord.xyz](https://bots.ondiscord.xyz/bots/384820232583249921)', 28 + 'Pledge on [MagiBots Patreon](https://www.patreon.com/MagiBot)\nLeave a review on [bots.ondiscord.xyz](https://bots.ondiscord.xyz/bots/384820232583249921)', 29 29 inline: false, 30 30 }, 31 31 ];
+2 -2
src/commands/invite.ts
··· 1 1 import { SlashCommandBuilder } from '@discordjs/builders'; 2 2 import { 3 - CommandInteraction, 3 + ChatInputCommandInteraction, 4 4 PermissionFlagsBits, 5 5 TextChannel, 6 6 } from 'discord.js'; ··· 11 11 .setDescription('Creates a temporary invite link to this channel') 12 12 .setDMPermission(false); 13 13 14 - async function main(interaction: CommandInteraction) { 14 + async function main(interaction: ChatInputCommandInteraction) { 15 15 const invite = await (interaction.channel as TextChannel).createInvite({ 16 16 reason: `member ${interaction.member?.user} used invite command`, 17 17 });
+6 -8
src/commands/joinsound/management.ts
··· 1 1 import ffprobe from 'ffprobe'; 2 - import { CommandInteraction, Attachment, User } from 'discord.js'; 2 + import { ChatInputCommandInteraction, Attachment, User } from 'discord.js'; 3 3 import { APIEmbed, APIEmbedField } from 'discord-api-types/v10'; 4 4 import { 5 5 getGlobalUser, ··· 126 126 127 127 export async function validateAndSaveJoinsound( 128 128 attachment: Attachment, 129 - interaction: CommandInteraction, 129 + interaction: ChatInputCommandInteraction, 130 130 setDefault: boolean, 131 131 user?: User, 132 132 defaultForGuildId?: string, ··· 142 142 } 143 143 if (attachment.size > maximumSingleFileSize) { 144 144 interaction.followUp( 145 - `The file you sent is larger than ${ 146 - maximumSingleFileSize / 1024 145 + `The file you sent is larger than ${maximumSingleFileSize / 1024 147 146 } KB, which is the limit per file!`, 148 147 ); 149 148 return; ··· 267 266 } 268 267 269 268 export async function removeAllJoinsoundsOfUser( 270 - interaction: CommandInteraction, 269 + interaction: ChatInputCommandInteraction, 271 270 deferralType: DeferReply, 272 271 ) { 273 272 const confirmed = await interactionConfirmation( ··· 305 304 const maxEmbedCharacters = 4096; 306 305 307 306 export async function getJoinsoundOverviewOfUser( 308 - interaction: CommandInteraction, 307 + interaction: ChatInputCommandInteraction, 309 308 ) { 310 309 const { user } = interaction.member!; 311 310 const userId = user.id; ··· 324 323 325 324 info.push({ 326 325 name: 'Storage Used by Joinsounds', 327 - value: `**${(storageUsed / 1024).toFixed(1)} KB** / ${ 328 - joinsoundStorageUserLimit / 1024 326 + value: `**${(storageUsed / 1024).toFixed(1)} KB** / ${joinsoundStorageUserLimit / 1024 329 327 } KB`, 330 328 inline: false, 331 329 });
+2 -2
src/commands/ping.ts
··· 1 1 import { SlashCommandBuilder } from '@discordjs/builders'; 2 - import { CommandInteraction } from 'discord.js'; 2 + import { ChatInputCommandInteraction } from 'discord.js'; 3 3 import { MagibotSlashCommand } from '../types/command'; 4 4 5 5 const slashCommand = new SlashCommandBuilder() ··· 9 9 10 10 export const ping: MagibotSlashCommand = { 11 11 permissions: [], 12 - async run(interaction: CommandInteraction) { 12 + async run(interaction: ChatInputCommandInteraction) { 13 13 const stop = new Date(); 14 14 const diff = stop.getTime() - interaction.createdAt.getTime(); 15 15 await interaction.reply(`Pong! \`(${diff}ms)\``);
+4 -4
src/commands/profile.ts
··· 1 - import { CommandInteraction } from 'discord.js'; 1 + import { ChatInputCommandInteraction } from 'discord.js'; 2 2 import { APIEmbed } from 'discord-api-types/v10'; 3 3 import { SlashCommandBuilder } from '@discordjs/builders'; 4 4 import { DeferReply, MagibotSlashCommand } from '../types/command'; ··· 15 15 } 16 16 return result.salt; 17 17 } 18 - async function runCommand(interaction: CommandInteraction) { 18 + async function runCommand(interaction: ChatInputCommandInteraction) { 19 19 const guild = interaction.guild!; 20 - const interactionOption = interaction.options.get('user', false); 21 - const userId = interactionOption?.user?.id; 20 + const interactionOption = interaction.options.getUser('user', false); 21 + const userId = interactionOption?.id; 22 22 const member = await guild.members.fetch(userId ?? interaction.user.id)!; 23 23 const info: Array<{ 24 24 name: string;
+7 -10
src/commands/queue/index.ts
··· 1 1 import { 2 - CommandInteraction, 3 2 Guild, 4 3 TextChannel, 5 4 Message, ··· 37 36 leave = 'leave', 38 37 } 39 38 40 - async function startQueue(interaction: CommandInteraction, topic: string) { 39 + async function startQueue(interaction: ChatInputCommandInteraction, topic: string) { 41 40 const guild = interaction.guild!; 42 41 43 42 const originalMessage = (await interaction.followUp( ··· 120 119 } 121 120 122 121 async function endRunningQueue( 123 - interaction: CommandInteraction | ButtonInteraction, 122 + interaction: ChatInputCommandInteraction | ButtonInteraction, 124 123 ) { 125 124 const guild = interaction.guild!; 126 125 const runningQueue = await onQueueEnd(guild); ··· 153 152 } 154 153 return message 155 154 .edit( 156 - `${msg}\n*${ 157 - queuedUsers.length 158 - }/${maximumQueueLength} users queued*\n\nCurrent user: **${ 159 - activeUser ? getUserMention(activeUser) : 'Nobody' 155 + `${msg}\n*${queuedUsers.length 156 + }/${maximumQueueLength} users queued*\n\nCurrent user: **${activeUser ? getUserMention(activeUser) : 'Nobody' 160 157 }**\n\nNext up are:${nextUsers}\nUse the buttons below to join and leave the queue!`, 161 158 ) 162 159 .catch(doNothingOnError); 163 160 } 164 161 165 162 export async function sendItsYourTurnMessage( 166 - interaction: CommandInteraction | ButtonInteraction, 163 + interaction: ChatInputCommandInteraction | ButtonInteraction, 167 164 userId: string, 168 165 ) { 169 166 const messageContent = { ··· 179 176 } 180 177 181 178 export async function goToNextUser( 182 - interaction: CommandInteraction | ButtonInteraction, 179 + interaction: ChatInputCommandInteraction | ButtonInteraction, 183 180 ) { 184 181 const guild = interaction.guild!; 185 182 const wentToNextUser = await goToNextUserOfQueue(guild.id); ··· 229 226 'Manage queues for events such as karaoke or playing view viewers.', 230 227 ) 231 228 .setDMPermission(false) 232 - // only allow administrators to use these commands by default 229 + // only allow administrators to use these commands by default 233 230 .setDefaultMemberPermissions( 234 231 // eslint-disable-next-line no-bitwise 235 232 PermissionFlagsBits.Administrator | PermissionFlagsBits.ManageGuild,
+3 -3
src/commands/rfact.ts
··· 1 1 import { SlashCommandBuilder } from '@discordjs/builders'; 2 2 import axios from 'axios'; 3 - import { CommandInteraction, GuildMember } from 'discord.js'; 3 + import { GuildMember, ChatInputCommandInteraction } from 'discord.js'; 4 4 import { user } from '../shared_assets'; 5 5 import { DeferReply, MagibotSlashCommand } from '../types/command'; 6 6 ··· 11 11 day: 'numeric', 12 12 }; 13 13 14 - async function main(interaction: CommandInteraction) { 14 + async function main(interaction: ChatInputCommandInteraction) { 15 15 const now = new Date(); 16 16 const incomingFact = await axios.get<string>( 17 17 `http://numbersapi.com/${now.getMonth() + 1}/${now.getDate()}/date`, ··· 42 42 43 43 export const randomfact: MagibotSlashCommand = { 44 44 permissions: [], 45 - async run(interaction: CommandInteraction) { 45 + async run(interaction: ChatInputCommandInteraction) { 46 46 return main(interaction); 47 47 }, 48 48 definition: slashCommand.toJSON(),
+1 -2
src/commands/roll.ts
··· 1 1 import { SlashCommandBuilder } from '@discordjs/builders'; 2 2 import { 3 3 ChatInputCommandInteraction, 4 - CommandInteraction, 5 4 GuildMember, 6 5 } from 'discord.js'; 7 6 import { MagibotSlashCommand } from '../types/command'; ··· 66 65 .setRequired(true)); 67 66 68 67 async function runCommand( 69 - interaction: CommandInteraction, 68 + interaction: ChatInputCommandInteraction, 70 69 input: string, 71 70 ) { 72 71 const diceRollCalculation = parse(input);
+6 -8
src/commands/salt.ts
··· 1 1 import { 2 - ChatInputCommandInteraction, CommandInteraction, Guild, User, 2 + ChatInputCommandInteraction, Guild, User, 3 3 } from 'discord.js'; 4 4 import { APIEmbed } from 'discord-api-types/v10'; 5 5 import { SlashCommandBuilder } from '@discordjs/builders'; ··· 85 85 } 86 86 87 87 export async function addSalt( 88 - interaction: CommandInteraction, 88 + interaction: ChatInputCommandInteraction, 89 89 reportedUser: User, 90 90 fromAdmin = false, 91 91 ) { ··· 123 123 124 124 return; 125 125 } 126 - const response = `You can report ${reportedUser} again in ${ 127 - 59 - Math.floor((time * 60) % 60) 126 + const response = `You can report ${reportedUser} again in ${59 - Math.floor((time * 60) % 60) 128 127 } min and ${60 - Math.floor((time * 60 * 60) % 60)} sec!`; 129 128 if (doesInteractionRequireFollowup(interaction)) { 130 129 await interaction.followUp(response); ··· 140 139 salt: number, 141 140 ) { 142 141 let memberName = 'User left guild'; 143 - const member = await guild.members.fetch(salter).catch(() => {}); 142 + const member = await guild.members.fetch(salter).catch(() => { }); 144 143 if (member) { 145 144 memberName = member.displayName; 146 145 } 147 - const name = `${ 148 - index === 0 ? 'Monarch of Salt' : `${index + 1}. place` 146 + const name = `${index === 0 ? 'Monarch of Salt' : `${index + 1}. place` 149 147 }: ${memberName}`; 150 148 return { 151 149 name, ··· 154 152 }; 155 153 } 156 154 157 - async function getTopSalters(interaction: CommandInteraction) { 155 + async function getTopSalters(interaction: ChatInputCommandInteraction) { 158 156 const guild = interaction.guild!; 159 157 const salters = await topSalt(guild.id); 160 158 const info: Array<
+9 -10
src/helperFunctions.ts
··· 2 2 import Discord, { 3 3 ButtonInteraction, 4 4 ButtonStyle, 5 - CommandInteraction, 5 + ChatInputCommandInteraction, 6 6 InteractionReplyOptions, 7 7 Message, 8 8 MessageComponentInteraction, ··· 10 10 import { user } from './shared_assets'; 11 11 import { DeferReply } from './types/command'; 12 12 13 - export function doNothingOnError() {} 13 + export function doNothingOnError() { } 14 14 15 15 export function returnNullOnError() { 16 16 return null; ··· 93 93 } 94 94 95 95 export function doesInteractionRequireFollowup( 96 - interaction: CommandInteraction | ButtonInteraction, 96 + interaction: ChatInputCommandInteraction | ButtonInteraction, 97 97 ) { 98 98 return interaction.replied || interaction.deferred; 99 99 } ··· 101 101 // this is an idea to implement rather reusable confirmation processes. 102 102 // ; abortMessage, timeoutMessage and time are optional parameters 103 103 export async function interactionConfirmation( 104 - interaction: Discord.CommandInteraction, 104 + interaction: Discord.ChatInputCommandInteraction, 105 105 question: string, 106 106 deferralType?: DeferReply | false, 107 107 abortMessage: string = 'Cancelled.', ··· 186 186 export async function asyncForEach<T, F, O>( 187 187 values: Array<T> | Discord.Collection<string | number, T>, 188 188 callback: ( 189 - input: T, 190 - index: number | string, 191 - optionalParams?: O 192 - ) => Promise<F>, 189 + input: T, 190 + index: number | string, 191 + optionalParams?: O 192 + ) => Promise<F>, 193 193 optParams?: O, 194 194 ) { 195 195 if (Array.isArray(values)) { ··· 233 233 } 234 234 235 235 export function getBotInviteUrl() { 236 - return `https://discord.com/api/oauth2/authorize?client_id=${ 237 - user().id 236 + return `https://discord.com/api/oauth2/authorize?client_id=${user().id 238 237 }&permissions=3212353&scope=bot%20applications.commands`; 239 238 } 240 239
+1 -1
tsconfig.json
··· 18 18 /* Experimental Options */ 19 19 "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */, 20 20 "outDir": "dist", 21 - "skipLibCheck": true 21 + "skipLibCheck": true 22 22 } 23 23 }