Discord.js - Code not working

Joined
Mar 7, 2021
Messages
13
Reaction score
0
Hello there!
I have my discord code under that is supposed to create a new channel but, it does nothing and the console isn't reporting errors...
Look at it :


if (message.content.toLowerCase().startsWith(!tournoi-fn) == '!tournoi-fn') {
let channelName = args.slice(1).join(' ');
message.channel.send('Channel created as :', channelName);
message.guild.createChannel(channelName, 'text', {

permissionOverwrites: [{
id: message.guild.roles.cache.find( r => r.id('855045656409276446')),
allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],

id: message.guild.roles.cache.find( r => r.id('848565653463629894')),
deny: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
}]
})
.then(console.log)
.catch(console.error);


Tell me if you know why,
Thanks!
 
Joined
Nov 13, 2020
Messages
302
Reaction score
38
This line:
if (message.content.toLowerCase().startsWith(!tournoi-fn) == '!tournoi-fn') {
1.) Makes no sense to me.
2.) Has no closing bracket.
3.) .startsWith( NEEDS TO BE A STRING ).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top