Skip to content

Commit

Permalink
register: Ignore non-existent channels
Browse files Browse the repository at this point in the history
  • Loading branch information
obiwac committed Jan 9, 2023
1 parent fce9dd6 commit 09ee375
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/commands/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ async function join_channels(interaction, channels) {
for (const [ i, ent ] of channels.entries()) {
const channel = interaction.guild.channels.cache.get(ent.value)

if (!channel) {
continue
}

channel.permissionOverwrites.create(interaction.user, { SEND_MESSAGES: true, VIEW_CHANNEL: true })
str += `${channel}` // interpolate to call .toString on GuildChannel instance

Expand Down

0 comments on commit 09ee375

Please sign in to comment.