Select the types of activity you want to include in your feed.
[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
···11import {
22- ChatInputCommandInteraction,
33- CommandInteraction, Guild, User,
22+ ChatInputCommandInteraction, Guild, User,
43} from 'discord.js';
54import { SlashCommandBuilder } from '@discordjs/builders';
65import { interactionConfirmation } from '../../helperFunctions';
···4140 await saltGuild(userid, guildID, 0, true);
4241}
43424444-async function resetSaltOfGuild(interaction: CommandInteraction) {
4343+async function resetSaltOfGuild(interaction: ChatInputCommandInteraction) {
4544 const confirmation = await interactionConfirmation(
4645 interaction,
4746 'Do you really want to reset all salt on this server?',
···5554 }
5655}
57565858-async function clearAllSaltOfUser(interaction: CommandInteraction, user: User) {
5757+async function clearAllSaltOfUser(interaction: ChatInputCommandInteraction, user: User) {
5958 if (user.bot) {
6059 interaction.followUp('Bots are never salty!');
6160 return;
···7170 }
7271}
73727474-async function removeSaltOfUser(interaction: CommandInteraction, user: User) {
7373+async function removeSaltOfUser(interaction: ChatInputCommandInteraction, user: User) {
7574 if (user.bot) {
7675 interaction.followUp('Bots are never salty!');
7776 return;
+3-4
src/commands/bug.ts
···11import { SlashCommandBuilder } from '@discordjs/builders';
22-import { ChatInputCommandInteraction, CommandInteraction } from 'discord.js';
22+import { ChatInputCommandInteraction } from 'discord.js';
33import { getUserMention, interactionConfirmation } from '../helperFunctions';
44import { MagibotSlashCommand } from '../types/command';
55import { sendBugreport } from '../webhooks';
···1515 )
1616 .setRequired(true));
17171818-async function main(interaction: CommandInteraction, input: string) {
1818+async function main(interaction: ChatInputCommandInteraction, input: string) {
1919 const confirmed = await interactionConfirmation(
2020 interaction,
2121 `Do you want to send this bugreport?\n${input}`,
···2626 await sendBugreport(
2727 `**Bugreport** by ${interaction.member?.user.username} (${getUserMention(
2828 interaction.member?.user.id,
2929- )}) on server ${interaction.guild!.name}( ${
3030- interaction.guild!.id
2929+ )}) on server ${interaction.guild!.name}( ${interaction.guild!.id
3130 } ) :\n${input}`,
3231 );
3332 await confirmed.followUp({
+5-6
src/commands/help.ts
···11import { SlashCommandBuilder } from '@discordjs/builders';
22import { APIEmbed, APIEmbedField } from 'discord-api-types/v10';
33-import { CommandInteraction, GuildMember } from 'discord.js';
33+import { ChatInputCommandInteraction, GuildMember } from 'discord.js';
44import { user } from '../shared_assets';
55import {
66 MagibotAdminSlashCommand,
···34343535function getAllCommandsOfObject(commands: ObjectOfNestedCommands): string {
3636 return Object.entries(commands).reduce(
3737- (previous, [key, value]) => `${previous}/${
3838- Object.hasOwn(value, 'permissions') && Object.hasOwn(value, 'run') // this implies it's a command
3939- ? key
4040- : getAllNestedCommandsOfObject(value as ObjectOfCommands, key)
3737+ (previous, [key, value]) => `${previous}/${Object.hasOwn(value, 'permissions') && Object.hasOwn(value, 'run') // this implies it's a command
3838+ ? key
3939+ : getAllNestedCommandsOfObject(value as ObjectOfCommands, key)
4140 } `,
4241 '',
4342 );
···83828483export const help: MagibotSlashCommand = {
8584 permissions: [],
8686- async run(interaction: CommandInteraction) {
8585+ async run(interaction: ChatInputCommandInteraction) {
8786 const helpEmbed: APIEmbed = {
8887 color: (interaction.member as GuildMember).displayColor,
8988 description: "I'm here to help! ",
+4-4
src/commands/info.ts
···11import { SlashCommandBuilder } from '@discordjs/builders';
22import { APIEmbed } from 'discord-api-types/v10';
33-import { CommandInteraction, GuildMember } from 'discord.js';
33+import { ChatInputCommandInteraction, GuildMember } from 'discord.js';
44import { getBotInviteUrl } from '../helperFunctions';
55import { user, SIGN } from '../shared_assets';
66import { MagibotSlashCommand } from '../types/command';
7788-async function main(interaction: CommandInteraction) {
88+async function main(interaction: ChatInputCommandInteraction) {
99 const info: Array<{
1010 name: string;
1111 value: string;
···1919 {
2020 name: 'The code is open source!',
2121 value:
2222- 'Check out [the repository on GitHub](https://github.com/maybeanerd/MagiBot) and leave a star to show your support.',
2222+ 'Check out [the repository on GitHub](https://github.com/maybeanerd/MagiBot) and leave a star to show your support.',
2323 inline: false,
2424 },
2525 {
2626 name: 'How to support the development',
2727 value:
2828- 'Pledge on [MagiBots Patreon](https://www.patreon.com/MagiBot)\nLeave a review on [bots.ondiscord.xyz](https://bots.ondiscord.xyz/bots/384820232583249921)',
2828+ 'Pledge on [MagiBots Patreon](https://www.patreon.com/MagiBot)\nLeave a review on [bots.ondiscord.xyz](https://bots.ondiscord.xyz/bots/384820232583249921)',
2929 inline: false,
3030 },
3131 ];
+2-2
src/commands/invite.ts
···11import { SlashCommandBuilder } from '@discordjs/builders';
22import {
33- CommandInteraction,
33+ ChatInputCommandInteraction,
44 PermissionFlagsBits,
55 TextChannel,
66} from 'discord.js';
···1111 .setDescription('Creates a temporary invite link to this channel')
1212 .setDMPermission(false);
13131414-async function main(interaction: CommandInteraction) {
1414+async function main(interaction: ChatInputCommandInteraction) {
1515 const invite = await (interaction.channel as TextChannel).createInvite({
1616 reason: `member ${interaction.member?.user} used invite command`,
1717 });
+6-8
src/commands/joinsound/management.ts
···11import ffprobe from 'ffprobe';
22-import { CommandInteraction, Attachment, User } from 'discord.js';
22+import { ChatInputCommandInteraction, Attachment, User } from 'discord.js';
33import { APIEmbed, APIEmbedField } from 'discord-api-types/v10';
44import {
55 getGlobalUser,
···126126127127export async function validateAndSaveJoinsound(
128128 attachment: Attachment,
129129- interaction: CommandInteraction,
129129+ interaction: ChatInputCommandInteraction,
130130 setDefault: boolean,
131131 user?: User,
132132 defaultForGuildId?: string,
···142142 }
143143 if (attachment.size > maximumSingleFileSize) {
144144 interaction.followUp(
145145- `The file you sent is larger than ${
146146- maximumSingleFileSize / 1024
145145+ `The file you sent is larger than ${maximumSingleFileSize / 1024
147146 } KB, which is the limit per file!`,
148147 );
149148 return;
···267266}
268267269268export async function removeAllJoinsoundsOfUser(
270270- interaction: CommandInteraction,
269269+ interaction: ChatInputCommandInteraction,
271270 deferralType: DeferReply,
272271) {
273272 const confirmed = await interactionConfirmation(
···305304const maxEmbedCharacters = 4096;
306305307306export async function getJoinsoundOverviewOfUser(
308308- interaction: CommandInteraction,
307307+ interaction: ChatInputCommandInteraction,
309308) {
310309 const { user } = interaction.member!;
311310 const userId = user.id;
···324323325324 info.push({
326325 name: 'Storage Used by Joinsounds',
327327- value: `**${(storageUsed / 1024).toFixed(1)} KB** / ${
328328- joinsoundStorageUserLimit / 1024
326326+ value: `**${(storageUsed / 1024).toFixed(1)} KB** / ${joinsoundStorageUserLimit / 1024
329327 } KB`,
330328 inline: false,
331329 });