Part 4 of a series on making a user-programmable (users can create custom commands for it) Discord bot. In this series, I will walk through the steps of creating a Discord bot along with a custom language that can be interpreted by your bot, so that users of the bot will be able to program their own custom commands.
In this episode, I fix some issues and implement the environment and running the custom programming language. In part 3, I (tediously) coded the "semantics" part of the language for running the raw code. In this part, I implement the running of programs using the environment (which allows for temporary storage of variables, constants, external functions, etc. in the future). In part 5, I will be connecting the programming language to the Discord bot. After that, I will add type checking, safer numbers using BigIntegers, control flow (if/else, switch/case, etc.), native functions and function calls, and connecting the language to other Discord features.
Again, I haven't uploaded in a while, and again, don't expect consistent uploads. I recorded part 5 and I have the code for the other parts (but just not recorded), but I haven't edited or prepared episodes 5+. Hopefully they'll be released.... eventually.
Helpful Information on necessary programs (though you should watch the previous videos first):
This series will use Node.JS (programming language), NPM (package manager), Discord.JS (discord interface library), and Ohm (language parser/interpreter). You will also need a text editor (I will be using Atom) and some basic knowledge of the terminal/command line. If you don't have these programs or don't know how to install them yourself, I would check out these links:
https://nodejs.org/en/download/ (Node.JS)
https://www.npmjs.com/get-npm (NPM)
https://atom.io/ (Atom)
https://www.learnenough.com/command-l... (Command Line/Terminal Basics)
I go over these a bit more in the first episode, so if you are starting with a video in the middle of the series, you should at least watch the first video for information on our dependencies.
Other References:
https://lodash.com/docs/4.17.10 (Lodash documentation)
https://discord.js.org/#/ (Discord.JS)
https://github.com/harc/ohm (Ohm)
https://discordapp.com/ (Discord)
https://discordapp.com/developers/ (Discord Developers Dashboard)
I don’t want to beg for subscribers, but if you found the video useful, please share it with anyone who might be interested in it, and subscribe if you want to see more videos like this one. Also, feedback is appreciated - dislike if you hated it, like if you liked it, or leave a comment with suggestions and questions. Thanks for watching, and I’ll see you in the next video.
Disclaimer: Discord is its own company, product, and platform; I do not develop or maintain Discord, and I don't claim to represent them either.