Skip to content

Commit

Permalink
[Update] welcome command now also accepts id as channel identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
naseif committed Nov 18, 2021
1 parent 1733e70 commit 4fc315f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions commands/Config/welcomechannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
name: "welcome",
description: "Sets a custom welcome channel instead of the default channel!",
args: true,
usage: `welcome add <channel name || channel mention> || welcome remove <channel name || channel mention>`,
usage: `welcome add <channel name || channel mention || channel id> || welcome remove <channel name || channel mention || channel id>`,
async run(message, args, client, defaultPrefix) {
if (
!message.member.permissions.has("MANAGE_GUILD") ||
Expand Down Expand Up @@ -66,7 +66,9 @@ module.exports = {

const newCustomChannel =
getTextChannelFromMention(args[1]) ||
message.guild.channels.cache.find((channel) => channel.name === args[1]);
message.guild.channels.cache.find(
(channel) => channel.name === args[1] || channel.id === args[1]
);

if (!newCustomChannel)
return await message.channel.send({
Expand Down

0 comments on commit 4fc315f

Please sign in to comment.