Skip to content

Commit

Permalink
[Enhancement] nuke a text channel by id and mention. Both are possibl…
Browse files Browse the repository at this point in the history
…e now
  • Loading branch information
naseif committed Nov 4, 2021
1 parent 3d1e7e1 commit d868d3f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions commands/Admin/nuke.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { SlashCommandBuilder } = require("@discordjs/builders");
const { embedMessage } = require("../../modules/embedSimple");
const {
getTextChannelFromMention,
} = require("../../modules/getUserFromMention");

module.exports = {
name: "nuke",
Expand Down Expand Up @@ -41,10 +44,11 @@ module.exports = {
});
}
}

let textChannelID = await getTextChannelFromMention(args[0]);
console.log(textChannelID);
try {
const channel = message.guild.channels.cache.find(
(channel) => channel.id === args[0] || channel.name === args[0]
(channel) => channel.id === textChannelID
);

if (!channel) {
Expand Down

0 comments on commit d868d3f

Please sign in to comment.