Discord Bots 6: Building a Command Handler
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
Other Videos By The Coding Train
2021-02-13 | Coding Train Live: Self-Avoiding Walk and Discord bot |
2021-02-12 | 3.6 Graphing Sine Wave - Nature of Code |
2021-02-07 | 3.5 Simple Harmonic Motion - Nature of Code |
2021-02-06 | Coding Train Live! |
2021-02-06 | 3.4 Polar Coordinates - The Nature of Code |
2021-02-02 | 3.3: Angles and Vectors - Nature of Code |
2021-01-29 | 3.2 Angular Motion - Nature of Code |
2021-01-26 | 3.1 Angles and Rotation - Nature of Code |
2021-01-23 | Coding Train Live! |
2021-01-16 | 2021 Choo Choo! |
2021-01-15 | Discord Bots 6: Building a Command Handler |
2021-01-08 | 2021 Choo Choo! |
2020-12-23 | Processing Foundation Holiday Telethon 2020 |
2020-12-17 | Winter Show 2020 (ITP/IMA/IMA Low Res) |
2020-12-17 | Discord Bots 5: Posting GIFs |
2020-12-12 | Advent of Code (Side Project Saturday!) |
2020-12-09 | ml5.js: Classifying Drawings with DoodleNet |
2020-12-05 | Side Project Saturday! |
2020-12-03 | Coding Challenge #158: Shape Classifier Neural Network with ml5.js |
2020-12-02 | Discord Bots 4: Hiding API Keys with .env |
2020-11-29 | Side Project Sunday? |