Command Handler
Discord Bot Lesson #6
In this video I demonstrate how to manage multiple Discord bot commands with “a command handler” built with CommonJS and require() in node.js.
Topics
- 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?
Community Contributions
It seems like there haven't been made any variations based on this lesson by the community yet. Be the first and add your own! If you don't know how, take a look at this guide.
Links discussed in this lesson
Videos discussed in this lesson
- Building a Discord bot with Daniel Shiffman of the Coding Train by Coding Garden