I made a Discord Bot that says Choo Choo

Subscribers:
1,740,000
Published on ● Video Link: https://www.youtube.com/watch?v=AvQcTjB3gPg



Duration: 33:14
29,944 views
1,175


Learn to create a Discord bot using Discord.js in Node.js. This video walks through setting up a node project, creating a Discord application, and writing code for authentication, slash commands, and bot interaction. Code: https://thecodingtrain.com/tracks/discord-bots/discord/coding-a-bot

πŸš€ Watch this video ad-free on Nebula https://nebula.tv/videos/codingtrain-how-to-make-a-discord-bot-in-javascript

πŸ’» Code Example: https://github.com/CodingTrain/Discord-Bot-Examples/tree/main/01-discordjs

πŸŽ₯ Previous: https://youtu.be/wM3TEvQn2hw

References:
πŸ€– Discord Developer Portal: https://discord.com/developers/applications
πŸ“ƒ Discord API Documentation: https://discord.com/developers/docs/reference
🎨 Discord.js: https://discord.js.org/
πŸ“„ Discord.js Guide: https://discordjs.guide/
πŸ’Ύ Discord Gateway Intents: https://github.com/CodingTrain/Discord-Bot-Examples/wiki/Discord-GatewayIntents-explained/

Videos:
πŸš‚ Hiding API keys with .env: https://youtu.be/17UVejOw3zA
πŸš‚ async/await: https://youtu.be/XO77Fib9tSI

Timestamps:
0:00 Introduction
3:39 Setting up the Node.js project
5:50 Creating the Discord application
6:24 Inviting your Discord bot
10:11 Enabling developer mode on Discord
10:33 Setting up the .env file
12:47 Code! Getting the bot to log into Discord
18:16 Creating a slash command
24:00 Deploying the slash command
25:53 Listening for the command interaction and executing the command
30:08 How Discord bots communicate with Discord
32:00 Discord.JS documentation

Corrections:
15:45 Intents describe what events your bot will receive and what it has access to. The guilds intent is required so discord.js can internally populate it's cache to limit it's API calls to Discord.
23:49 Using ./ means the import will be relative to the file that the import is made in. Without it the import would be absolute meaning it would be from the root of your Node.JS project

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

πŸš‚ Website: https://thecodingtrain.com/
πŸ‘Ύ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
🚩 Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
πŸ’‘ GitHub: https://github.com/CodingTrain
πŸ’¬ Discord: https://thecodingtrain.com/discord
πŸ’– Membership: http://youtube.com/thecodingtrain/join
πŸ›’ Store: https://standard.tv/codingtrain
πŸ–‹οΈ Twitter: https://twitter.com/thecodingtrain
πŸ“Έ Instagram: https://www.instagram.com/the.coding.train/

πŸŽ₯ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

πŸ”— p5.js: https://p5js.org
πŸ”— p5.js Web Editor: https://editor.p5js.org/
πŸ”— Processing: https://processing.org

πŸ“„ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new

#discordbots #javascript #nodejs #discordjs