Skip to content

A DSL that makes it simple and easy to create Discord bots.

Notifications You must be signed in to change notification settings

AnimeAllstar/EZDiscord

Repository files navigation

EZDiscord

A simple, easy way to create Discord bots.

Why EZDiscord?

Are you a Discord user who has wanted to make bots for your own servers? But when you looked into making one, you were faced with the hundreds of pages long Discord API documentation full of technical jargon, not knowing even where to start. Looking even further you might have found some libraries that wrap around the behemoth that is the Discord API to hopefully make it simpler, however said libraries also require other prerequisite knowledge on server run times such as Node.Js and asynchronous programming, something that you just do not have the time to go into.

If this is you then EZDiscord is your solution. EZDiscord is a DSL that heavily simplifies the process of creating Discord Bots, allowing anyone with very basic programming knowedlge to program their very own discord bot!

Setting up a Development Environment

  • Run yarn install to download dependencies
  • Run yarn antlr to generate the antlr files required by the parse tree to AST converter.

Documentation

Read the Getting Started Guide

Documentation for the EZDiscord Language can be found here.

Compiling DSL code to TypeScript code

  • create/modify the bot.ezd file in the root directory.
    • Include the bot Token, ClientID and GuildIDs taken from the Discord Developer Portal and Discord client.
    • Define the commands and variables according to the documentation.

  • run yarn ezd-compile to generate a .env file and an output.ts sourcefile

image

Running the bot

  • After generating the .env file and the TypeScript code, run yarn ezd-run to start the bot

image

Compiling and running in one step

  • run yarn ezd-start to compile the DSL code and run the bot

Testing

  • You can find the test suite within ./test directory
  • Current test suite includes (1) parser/lexer tests, (2) static error tests, (3) integration tests
  • Run yarn test to run all 3 test suites
  • Run yarn test-parser to run parser and lexer tests only
    • The tests were set up using JSON files which include input string and whether it's valid or invalid
    • There are 38 tests which require reading 38 JSON files, so the test might take some time
  • Run yarn test-static to run static error checks only
    • Similarly to parser tests, static tests use input strings from JSON inputs and checks whether they raise static errors
  • Run yarn test-integration to run integration tests only
    • Tests will use input file and attempt to create output file
    • In valid case, the valid.ts will be generated and in invalid case the file will not be generated at all

Syntax Highlighting

  • Syntax highlighting is available for EZDiscord. You can install the extension from the VS Code Marketplace.

Organization

About

A DSL that makes it simple and easy to create Discord bots.

Topics

Resources

Stars

Watchers

Forks