Programmable Discord Bot | Part 3: Language Semantics | Node.JS + Discord.JS + Ohm

Опубликовано: 31 Август 2018
на канале: Goldcrest Studios
326
3

Part 3 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 continue implementing the custom programming language. In part 2 I created the grammar which is the definitions of our languages expressions, statements, and other syntax. In this part I code (sometimes tediously) the actual running of those parts of the language in what Ohm calls a language's "semantics." In part 4 I will finish the running of programs, and in future parts I will implement type checking (so you can't try to add a number to a function) and support for BigIntegers (practically infinitely large or small numbers), and in even further on episodes I will add control flow elements like if/else, switch/case, and so on. After that, I will focus on other features like native functions and function calls as well as allowing your language to interface with Discord.

It has been a while since I last uploaded but don't expect consistent uploads from me at all.

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.