diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index 1eb423ae..85bdab05 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -1,12 +1,24 @@ -import { Message } from "discord.js"; +import { EmbedBuilder, Message } from "discord.js"; import { blacklistCache } from "../database/db"; import DTelClient from "../internals/client"; +import config from "../config/config"; export default async(client: DTelClient, message: Message): Promise => { if (message.author.id === client.user!.id || blacklistCache.get(message.author.id)) return; // Don't cause loopback & ignore blacklist const call = client.calls.find(c => c.to.channelID === message.channel.id || c.from.channelID === message.channel.id); - if (!call) return; // We don't need to handle messages we have nothing to do with + if (!call) { + if (message.content.startsWith(">ping") || message.content.startsWith(">call") || message.content.startsWith(">dial") || message.content.startsWith(">rdial")) { + const embed = new EmbedBuilder() + .setColor(config.colors.info) + .setTitle("DTel has moved to Slash Commands!") + .setDescription(`Type \`/\` in the chat to view the available commands. If you need help, please join our [support server](${config.guildInvite})!`); + message.reply({ + embeds: [embed], + }); + } + return; + } // We don't need to handle messages we have nothing to do with call.messageCreate(message); }; diff --git a/src/internals/callClient.ts b/src/internals/callClient.ts index c7418c01..08896c68 100644 --- a/src/internals/callClient.ts +++ b/src/internals/callClient.ts @@ -519,7 +519,7 @@ export default class CallClient implements CallsWithNumbers { } async messageCreate(message: Message): Promise { - if (!this.pickedUp?.by) return; + if (!this.pickedUp?.by || message.content.startsWith(">")) return; const sideToSendTo = this.getOtherSideByChannel(message.channel.id)!; const toSend = await this.processContent(message, sideToSendTo);