Code a Discord Bot with JavaScript – Host for Free in the Cloud
E conheça também sobre o Melhor Bot Para Opções Binárias 2022
Que tal um robo gratuito para IQ Option? Sistema Para IQ Option Grátis
Learn how to code a Discord bot using JavaScript / Node.js and host it for free in the cloud using Repl.it. You will also learn to use Repl.it’s built-in database.
🚨 At 13:44, Replit now has a new method for environment variables. Read what to do here:
🔗 Get 3 months FREE of the Hacker Plan on Repl.it (first 1000 people):
This course was developed by Beau Carnes.
🎥 Code a Discord Bot with Python Video:
💻 Full code on repl.it:
🔗 Online code editor:
🔗 Discord Home Page:
🔗 Discord Developer Portal:
🔗 Discord.js library:
Need help with this tutorial? You can ask questions here:
⭐️ Course Contents ⭐️
⌨️ (00:00) Introduction
⌨️ (01:38) Creating a Discord Server
⌨️ (02:27) Creating a Bot User
⌨️ (06:23) Starting a Project in Repl.it
⌨️ (08:37) Coding a Basic Discord Bot
⌨️ (15:44) Improving the Bot
⌨️ (26:35) Using the Repl.it Database to Store Bot Settings
⌨️ (46:08) Testing the Bot
⌨️ (50:22) Creating a Web Server for the Bot
⌨️ (55:06) Connecting Uptime Robot So Bot Runs Continuously
Special thanks to Repl.it for providing a grant that made this course possible.
—
Learn to code for free and get a developer job:
Read hundreds of articles on programming:
Vídeo
At 13:44, Replit has a new method for .env. Read what to do here: https://docs.replit.com/programming-ide/storing-sensitive-information-environment-variables
Also, with Discord.js v13 there is more setup required. This quick video shows the new method: https://youtu.be/zGy2muWlE5A
Didnt work. The bot will start and be online, but it wont respond or do anything. (This is after having to add intents that werent mentioned in the tutorial) without these the bot wouldnt even start.
My bot is online but doesn't reply 🤔
TypeError [ClientMissingIntents]: Valid intents must be provided for the Client.
at Client._validateOptions (/home/runner/DiscordBot/node_modules/discord.js/src/client/Client.js:480:13)
at new Client (/home/runner/DiscordBot/node_modules/discord.js/src/client/Client.js:78:10)
at Object.<anonymous> (/home/runner/DiscordBot/index.js:2:16)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at 15:00, I am running the code but it is giving me the following error
TypeError [ClientMissingIntents]: Valid intents must be provided for the Client.
at Client._validateOptions (/home/runner/A-Bot/node_modules/discord.js/src/client/Client.js:480:13)
at new Client (/home/runner/A-Bot/node_modules/discord.js/src/client/Client.js:78:10)
at Object.<anonymous> (/home/runner/A-Bot/index.js:2:16)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
please anyone help :/
This did not work for me
"TypeError [ClientMissingIntents]: Valid intents must be provided for the Client."
Seen this error? of course you have
As of discord.js v14 you need to add intents into the client function
what i mean is, instead of just putting
const client = Discord.Client();
you need to put some parameters into the Client() function, which are the intents that we're talking about
const client = new Discord.Client({ intents: ["Guilds", "GuildMessages"]});
Look at all those intents
they should fix the issue
(note: you may need to add more intents for more features)
not my comment, will edit the comment to credit the original person
also can yall bring this to the top of the comment section tyy
repost
You deserve an extra dislike, terrible!
i keep getting the unexpected token '&&'. please help.
Do any of you know what the intent statement would be for line 2 of the code
Why does the message even show up now (the console says that the message evet blablabla ) please someone help me
My bot died after 3 hours how i fix it? Help
İ want to code on discord but i dont know JavaScript do i have to know?
Why is my bot only responding in DM and not in the channel?
I am doing a livestream on this tomorrow 😀 Awesome info!
Why it's saying "ClientMissingIntents"?
9:57
I'm glad this channel exists.
Doesnt work please help: TypeError [ClientMissingIntents]: Valid intents must be provided for the Client.
at Client._validateOptions (/home/runner/JobBot-1/node_modules/discord.js/src/client/Client.js:480:13)
at new Client (/home/runner/JobBot-1/node_modules/discord.js/src/client/Client.js:78:10)
at Object.<anonymous> (/home/runner/JobBot-1/index.js:2:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
Hint: hit control+c anytime to enter REPL.
(node:1005) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use `node –trace-warnings …` to show where the warning was created)
Do someone know where i can find a discord bot for notice from some website? like csgo skin website so i can put that bot on it when people deposite their sskin there?? plz help
this is not working either! I did everything the same and I can't even get past 6:30 minutes or whatever when the first run comes. it gives me a text of errors.
BRUH IT DOESNT WORK
well played
lol
way out dated
It worked fine but suddenly stopped with no error message. Doesn’t connect when I press run
For anyone that is stuck on creating web server: Paste the code below
const http = require("http");
http.createServer((_, res) => res.end("Alive")).listen(8080)
Add the code WITHIN the bot code, not a diff file.
guys if any one have to run this in your local ide like vs code it need to be done likethis step 1 code step 2 install node step 3 run in your terminal for windows its power shell for linux its bash for other thing your installed in mac idk! step 3 go to that folder where it is saved search for your os online then type node xyz.js
im getting this error,
TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
at Client._validateOptions (/home/runner/funymaster2009/node_modules/discord.js/src/client/Client.js:548:13)
at new Client (/home/runner/funymaster2009/node_modules/discord.js/src/client/Client.js:76:10)
at Object.<anonymous> (/home/runner/funymaster2009/index.js:2:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
any help?
sadly it wont let me make a .env file =/
the first line of code doesnt work at all
niccce
it says "Python" at one point in the subtitles instead of Javascript
When I follow the instructions about require() method, I got the error returned "that the "require()" is no longer supported and i need to use "import()",but when I replce "require" with "import" nothing just happens. Please, help!!!
Database statements give errors. kindly help out
/home/runner/Encourage-discord-bot/node_modules/node-fetch/lib/index.js:1327
throw new TypeError('Only absolute URLs are supported');
^
TypeError: Only absolute URLs are supported
at getNodeRequestOptions (/home/runner/Encourage-discord-bot/node_modules/node-fetch/lib/index.js:1327:9)
at /home/runner/Encourage-discord-bot/node_modules/node-fetch/lib/index.js:1440:19
at new Promise (<anonymous>)
at fetch (/home/runner/Encourage-discord-bot/node_modules/node-fetch/lib/index.js:1437:9)
at Client.get (/home/runner/Encourage-discord-bot/node_modules/@replit/database/index.js:20:18)
at Object.<anonymous> (/home/runner/Encourage-discord-bot/index.js:25:4)
})
Just make a new update video