Deepwatch

Keyboard shortcuts

Space or k
Play or pause
j and l
Back or forward 10 seconds
Left and right arrows
Back or forward 5 seconds
f
Fullscreen
m
Mute or unmute
Shift and < or >
Slower or faster
?
Show or hide this list

Discord Bots 6: Building a Command Handler

The Coding Train, 19 min, 56.3K views, Jan 15, 2021

Chapters

Show description

In this video I demonstrate how to manage multiple Discord bot commands with "a command handler" built with CommonJS and require() in node.js.šŸ’» https://thecodingtrain.com/learning/bots/discord/06-command-handler.html šŸŽ„ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6avBYxeBSwF48YhAnSn_sA4 Links discussed in this video: šŸ”— Discord.js Guide Command handling: https://discordjs.guide/command-handling/#command-handling šŸ”— Intro Discord Bot (Coding Garden GitHub): https://github.com/CodingGarden/intro-discord-bot šŸ”— import (Mozilla Docs): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import šŸ”— import (Node.js v13 Docs): https://nodejs.org/docs/latest-v13.x/api/esm.html#esm_import_statements šŸ”— Choo choo bot on Glitch: https://glitch.com/~choo-choo-bot-discord Other videos mentioned in this video: šŸŽ„ Coding Garden with CJ - Build a Discord bot: https://youtu.be/gzM7kj6gV5I Timestamps: 0:00 Welcome Back! 0:39 Explain! What's a command handler? 3:03 Code! Create commands.js using gotMessage() 5:36 Try! Let's see if it works 6:26 Code! JavaScript files for each command 7:59 Code! Let's see if the message a valid command 9:27 Code! Object for looking up commands 11:11 Try! Test to see if the system works 12:00 Code! Call choochoo command from choochoo.js 13:54 Try! Ahh let's see if this works 14:04 Code! Add the gif command 15:14 Try! Let's try running it 15:49 Recap! 17:00 Possible Improvements! 17:56 What's coming next? šŸš‚ Website: http://thecodingtrain.com/ šŸ‘¾ Share Your Creation! https://thecodingtrain.com/Guides/community-contribution-guide.html 🚩 Suggest Topics: https://github.com/CodingTrain/Rainbow-Topics šŸ’” GitHub: https://github.com/CodingTrain šŸ’¬ Discord: https://discord.gg/hPuGy2g šŸ’– Membership: http://youtube.com/thecodingtrain/join šŸ›’ Store: https://standard.tv/codingtrain šŸ“š Books: https://www.amazon.com/shop/thecodingtrain šŸ–‹ļø 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