got error idk what’s wrong with my code
Here this what i meant
Solution:Jump to solution
As for solution to the original question:
Discordjs changed the intent variable case. Either use
GatewayIntentBit
enum or specify intents in UpperCamelCase...57 Replies
Sorry for bad quality
At the bottom there is
Problems
section, which you can use for potential fixes.
That will also tell more information for us to debugwhat exactly does the error say?
The intents and partials
Send a screenshot of that
would you mind copy pasting that error here
much better suggestion
They are the simliar thing like the tutorial I’m watching
that’s my code wait!
1) we dont know if the tutorial is running the latest versions
so please copy paste your error stack
Tag suggestion for @Yukibonnia
When asking for help, make sure to provide as much detail as possible. What have you tried so far? Do you have stack traces that you can show us? What are you trying to achieve? Try to answer these questions and others, so we do not have to ask for them afterwards.
❯ For a good guide on how to ask questions, see the instructions that StackOverflow gives. You should try to always follow these guidelines. ❯ For an excellent video that shows how not to ask technical questions, watch this YouTube video by LiveOverflow. ❯ Asking technical questions (Clarkson) ❯ How to ask questions the smart way (Raymond)
intents: [“GUILDS”, “GUILD_MESSAGES]” “DIRECT_MESSAGES”, “GUILD MEMBERS”]
that is not the error sir
also you are using apple's quotes instead of "
that may be problematic
Wait I’ll try take a screenshot shot
@Yukibonnia
here
use " " instead of apple's quotes
I’m use code space
wait….
Really?
yes
@MRDGH2821 also did djs rename intents to be smaller case?
But they are the "
Look at the picture!
But there’s stupid bug I see it
When I close it the errors gone wtf is this bug
@Yukibonnia
Wait
.
I don't know, but I have a better way:
https://github.com/MRDGH2821/Perpetual-Mechanical-Array-Bot/blob/8780e19eaea7fcb6c6dbf743b91afc72b4c116c6/src/index.ts#L32
GitHub
Perpetual-Mechanical-Array-Bot/src/index.ts at 8780e19eaea7fcb6c6db...
Discord Bot for Traveler Mains Server. Contribute to MRDGH2821/Perpetual-Mechanical-Array-Bot development by creating an account on GitHub.
i use the enum but idk about string
- Websocket intents limit events and decrease memory usage: learn more
- See what intents you need here
ignore this
This can help @Yukibonnia
Bruh
told you, replace GUILDS with Guilds; GUILD_MESSAGES with GuildMessages like that
your tutorial is outdated
That's it
You have your answer.
So is not can be caps?
and ffs remove the partials line
they changed it in latest djs, your tutorial is outdated
Yup if was 2 years ago lol
@Yukibonnia if you could copy paste your code to here, i could help you edit it quicker
i cannot edit a screenshot you know
Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:
- Read and understand docs
- Debug code
- Syntax
- NodeJS module system
If you aren't sure that your understanding of JavaScript is truly good enough to make a bot, you should try to continue learning first. Here are good resources to learn both Javascript and NodeJS:
- Codecademy: https://www.codecademy.com/learn/javascript
- Udemy: https://www.udemy.com/javascript-essentials/
- Eloquent JavaScript, free book: http://eloquentjavascript.net/
- You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
- JavaScript Garden: https://bonsaiden.github.io/JavaScript-Garden/
- JavaScript reference/docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
- Nodeschool: https://nodeschool.io/
- Pluralsight: https://www.codeschool.com/courses/real-time-web-with-node-js
Before you ask a question, you should ask these yourself:
1. Is this question related to JavaScript, or the library I am using?
- If it is the library you are using, go to the proper server. You would get better answers there.
2. Have I tried to google and/or check StackOverflow?
- Double-check that you can't find anywhere that can lead you to a solution online.
3. Have I tried to look on MDN or the library documentation?
- You should always check documentation to make sure you aren't missing any details.
4. Does my question make enough sense so that people can understand it, and do they understand what I am trying to accomplish?
- If no, revise your question. Give as much detail as possible. Include any error or code output that can help us help you.
5. Am I aware of what I am doing, and not just mindlessly copying and pasting?
- If you are just copying and pasting code from a guide, you are not going to be able to solve anything. Make sure you understand the code you are writing.
On a side note this is #discordjs-support question
Also @Yukibonnia instead of a video, start with this official djs guide:
https://discordjs.guide/#before-you-begin
Then add the features & stuff you wanted to.
And finally start with Sapphire framework
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
Is this better now? https://github.com/Bonniaas/MokaBot
GitHub
GitHub - Bonniaas/MokaBot: Bot by sapphire/framework
Bot by sapphire/framework. Contribute to Bonniaas/MokaBot development by creating an account on GitHub.
Is this your first time making a discord bot?
Nope
But is my first time try typescript
Im was use python before lol
Is this your first time making a discord bot using Javascript/typescript?
But they were stupid so i goes to try typescript
You can say i didn’t code anything like 6 months so much since I started like 8 months ago
So it didn’t go well with my stupid dead passion
Then I suggest you start with this.
This will build your understanding after which you can comfortably use Sapphire framework
Even I’m always gets like busy with anything instead of codes
Yeah but I’ll keep with typescript instead of JavaScript
No problem, Discordjs guide will point out wherever there is something typescript specific.
You will just need to deal with type system in Typescript, else Javascript knowledge can be used in Typescript & vice versa
Don’t worry
Trust me I’ll just Try first typescript only so won’t be any error lol
Solution
As for solution to the original question:
Discordjs changed the intent variable case. Either use
GatewayIntentBit
enum or specify intents in UpperCamelCaseJust only i need is just do some small things
So in future I’ll make bots
That larger
Im on iPad
For god’sake
Long press message, same options will come
you're doing a mistake
get adapted to javascript first and then move to typescript
And what’s this mistake?
typescript is complex for beginners
@Boomeravna mark as solution
Everyone can do that btw
Oh
Makes sense actually