1.4.1 • Published 3 years ago

dynobot-framework v1.4.1

Weekly downloads
31
License
MIT
Repository
github
Last release
3 years ago

dynoBot-Framework

license Build Status npm github

Overview

  1. dynoBot-Framework
  2. Documentation
  3. Setup
  4. Events
  5. Implementation

dynoBot-Framework

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.

Documentation

You can find a documentation for the dynoBot-Framework here:

http://dynodoc.tapadventures.com/

Setup

npm install dynobot-framework

Now you can use the framework by adding following line:

const {DiscordBot} = require("dynobot-framework");

Events

Supported events:

  • error - returns Error object
  • serverMemberAdd - returns User object
  • serverMemberRemove - returns User object
  • message - returns Message object
  • ready - no return value

Events can be used like this:

Bot.onEvent("<event-name>", (returnValue) => {
	//Code that shall be executed when the event was triggered
});

Implementation

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");
		}
	});
});
1.4.1

3 years ago

1.4.0

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

1.0.0-beta-5

5 years ago