Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/carlosfdez/tmibot.js
A wrapper for tmi.js to support bot commands for twitch
https://github.com/carlosfdez/tmibot.js
chatbot javascript twitch twitchirc
Last synced: 5 days ago
JSON representation
A wrapper for tmi.js to support bot commands for twitch
- Host: GitHub
- URL: https://github.com/carlosfdez/tmibot.js
- Owner: CarlosFdez
- License: mit
- Created: 2017-08-19T00:28:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-01T04:00:57.000Z (over 7 years ago)
- Last Synced: 2024-11-09T18:49:25.436Z (2 months ago)
- Topics: chatbot, javascript, twitch, twitchirc
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# TMIBot.js
A javascript library that wraps over [tmi.js](https://github.com/tmijs/tmi.js) to support bot command parsing. This is really new and highly subject to change. Some ideas came from various discord bot libraries (mostly discord.py).
I wrote this mostly for my own use, but if you want feel free to use it. You can contact me on [Twitter](https://twitter.com/MeSoSupe) if you need anything.
## How to install
Its currently not on NPM, so you'd have to do:
`npm install https://github.com/CarlosFdez/tmibot.js.git`
## Example
```js
var tmi = require("tmi.js");
var tmibot = require("tmibot.js");// note: it is good practice not to include config files in source control
var config = require("./config.json");// config options are the same as normal tmi.client
var client = new tmi.client(config.tmi);
var bot = new tmibot.bot(client, { prefix: '!' });bot.addCommand("hello", (ctx, args) => {
ctx.reply("Hello " + ctx.author.name);
});bot.addCommand("echo", (ctx, args) => {
ctx.reply(args.toString());
})client.connect();
```More examples are in the examples/ folder.
## Documentation
Unfortunately there isn't any at this time. However, I did write JSDoc comments, so an editor with intelligent code completion is enough. I personally use [Visual Studio Code](https://code.visualstudio.com/).