Due to discord's decision to enforce slash commands for bots, I will stop developing this project. This means that I won't fix any issues or bugs nor add new features. The project will remain on GitHub, but it will be achieved.
This also applies for the dynoBot project.
dynoBot-Framework is an chat bot api wrapper which allows you to code your bot independently from chat bot APIs such as the ones from discord or slack. Currently only discord bots are supported. Slack will follow soon.
You can find a documentation for the dynoBot-Framework here:
http://dynodoc.tapadventures.com/
npm install dynobot-framework
Now you can use the framework by adding following line:
const {DiscordBot} = require("dynobot-framework");
Supported events:
error
- returns Error objectserverMemberAdd
- returns User objectserverMemberRemove
- returns User objectmessage
- returns Message objectready
- no return value
Events can be used like this:
Bot.onEvent("<event-name>", (returnValue) => {
//Code that shall be executed when the event was triggered
});
There is an open source bot called dynoBot which uses the dynoBot-Framework. You can take a look at it if you prefer a more realistic implementation example.
There is also an example of a simple bot implementation to get started withk:
const {DiscordBot} = require("dynobot-framework");
const Bot = new DiscordBot("<discord-token>");
Bot.onEvent("ready", () => {
console.log("Bot started");
Bot.onEvent("message", (msg) => {
if (msg.isMentioned(Bot.getClient().getUser())) {
msg.getTextChannel().send("OK");
}
});
});