From aa636d53b57998d506668f5875f58cbffc6d003f Mon Sep 17 00:00:00 2001 From: FordFriedel Date: Fri, 24 Mar 2023 10:49:51 -0500 Subject: [PATCH 01/12] 3-22 commit --- package.json | 4 ++-- src/Bot.ts | 2 +- src/CustomLogger.ts | 4 ++-- src/events/GuildCreate.ts | 4 ++-- src/events/InteractionCreate.ts | 2 +- src/keywords/SevenTwentySeven.ts | 4 ++-- src/messagecommands/SendUpdate.ts | 4 ++-- src/messagecommands/fuckimissheralready.ts | 4 ++-- src/resources/birthdayTimer.ts | 4 ++-- src/resources/voiceCommandCheck.ts | 4 ++-- src/slashcommands/Birthday.ts | 20 +++++++++++++------- src/slashcommands/BirthdayConfig.ts | 4 ++-- src/slashcommands/BirthdayList.ts | 4 ++-- src/slashcommands/ClearQueue.ts | 4 ++-- src/slashcommands/Config.ts | 4 ++-- src/slashcommands/DefaultVc.ts | 4 ++-- src/slashcommands/Gavin.ts | 8 ++++---- src/slashcommands/Github.ts | 4 ++-- src/slashcommands/Help.ts | 12 ++++++------ src/slashcommands/Invite.ts | 4 ++-- src/slashcommands/Kanye.ts | 4 ++-- src/slashcommands/Kawaii.ts | 4 ++-- src/slashcommands/Loop.ts | 4 ++-- src/slashcommands/Nasa.ts | 4 ++-- src/slashcommands/NowPlaying.ts | 4 ++-- src/slashcommands/Nsfw.ts | 4 ++-- src/slashcommands/Nut.ts | 4 ++-- src/slashcommands/Option.ts | 4 ++-- src/slashcommands/Pause.ts | 12 ++++++++---- src/slashcommands/Play.ts | 4 ++-- src/slashcommands/PlayNext.ts | 4 ++-- src/slashcommands/Poll.ts | 4 ++-- src/slashcommands/Queue.ts | 4 ++-- src/slashcommands/Resume.ts | 4 ++-- src/slashcommands/Roll.ts | 4 ++-- src/slashcommands/ServerColor.ts | 4 ++-- src/slashcommands/Shuffle.ts | 4 ++-- src/slashcommands/SilenceRole.ts | 6 +++--- src/slashcommands/Skip.ts | 4 ++-- src/slashcommands/Stock.ts | 8 ++++---- src/slashcommands/Tickle.ts | 4 ++-- src/slashcommands/Update.ts | 4 ++-- src/slashcommands/Weather.ts | 8 ++++---- 43 files changed, 112 insertions(+), 102 deletions(-) diff --git a/package.json b/package.json index 7b61704..3591c87 100644 --- a/package.json +++ b/package.json @@ -10,12 +10,12 @@ "author": "Ford Friedel", "license": "ISC", "dependencies": { - "@discordjs/opus": "^0.8.0", + "@discordjs/opus": "latest", "@discordjs/voice": "latest", "chrono-node": "latest", "cron": "latest", "discord-player": "latest", - "discord.js": "latest", + "discord.js": "^14.8.0", "enmap": "latest", "ffmpeg": "latest", "ffmpeg-static": "^4.4.1", diff --git a/src/Bot.ts b/src/Bot.ts index d592795..f642b33 100644 --- a/src/Bot.ts +++ b/src/Bot.ts @@ -1,4 +1,4 @@ -import { Client, Guild, MessageEmbed, TextChannel } from 'discord.js'; +import { Client, Guild, EmbedBuilder, TextChannel } from 'discord.js'; import { CustomLogger } from './CustomLogger'; import { TLogLevelName } from 'tslog'; import { permissionsCheck } from './resources/permissionsCheck'; diff --git a/src/CustomLogger.ts b/src/CustomLogger.ts index 6f6c1f2..fb7fe3b 100644 --- a/src/CustomLogger.ts +++ b/src/CustomLogger.ts @@ -3,7 +3,7 @@ import { appendFile } from 'fs'; import mkdirp from 'mkdirp'; import path from 'path'; import { Bot } from './Bot'; -import { AnyChannel, MessageEmbed, TextChannel } from 'discord.js'; +import { AnyChannel, EmbedBuilder, TextChannel } from 'discord.js'; import config from '../config.json'; export class CustomLogger extends Logger { @@ -52,7 +52,7 @@ export class CustomLogger extends Logger { if (commandName) { var errorChannel: AnyChannel; - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setTitle(`Error in command: __${commandName.toUpperCase()}__`) .setColor('RED'); if (channelId) { diff --git a/src/events/GuildCreate.ts b/src/events/GuildCreate.ts index 513cf7a..092c64b 100644 --- a/src/events/GuildCreate.ts +++ b/src/events/GuildCreate.ts @@ -2,7 +2,7 @@ import { EventHandler } from './EventHandler'; import { Bot } from '../Bot'; import { Guild, - MessageEmbed, + EmbedBuilder, TextChannel, Permissions, GuildChannel, @@ -12,7 +12,7 @@ import { export class GuildCreate implements EventHandler { eventName = 'guildCreate'; async process(bot: Bot, guild: Guild): Promise { - let embed = new MessageEmbed() + let embed = new EmbedBuilder() .setTitle('**:mirror: Mirror has arrived!**') .setDescription( 'Thanks for inviting Mirror to your server! \n\n To get started with Mirror use **`/help`** for more information about commands and functionality\n\nUse **`/config`** to see what else you can do before Mirror is fully functional' diff --git a/src/events/InteractionCreate.ts b/src/events/InteractionCreate.ts index ce938ab..c8ce7d8 100644 --- a/src/events/InteractionCreate.ts +++ b/src/events/InteractionCreate.ts @@ -1,5 +1,5 @@ import { joinVoiceChannel } from '@discordjs/voice'; -import { CommandInteraction, GuildMember, MessageEmbed, TextChannel, TextBasedChannel, GuildChannel } from 'discord.js'; +import { CommandInteraction, GuildMember, EmbedBuilder, TextChannel, TextBasedChannel, GuildChannel } from 'discord.js'; import { Bot } from '../Bot'; import { managerCheck } from '../resources/managerCheck'; import { voiceCommandCheck } from '../resources/voiceCommandCheck'; diff --git a/src/keywords/SevenTwentySeven.ts b/src/keywords/SevenTwentySeven.ts index 681dcd0..a6e0ef5 100644 --- a/src/keywords/SevenTwentySeven.ts +++ b/src/keywords/SevenTwentySeven.ts @@ -1,7 +1,7 @@ //Keyword: 727 //Reacts to the keyword with WYSI embed -import { Message, Permissions, MessageEmbed } from 'discord.js'; +import { Message, Permissions, EmbedBuilder } from 'discord.js'; import { Bot } from '../Bot'; import { Keyword } from './Keyword'; @@ -20,7 +20,7 @@ export class SevenTwentySeven implements Keyword { ): Promise { try { await message.delete(); - let embed = new MessageEmbed() + let embed = new EmbedBuilder() .setColor('#ff66aa') .setImage('https://c.tenor.com/zbPLwrk_K44AAAAC/wysi.gif') .setTitle('**__WHEN YOU FUCKING SEE IT__**'); diff --git a/src/messagecommands/SendUpdate.ts b/src/messagecommands/SendUpdate.ts index f08c571..972787e 100644 --- a/src/messagecommands/SendUpdate.ts +++ b/src/messagecommands/SendUpdate.ts @@ -1,4 +1,4 @@ -import { Message, Permissions, MessageEmbed, TextChannel } from 'discord.js'; +import { Message, Permissions, EmbedBuilder, TextChannel } from 'discord.js'; import { Bot } from '../Bot'; import { MessageCommand } from './MessageCommand'; import config from '../../config.json'; @@ -18,7 +18,7 @@ export class SendUpdate implements MessageCommand { return; //we dont need to respond because as far as anyone cares this command does not matter } let content = message.content.slice(12); //cuts out "$sendupdate " - let embed = new MessageEmbed() + let embed = new EmbedBuilder() .setColor('#FFFFFF') .setTitle( ':mirror: **__Mirror Update!__** <:homies:863998146589360158>' diff --git a/src/messagecommands/fuckimissheralready.ts b/src/messagecommands/fuckimissheralready.ts index b5034d3..e3637f7 100644 --- a/src/messagecommands/fuckimissheralready.ts +++ b/src/messagecommands/fuckimissheralready.ts @@ -6,7 +6,7 @@ //actually rent free //got me so depressed im actually doing school work, thats a new low -import { Message, Permissions, MessageEmbed } from 'discord.js'; +import { Message, Permissions, EmbedBuilder } from 'discord.js'; import { Bot } from '../Bot'; import { MessageCommand } from './MessageCommand'; import fetch from 'node-fetch'; @@ -31,7 +31,7 @@ export class fuckimissheralready implements MessageCommand { if (nsfw.get(message.guild!.id) != 'on') return; let res = await fetch(`https://nekos.best/api/v1/cry`); let jsonData = await res.json(); - let embed = new MessageEmbed() + let embed = new EmbedBuilder() .setColor('#0071b6') .setImage(jsonData.url) .setFooter({ text: 'I feel you bro' }); diff --git a/src/resources/birthdayTimer.ts b/src/resources/birthdayTimer.ts index 8095984..acdf0db 100644 --- a/src/resources/birthdayTimer.ts +++ b/src/resources/birthdayTimer.ts @@ -1,7 +1,7 @@ import { bdayDates } from '../slashcommands/Birthday'; import cron from 'node-cron'; import { Bot } from '../Bot'; -import { MessageEmbed, TextChannel, User } from 'discord.js'; +import { EmbedBuilder, TextChannel, User } from 'discord.js'; import Enmap from 'enmap'; import { bdayChannels, bdayTimes } from '../slashcommands/BirthdayConfig'; import { silencedUsers } from '../slashcommands/SilenceMember'; @@ -61,7 +61,7 @@ export async function birthdayTimer(guild: string, bot: Bot): Promise { if (!targetChannel) return; //create embed and send - const bdayEmbed = new MessageEmbed() + const bdayEmbed = new EmbedBuilder() .setDescription(`**:birthday: Happy Birthday <@${userId}> :tada:**`) .setColor(member.displayHexColor) .setFooter({ diff --git a/src/resources/voiceCommandCheck.ts b/src/resources/voiceCommandCheck.ts index 6ae4e64..98ad703 100644 --- a/src/resources/voiceCommandCheck.ts +++ b/src/resources/voiceCommandCheck.ts @@ -1,5 +1,5 @@ import { joinVoiceChannel } from "@discordjs/voice"; -import { CommandInteraction, GuildMember, MessageEmbed } from "discord.js"; +import { CommandInteraction, GuildMember, EmbedBuilder } from "discord.js"; import { transpileModule } from "typescript"; import { Bot } from "../Bot"; import { colorCheck } from "./embedColorCheck"; @@ -7,7 +7,7 @@ import { colorCheck } from "./embedColorCheck"; export function voiceCommandCheck(bot: Bot, interaction: CommandInteraction): boolean { let member = interaction.member as GuildMember; let state = member.voice.channel; - var embed = new MessageEmbed().setColor(colorCheck(interaction.guild!.id,true)); + var embed = new EmbedBuilder().setColor(colorCheck(interaction.guild!.id,true)); //if user is not connected if (!state) { diff --git a/src/slashcommands/Birthday.ts b/src/slashcommands/Birthday.ts index e28f81b..1e29b96 100644 --- a/src/slashcommands/Birthday.ts +++ b/src/slashcommands/Birthday.ts @@ -1,10 +1,13 @@ import { CommandInteraction, + CommandInteractionOptionResolver, CacheType, - MessageEmbed, + EmbedBuilder, + ApplicationCommandOptionType, ApplicationCommandDataResolvable, + ApplicationCommandStringOption, + APIApplicationCommandInteractionDataIntegerOption, } from 'discord.js'; -import { ApplicationCommandOptionTypes } from 'discord.js/typings/enums'; import Enmap from 'enmap'; import { Bot } from '../Bot'; import { colorCheck } from '../resources/embedColorCheck'; @@ -104,7 +107,7 @@ export class Birthday implements SlashCommand { new Option( 'month', 'Your Birth Month', - ApplicationCommandOptionTypes.STRING, + ApplicationCommandOptionType.STRING, true, 'may', months @@ -112,7 +115,7 @@ export class Birthday implements SlashCommand { new Option( 'day', 'The date of your birthday', - ApplicationCommandOptionTypes.INTEGER, + ApplicationCommandOptionType.IN, true ), ]; @@ -124,10 +127,11 @@ export class Birthday implements SlashCommand { try { let userArray = silencedUsers.ensure(interaction.guild!.id, []); if (userArray.includes(interaction.user.id)) { - return interaction.reply({ + interaction.reply({ content: 'Silenced users cannot use this command', ephemeral: true, }); + return; } if ( @@ -135,23 +139,25 @@ export class Birthday implements SlashCommand { dayCap[interaction.options.getString('month')!] || interaction.options.getInteger('day')! < 1 ) { - return interaction.reply({ + interaction.reply({ content: 'Please enter a valid date', ephemeral: true, }); + return; } //store the date of birth in numerical form DD-MM let formattedBirthday = `${interaction.options.getInteger('day')}-${ monthCode[interaction.options.getString('month')!] }`; + //set the new birthday into the enmap bdayDates.set(interaction.user.id, formattedBirthday); let monthCap = interaction.options.getString('month')!.charAt(0).toUpperCase() + interaction.options.getString('month')!.slice(1); - let embed = new MessageEmbed() + let embed = new EmbedBuilder() .setDescription( `Successfully set your birthday to: ${monthCap} ${interaction.options.getInteger( 'day' diff --git a/src/slashcommands/BirthdayConfig.ts b/src/slashcommands/BirthdayConfig.ts index 1b92fde..8a287f2 100644 --- a/src/slashcommands/BirthdayConfig.ts +++ b/src/slashcommands/BirthdayConfig.ts @@ -5,7 +5,7 @@ import { GuildMember, TextChannel, GuildChannel, - MessageEmbed, + EmbedBuilder, } from 'discord.js'; import { ApplicationCommandOptionTypes } from 'discord.js/typings/enums'; import { Bot } from '../Bot'; @@ -150,7 +150,7 @@ export class BirthdayConfig implements SlashCommand { let minuteText = minute.toString(); if (hour < 10) hourText = '0' + hourText; if (minute < 10) minuteText = '0' + minuteText; - let embed = new MessageEmbed() + let embed = new EmbedBuilder() .setColor(colorCheck(interaction.guild!.id)) .setDescription( `Successfully scheduled your birthday timer for **\`${hourText}:${minuteText}\` \`${timezone.toUpperCase()}\`** in ${interaction.options.getChannel( diff --git a/src/slashcommands/BirthdayList.ts b/src/slashcommands/BirthdayList.ts index 6199b0c..fa202e2 100644 --- a/src/slashcommands/BirthdayList.ts +++ b/src/slashcommands/BirthdayList.ts @@ -1,4 +1,4 @@ -import { CommandInteraction, CacheType, MessageEmbed, Message, User, MessageReaction } from 'discord.js'; +import { CommandInteraction, CacheType, EmbedBuilder, Message, User, MessageReaction } from 'discord.js'; import { Bot } from '../Bot'; import { Option, Subcommand } from './Option'; import { SlashCommand} from './SlashCommand'; @@ -41,7 +41,7 @@ export class BirthdayList implements SlashCommand { let currentPage = 1; let initialPage = populatePage(1,list); - let embed = new MessageEmbed() + let embed = new EmbedBuilder() .setTitle(`Birthday List for ${interaction.guild!.name}`) .setFooter({text: `Page ${currentPage} of ${pages}`}) .addFields( diff --git a/src/slashcommands/ClearQueue.ts b/src/slashcommands/ClearQueue.ts index 9ff2874..c222ac7 100644 --- a/src/slashcommands/ClearQueue.ts +++ b/src/slashcommands/ClearQueue.ts @@ -2,7 +2,7 @@ import { ApplicationCommandDataResolvable, CommandInteraction, CacheType, - MessageEmbed, + EmbedBuilder, GuildMember, } from 'discord.js'; import { Bot } from '../Bot'; @@ -16,7 +16,7 @@ export class ClearQueue implements SlashCommand { requiredPermissions: bigint[] = []; run(bot: Bot, interaction: CommandInteraction): Promise { try { - const embed = new MessageEmbed().setColor(colorCheck(interaction.guild!.id,true)); + const embed = new EmbedBuilder().setColor(colorCheck(interaction.guild!.id,true)); let queue = bot.player.getQueue(interaction.guild!.id); if (!queue || !queue.playing) { diff --git a/src/slashcommands/Config.ts b/src/slashcommands/Config.ts index e6e46c7..74ea328 100644 --- a/src/slashcommands/Config.ts +++ b/src/slashcommands/Config.ts @@ -2,7 +2,7 @@ import { ApplicationCommandDataResolvable, CommandInteraction, CacheType, - MessageEmbed, + EmbedBuilder, Permissions, GuildChannel, GuildChannelResolvable, @@ -38,7 +38,7 @@ export class Config implements SlashCommand { requiredPermissions: bigint[] = [Permissions.FLAGS.SEND_MESSAGES]; async run(bot: Bot, interaction: CommandInteraction): Promise { try { - let embed = new MessageEmbed() + let embed = new EmbedBuilder() .setTitle(`:gear: Server Settings for ${interaction.guild?.name}`) .setColor(colorCheck(interaction.guild!.id)); let lines: any[][] = [ diff --git a/src/slashcommands/DefaultVc.ts b/src/slashcommands/DefaultVc.ts index 9fb206a..a0fab2d 100644 --- a/src/slashcommands/DefaultVc.ts +++ b/src/slashcommands/DefaultVc.ts @@ -6,7 +6,7 @@ import { VoiceChannel, GuildMember, TextChannel, - MessageEmbed, + EmbedBuilder, Guild, } from 'discord.js'; import { ApplicationCommandOptionTypes } from 'discord.js/typings/enums'; @@ -64,7 +64,7 @@ export class DefaultVc implements SlashCommand { return; } defaultVc.set(interaction.guild!.id, channel.id); - let embed = new MessageEmbed() + let embed = new EmbedBuilder() .setColor(colorCheck(interaction.guild!.id)) .setDescription( `Sucessfully updated your default voice channel to ${channel}` diff --git a/src/slashcommands/Gavin.ts b/src/slashcommands/Gavin.ts index bb96db6..2ee08bd 100644 --- a/src/slashcommands/Gavin.ts +++ b/src/slashcommands/Gavin.ts @@ -6,7 +6,7 @@ import { ChatInputApplicationCommandData, CommandInteraction, Permissions, - MessageEmbed, + EmbedBuilder, Options, } from 'discord.js'; import { ApplicationCommandOptionTypes } from 'discord.js/typings/enums'; @@ -79,7 +79,7 @@ export class Gavin implements SlashCommand { let bench = gav_records.ensure('bench', 365); let squat = gav_records.ensure('squat', 445); let deadlift = gav_records.ensure('deadlift', 605); - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(colorCheck(interaction.guild!.id)) .setDescription( `GAVIN'S CURRENT PRS:\n BENCH: ${bench} LB \n SQUAT: ${squat} LB \n DEADLIFT: ${deadlift} LB \n` @@ -100,7 +100,7 @@ export class Gavin implements SlashCommand { interaction.reply('INVALID LOOKUP'); return; } - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(colorCheck(interaction.guild!.id)) .setDescription(`GAVIN'S ${type!.toUpperCase()} PR: ${toprint}`); interaction.reply({ embeds: [embed] }); @@ -114,7 +114,7 @@ export class Gavin implements SlashCommand { if (type == 'squat') gav_records.set('squat', lift); if (type == 'deadlift') gav_records.set('deadlift', lift); - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(colorCheck(interaction.guild!.id)) .setDescription( `UPDATED GAVIN'S ${type!.toUpperCase()} PR TO: ${lift}\nGOOD JOB SOLDIER` diff --git a/src/slashcommands/Github.ts b/src/slashcommands/Github.ts index e010f25..fc6e747 100644 --- a/src/slashcommands/Github.ts +++ b/src/slashcommands/Github.ts @@ -2,7 +2,7 @@ import { ChatInputApplicationCommandData, CommandInteraction, CacheType, - MessageEmbed, + EmbedBuilder, } from 'discord.js'; import { Bot } from '../Bot'; import { SlashCommand } from './SlashCommand'; @@ -17,7 +17,7 @@ export class Github implements SlashCommand { interaction: CommandInteraction ): Promise { try { - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor('#FFFFFF') .setTitle(':lock: __Mirror-TS Codebase and Privacy__') .setDescription( diff --git a/src/slashcommands/Help.ts b/src/slashcommands/Help.ts index 057561b..5fa6031 100644 --- a/src/slashcommands/Help.ts +++ b/src/slashcommands/Help.ts @@ -5,7 +5,7 @@ import { CommandInteraction, CommandOptionChannelResolvableType, Message, - MessageEmbed, + EmbedBuilder, MessageReaction, Permissions, User, @@ -31,7 +31,7 @@ export class Help implements SlashCommand { bot.slashCommands.forEach((command)=>{ cmds[command.name] = command.description; }) - const page1 = new MessageEmbed() + const page1 = new EmbedBuilder() .setColor(colorCheck(interaction.guild!.id)) .setTitle(':mirror: **__Mirror__**') .setDescription('Informational and fun discord bot created by Ford, Zac, and Marty') @@ -53,7 +53,7 @@ export class Help implements SlashCommand { } ) .setFooter({ text: 'Page 1 of 5' }); - const page2 = new MessageEmbed() + const page2 = new EmbedBuilder() .setColor(colorCheck(interaction.guild!.id)) .setTitle(':sound: **__Voice Commands__**') .setDescription( @@ -82,7 +82,7 @@ export class Help implements SlashCommand { inline:false }) .setFooter({ text: 'Page 2 of 5' }); - const page3 = new MessageEmbed() + const page3 = new EmbedBuilder() .setColor(colorCheck(interaction.guild!.id)) .addFields({ name: 'Informative Commands', @@ -102,7 +102,7 @@ export class Help implements SlashCommand { `\`/roll\` ${cmds.roll}\n` }) .setFooter({ text: 'Page 3 of 5' }); - const page4 = new MessageEmbed() + const page4 = new EmbedBuilder() .setColor(colorCheck(interaction.guild!.id)) .setTitle(':bell: **__Server Configuration__**') .setDescription( @@ -119,7 +119,7 @@ export class Help implements SlashCommand { `\`/removeintro\` ${cmds.removeintro}\n` ) .setFooter({ text: 'Page 4 of 5' }); - const page5 = new MessageEmbed() + const page5 = new EmbedBuilder() .setColor(colorCheck(interaction.guild!.id)) .setTitle(':bell: **__Other Information__**') .addFields({ diff --git a/src/slashcommands/Invite.ts b/src/slashcommands/Invite.ts index bc80ee7..6ffae46 100644 --- a/src/slashcommands/Invite.ts +++ b/src/slashcommands/Invite.ts @@ -2,7 +2,7 @@ import { CacheType, ChatInputApplicationCommandData, CommandInteraction, - MessageEmbed, + EmbedBuilder, Permissions, } from 'discord.js'; import { Bot } from '../Bot'; @@ -22,7 +22,7 @@ export class Invite implements SlashCommand { interaction: CommandInteraction ): Promise { try { - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setDescription( 'Want to invite Mirror to your own server? Click [here](https://discord.com/api/oauth2/authorize?client_id=887766414923022377&permissions=139606649936&scope=bot%20applications.commands).' ) diff --git a/src/slashcommands/Kanye.ts b/src/slashcommands/Kanye.ts index c45b747..855de8a 100644 --- a/src/slashcommands/Kanye.ts +++ b/src/slashcommands/Kanye.ts @@ -4,7 +4,7 @@ import { CacheType, ChatInputApplicationCommandData, CommandInteraction, - MessageEmbed, + EmbedBuilder, Permissions, } from 'discord.js'; import fetch from 'node-fetch'; @@ -27,7 +27,7 @@ export class Kanye implements SlashCommand { try { let res = await fetch(`https://api.kanye.rest/`); let jsonData = await res.json(); - const embed = new MessageEmbed() + const embed = new EmbedBuilder() .setColor(colorCheck(interaction.guild!.id)) .setDescription(`**${jsonData.quote}**`) .setFooter({ diff --git a/src/slashcommands/Kawaii.ts b/src/slashcommands/Kawaii.ts index e0c41e1..3e17cb2 100644 --- a/src/slashcommands/Kawaii.ts +++ b/src/slashcommands/Kawaii.ts @@ -4,7 +4,7 @@ import { CacheType, ChatInputApplicationCommandData, CommandInteraction, - MessageEmbed, + EmbedBuilder, Permissions, } from 'discord.js'; import fetch from 'node-fetch'; @@ -29,7 +29,7 @@ export class Kawaii implements SlashCommand { //fetches the nekos.best api let res = await fetch(`https://nekos.best/api/v2/wink`); let jsonData = await res.json(); - let embed = new MessageEmbed().setColor(colorCheck(interaction.guild!.id)).setImage(jsonData.results[0].url); + let embed = new EmbedBuilder().setColor(colorCheck(interaction.guild!.id)).setImage(jsonData.results[0].url); interaction.reply({ embeds: [embed] }); } catch (err) { bot.logger.commandError(interaction.channel!.id, this.name, err); diff --git a/src/slashcommands/Loop.ts b/src/slashcommands/Loop.ts index 385480d..51ebc02 100644 --- a/src/slashcommands/Loop.ts +++ b/src/slashcommands/Loop.ts @@ -1,5 +1,5 @@ import { QueueRepeatMode, Track } from "discord-player"; -import { CommandInteraction, CacheType, MessageEmbed } from "discord.js"; +import { CommandInteraction, CacheType, EmbedBuilder } from "discord.js"; import { Bot } from "../Bot"; import { colorCheck } from "../resources/embedColorCheck"; import { Option, Subcommand } from "./Option"; @@ -12,7 +12,7 @@ export class Loop implements SlashCommand{ requiredPermissions: bigint[] = []; run(bot: Bot, interaction: CommandInteraction): Promise { try { - const embed = new MessageEmbed().setColor(colorCheck(interaction.guild!.id)); + const embed = new EmbedBuilder().setColor(colorCheck(interaction.guild!.id)); let queue = bot.player.getQueue(interaction.guild!.id); if(!queue || !queue.playing) { diff --git a/src/slashcommands/Nasa.ts b/src/slashcommands/Nasa.ts index dd9c772..d603403 100644 --- a/src/slashcommands/Nasa.ts +++ b/src/slashcommands/Nasa.ts @@ -4,7 +4,7 @@ import { CacheType, ChatInputApplicationCommandData, CommandInteraction, - MessageEmbed, + EmbedBuilder, Permissions, } from 'discord.js'; import fetch from 'node-fetch'; @@ -34,7 +34,7 @@ export class Nasa implements SlashCommand { let jsonData = await res.json(); let footer = `${jsonData.date} NASA Astronomy Picture of the day`; //we need this for the deprecation error we are getting with .setFooter() bot.logger.debug(jsonData); // <- remove eventually; - var embed = new MessageEmbed() + var embed = new EmbedBuilder() .setColor(colorCheck(interaction.guild!.id)) .setDescription(`${jsonData.explanation.substr(0, 200)}...`) .setFooter({ text: footer }) diff --git a/src/slashcommands/NowPlaying.ts b/src/slashcommands/NowPlaying.ts index bc5d8d7..be9979b 100644 --- a/src/slashcommands/NowPlaying.ts +++ b/src/slashcommands/NowPlaying.ts @@ -2,7 +2,7 @@ import { ApplicationCommandDataResolvable, CommandInteraction, CacheType, - MessageEmbed, + EmbedBuilder, GuildMember, } from 'discord.js'; import { Bot } from '../Bot'; @@ -16,7 +16,7 @@ export class NowPlaying implements SlashCommand { requiredPermissions: bigint[] = []; run(bot: Bot, interaction: CommandInteraction): Promise { try { - const embed = new MessageEmbed().setColor(colorCheck(interaction.guild!.id,true)); + const embed = new EmbedBuilder().setColor(colorCheck(interaction.guild!.id,true)); let queue = bot.player.getQueue(interaction.guild!.id); if (!queue || !queue.playing) { diff --git a/src/slashcommands/Nsfw.ts b/src/slashcommands/Nsfw.ts index 13280cd..de28733 100644 --- a/src/slashcommands/Nsfw.ts +++ b/src/slashcommands/Nsfw.ts @@ -4,7 +4,7 @@ import { CacheType, ChatInputApplicationCommandData, Permissions, - MessageEmbed, + EmbedBuilder, GuildMember, GuildChannel, TextChannel, @@ -62,7 +62,7 @@ export class Nsfw implements SlashCommand { return; } var setting = nsfw.ensure(interaction.guild!.id, 'off'); - const embed = new MessageEmbed(); + const embed = new EmbedBuilder(); if (interaction.options.getString('toggle') == 'on') { nsfw.set(interaction.guild!.id, 'on'); embed.setDescription('NSFW has been toggled `ON`'); diff --git a/src/slashcommands/Nut.ts b/src/slashcommands/Nut.ts index 8724ad4..52264c0 100644 --- a/src/slashcommands/Nut.ts +++ b/src/slashcommands/Nut.ts @@ -1,4 +1,4 @@ -import { CommandInteraction, CacheType, MessageEmbed, User } from 'discord.js'; +import { CommandInteraction, CacheType, EmbedBuilder, User } from 'discord.js'; import { ApplicationCommandOptionTypes } from 'discord.js/typings/enums'; import Enmap from 'enmap'; import { Bot } from '../Bot'; @@ -51,7 +51,7 @@ export class Nut implements SlashCommand { requiredPermissions: bigint[] = []; async run(bot: Bot, interaction: CommandInteraction): Promise { try { - const embed = new MessageEmbed().setColor('#FDA50F'); + const embed = new EmbedBuilder().setColor('#FDA50F'); if ( Math.random() == 0.69 || Math.random() == 0.42 || diff --git a/src/slashcommands/Option.ts b/src/slashcommands/Option.ts index d392841..bddf448 100644 --- a/src/slashcommands/Option.ts +++ b/src/slashcommands/Option.ts @@ -1,4 +1,4 @@ -import { ApplicationCommandOptionTypes } from 'discord.js/typings/enums'; +import { ApplicationCommandOptionType } from 'discord.js'; type Choices = { name: string; @@ -65,7 +65,7 @@ export class Subcommand { _name: string; _description: string; _options: Array