Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ivkos/botyo-api
Botyo API - The API for developing modules for Botyo
https://github.com/ivkos/botyo-api
botyo chat chatbot facebook
Last synced: 4 days ago
JSON representation
Botyo API - The API for developing modules for Botyo
- Host: GitHub
- URL: https://github.com/ivkos/botyo-api
- Owner: ivkos
- License: apache-2.0
- Created: 2017-12-02T15:20:14.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-08T12:50:55.000Z (over 6 years ago)
- Last Synced: 2024-09-23T22:38:05.119Z (about 2 months ago)
- Topics: botyo, chat, chatbot, facebook
- Language: TypeScript
- Homepage: https://ivkos.github.io/botyo-api
- Size: 217 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Botyo API
[![npm](https://img.shields.io/npm/v/botyo-api.svg)](https://www.npmjs.com/package/botyo-api)
[![npm](https://img.shields.io/npm/dt/botyo-api.svg)](https://www.npmjs.com/package/botyo-api)
[![npm](https://img.shields.io/npm/l/botyo-api.svg)]()The **Botyo API** module is a collection of types, interfaces and classes for developing modules for [Botyo](https://github.com/ivkos/botyo).
## Requirements
* Node.js >= 8.3.0## Install
`npm install --save botyo-api`## Documentation
The documentation for the Botyo API is available here:
* [Botyo API Documentation](https://ivkos.github.io/botyo-api)## Example
### TypeScript
```ts
import { AbstractCommandModule, Message } from "botyo-api";export default class HelloCommand extends AbstractCommandModule
{
getCommand(): string
{
return "hello";
}getDescription(): string
{
return "Responds to the hello";
}getUsage(): string
{
return "";
}validate(msg: Message, args: string): boolean
{
return true;
}async execute(msg: Message, args: string): Promise
{
return this.getRuntime().getChatApi().sendMessage("Hello world!", msg.threadID);
}
}
```### JavaScript
```js
const AbstractCommandModule = require('botyo-api').AbstractCommandModule;class HelloCommand extends AbstractCommandModule
{
getCommand() {
return "hello";
}getDescription() {
return "Responds to the hello";
}getUsage() {
return "";
}validate(msg, args) {
return true;
}async execute(msg, args) {
return this.getRuntime().getChatApi().sendMessage("Hello world!", msg.threadID);
}
}module.exports = HelloCommand;
```