-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add slash command warning and ignore > chat prefix
- Loading branch information
1 parent
f5fd313
commit 190238a
Showing
2 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<void> => { | ||
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); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters