Trying to read channels name after it's deleting
How can i fix this error:
{ name: "Kanaal:", value:
> ${interaction.channel.name}
},
^
TypeError: Cannot read properties of null (reading 'name')
The code related to this command:
https://pastebin.com/rE69zw3SPastebin
var ticketLoggingChannel = interaction.member.guild.channels.c...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
5 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OPinteraction.channel
is null
show intentsconst { SlashCommandBuilder, ActionRow, ActionRowBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder, ChannelType, PermissionFlagsBits } = require("discord.js");
const { createTranscript } = require("discord-html-transcripts");
in the file self
const { Client, GatewayIntentBits, Collection, Partials } = require(
discord.js
);
const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessageReactions],
partials: [Partials.Reaction, Partials.Message, Partials.Channel]
});
in the index>Partials.Channel
?