BBTag is a templating language initially developed for the blargbot discord bot. The core structure of the language is based around the positioning of subtags, defined by a {}
pair, with arguments being split by a ;
character.
SubTags are split up into varying categories. Subtags within each category can be accessed by {category.function}
. Many functions are also available on the global level, meaning you are able to directly access them through {function}
.
These subtags are implementations of general programming concepts. These are independent from any discord or bot functionality, and can be easily repurposed to other applications.
- System - All subtags relating to general programming concepts
- Array - All subtags relating to the manipulation and usage of arrays. Arrays are rendered out as a json string following the pattern
{"n":"arrayName","v":[1,2,3]}
if it has come from a variable, otherwise[1,2,3]
- Math - All subtags that work with number manipulation
These subtags are all related to discord, and so require that a DiscordContext
be supplied to the engine upon execution.
- Message - All subtags that are used for interacting with discord messages
- Role - All subtags that are used for interacting with discord roles
- Guild - All subtags that are used for interacting with discord guilds
- Channel - All subtags that are used for interacting with discord channels
- User - All subtags that are used for interacting with discord users
These subtags are used for interacting with blargbots features, and so require a BotContext
to be supplied to the engine upon execution.
- Bot - All subtags used for interacting with blargbot directly
For help using the language on blargbot, please visit the blargbot website.
- Node.js 6+
- Clone this repository
git clone https://github.com/blargbot/bbtag.git
- Install the dependent packages
npm install
- Run the typescript compiler in watch mode
npm run build
You can now start developing within the /src
folder and your changes will be compiled as you work.
There are tests set up with the intention of covering all the code written for this project. To run them, you simply need to use
npm run test
All tests should successfully pass. This is verified by our CI process. All tests must pass before any PR will be accepted.
- Stupid Cat - initial implementation
- Titansmasher
See also the list of contributors who participated in this project.
This project is licensed under the GNU AGPLv3 License - see the LICENSE.md file for more information