#ot | JS and discord.js
1 messages · Page 1 of 1 (latest)
logged back onto a project of mine
and the bot isn't even working now
all i get is this
as in like the package?
sorry if thats the wrong thing tho
i'm not the best at this kinda stuff
where do i run the command btw?, but ty for the help
searched around a bit and i think the platform i'm using is outdated
in a terminal
think i might have to switch to replit
yeah discord is now in v14
ah yea
but.. if you upgrade from v12 to v14 you will have some bits of code to rewrite completely
ran the command and it's just giving me alot of errors and checkPERMS statements
yea i'll probably have to switch
thanks for your help tho
welcome to the great world of javascript, everything gets deprecated too freaking fast
đ
Let's go learn again everything đ„Č
classic
doesn't work
same
same
do dir and show what's in that folder
also Bot panda.. that looks strangely like a thing i wrote on my white board
x)
ok, is there scripts in the package.json file
that's not a script, that's a dependency
you don't have npm scripts in that, so it doesn't know what to do
try npm start?
do just npm run?
hmm i think you need to specify your main file
"main": "index.js",
inside your package.json
of course
@supple shuttle đ„Č
it's odd that your package.json has just that
@supple shuttle If we pay attention. Mu discord JS is V.13.8 but we now are on the version 14
Maybe it's the pb
Hey, here is my code and my error:
const { Client, Intents, DiscordAPIError, MessageEmbed, Permissions } = require('discord.js');
const { token } = require('./config.json');
const colors = require('./couleurs.json');
const config = require('./config.json');
const { memberNicknameMention } = require('@discordjs/builders');
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_MESSAGES] });
client.login(token)
client.once('ready', async() =>{
console.log(`Logged in as ${client.user.tag} ==> âïž`);
// Statut
client.user.setActivity(config.activity)
})
client.on('messageCreate', async(message) => {
let recruitEmbed = new MessageEmbed()
.setColor(colors.rougeFoncé)
.setTitle('Recrutement Hieros Lokhos')
.setURL('https://forms.gle/Ru4XWKGGCyBroDet9')
.setDescription('Conditions de recrtutement de la Hieros Lokhos')
.setAuthor({name:'đžđđđ#9999', inconURL:'https://cdn.discordapp.com/avatars/275676354408611840/a_b37ae188ed5a59b6343ac0608e6091ad.gif?size=4096'})
.addFields(
{ name:'Ce que nous recherchons :', value:'ă
€', inline:false },
{ name: 'ă
€', value:'- 3 joueurs/joueuses' },
{ name: 'ă
€', value:'- Un coach qui n\'entraine pas de hauts elos' },
{ name:'Les critĂšres :', value:'ă
€', inline:false },
{ name: 'ă
€', value:'- Avoir 16ans', inline:false },
{ name: 'ă
€', value:'- Ătre sur PC', inline:false },
{ name: 'ă
€', value:'- Ătre mature, respectueux/respectueuse, comprĂ©hensif/comprĂ©hensive et savoir se dĂ©tendre', inline:false },
{ name: 'ă
€', value:'- Ătre actif en moyenne au moins 3 jour par semaine', inline:false },
{ name:'Nos projets :', value:'ă
€', inline:false },
{ name: 'ă
€', value:'- Passer de bons moments ensemble tout en progressant', inline:false },
{ name: 'ă
€', value:'- Faire des tournois Ă petite Ă©chelle Ă court terme et peut-ĂȘtre des tournois officiels Ă long terme' }
)
.addField({ name:'Candidater', value:'Intéressé.e ? Pour candidater il te suffit de cliquer sur "Recrutement Hieros Lokhos" afin de remplir le formulaire !', inline:false })
.setFooter({text:'DĂ©veloppĂ© par đžđđđ#9999', inconURL:'https://cdn.discordapp.com/avatars/275676354408611840/a_b37ae188ed5a59b6343ac0608e6091ad.gif?size=4096'})
if(message.content == 'formule magique (:') {
message.channel.send({ embeds: [recruitEmbed] });
} else {
return
}
});
RangeError [EMBED_FIELD_NAME]: MessageEmbed field names must be non-empty strings.
at Function.verifyString (C:\JavaScript\BOT HL\node_modules\discord.js\src\util\Util.js:427:41)
at Function.normalizeField (C:\JavaScript\BOT HL\node_modules\discord.js\src\structures\MessageEmbed.js:543:18)
at C:\JavaScript\BOT HL\node_modules\discord.js\src\structures\MessageEmbed.js:565:14
at Array.map (<anonymous>)
at Function.normalizeFields (C:\JavaScript\BOT HL\node_modules\discord.js\src\structures\MessageEmbed.js:564:8)
at MessageEmbed.addFields (C:\JavaScript\BOT HL\node_modules\discord.js\src\structures\MessageEmbed.js:328:42)
at MessageEmbed.addField (C:\JavaScript\BOT HL\node_modules\discord.js\src\structures\MessageEmbed.js:319:17)
at Client.<anonymous> (C:\JavaScript\BOT HL\index.js:36:10)
at Client.emit (node:events:390:28)
at MessageCreateAction.handle (C:\JavaScript\BOT HL\node_modules\discord.js\src\client\actions\MessageCreate.js:26:14) {
[Symbol(code)]: 'EMBED_FIELD_NAME'
}
ill check out when im back at my desk
{ name: 'ă
€', value:'- 3 joueurs/joueuses' },
name is an empty string (it's spaces, probably interpreted as empty)
i think you outta put all the lines in a field in the value
for instance
{ name:'Ce que nous recherchons :', value:'- 3 joueurs/joueuses<br>- Un coach qui n\'entraine pas de hauts elos', inline:false },
not sure for what character to use for line breaks, might be \n
@supple shuttle this was invisible caracteres
But someone gave me the solution
In addField
I did like in addFields
But this isn't the same
oh
I don't need {} and name: or value:
alright
oh discord.js
im not sure about the ques above, but i have a really basic one
im just starting out so
ask ahead
after the person sends the command, how do you make the bot ping them along with the command?
like "here you go (user)!"
you want a ping or a reply?
a ping in the reply itself, indicating who it was meant for
in your message listener you'll get the id of the user who sent the command
with this you can use the client of the bot to send a message in a specific channel with a ping of the user, iirc it's <@id>
message.reply()
If you need help with discord js ask me
I know a bit
I'm learning
But I know some little things
i'll try and implement this one for another command tho
ot | JS and discord.js
