bot answer

i wanna make when i ping my bot it answeer but its not
No description
24 Replies
d.js toolkit
d.js toolkit2mo ago
- 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 staff
treble/luna
treble/luna2mo ago
do you have the GuildMessages intent
! Milk
! MilkOP2mo ago
ywes
treble/luna
treble/luna2mo ago
and MessageContent
d.js docs
d.js docs2mo ago
:property: Message#mentions [email protected] All valid mentions that the message contains
treble/luna
treble/luna2mo ago
use that too
! Milk
! MilkOP2mo ago
yes
! Milk
! MilkOP2mo ago
No description
treble/luna
treble/luna2mo ago
start by using this and also log to see if your event fires at all
! Milk
! MilkOP2mo ago
no err on log aswell im using onMessageCreate event
treble/luna
treble/luna2mo ago
show your full code
! Milk
! MilkOP2mo ago
800 lines
treble/luna
treble/luna2mo ago
but still log to see if your event fires at all consider a proper command handler then
d.js docs
d.js docs2mo ago
If you aren't getting any errors, try to place console.log checkpoints throughout your code to find out where execution stops. - Once you do, log relevant values and if-conditions - More sophisticated debugging methods are breakpoints and runtime inspections: learn more
! Milk
! MilkOP2mo ago
i can send the cmd if (message.content === <@${client.user.id}>) { try { await message.reply({ content: Hi! My prefix is \/` or `+`. Use the `+help` command to explore my features!`, ephemeral: false, // Makes the message visible to everyone }); } catch (error) { console.error("Eror:", error); @treble/luna
treble/luna
treble/luna2mo ago
so you changed nothing you didnt ask ai did you
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
! Milk
! MilkOP2mo ago
bruh
treble/luna
treble/luna2mo ago
start by doing this debugging is basic js
! Milk
! MilkOP2mo ago
k
if (message.content.includes(`<@${client.user.id}>`)
if (message.content.includes(`<@${client.user.id}>`)
worked like that
Amgelo
Amgelo2mo ago
sounds like the message's content wasn't exactly only the bot's mention
treble/luna
treble/luna2mo ago
thats why i told you to use MessageMentions
! Milk
! MilkOP2mo ago
ok thx
! Milk
! MilkOP2mo ago
No description

Did you find this page helpful?