Discord TTS bot
Hi there I am trying to create a discord bot where it would join a vc that I am in and when I use !t <Text> it wold join the vc I am in and would use a API to start talking and saying the text. (Yes I'm aware of discord TTS but wanted to do it as a learning experience). But when i start the bot and execute the command it doesn't work nor sends anything to the terminal that it has received anything please help thank you. Here's the code
24 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!its messageCreate
is this line of code? client.on("message", async (message) => {
yes
and that command check is pretty useless
because you already check the command, just to check it again
oh okay thanks
you will also need the
MessageContent
intent to receive the content of messagesso like this? client.on("messageCreate", async (message) => {
yes
Thanks Ill fix the other line
instead of message.content?
no
you need to add the intent in your client constructor
oh okay thanks
So the message is getting recived but not joining vc nor telling me that I have to be in a vc
show your updated code
and also, you'd need the GuildVoiseStates intent
Which you do so ignore that
when I try adding the kept on getting an error so I will add that later on
well
That intent is the key of this working
oh lol
-
Error [DisallowedIntents]: Privileged intent provided is not enabled or whitelisted.
- Error: Used disallowed intents
If you are using the GuildMembers
, GuildPresences
, or MessageContent
intents, you need to enable them via Developer Portal > Your app > Bot > Privileged Gateway Intentsheres the updated code but still isn't joining vc though when I use the command
and what is logging
also dont stringify your errors like that
It'll make them useless
it just logging
Message received: !t test
okay thankswell,
!t test
is not equal to !t
your code expects it to beso now this is the new error heres the code
and I appreciate the help
That'd be because that isn't a function
Whoops wrong introduction
https://discordjs.guide/voice/