Skip to content

owenconti/livecodingtv-bot-plugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 

Repository files navigation

livecodingtv-bot-plugins

Approved plugins for the LCTV Bot

Follower Notifications

Display follower notifications on your stream via the LCTV Bot web page.

Insults

Vote System

Voting system for the LCTV Bot.

API Triggers

API trigger hooks available via chat messages.

Flyouts

Flyouts available for the client app.

YouTube

YouTube song requests/playlist management to be used with the client app.

Writing your own plugins

  1. Each plugin resides in its own directory. To begin writing your own plugin, navigate to the plugins directory, and create a new directory for your plugin. The directory name should be the same name as your repository on github, ie: 'lctv-bot-follow-notification-plugin'.

  2. Plugins for the LCTV Bot are their own NPM packages. Create a NPM package with npm init inside your plugin's directory. Answer the questions prompted on screen. Since plugins are NPM packages, you are able to install whatever other NPM packages you need. Make sure you use the --save argument when calling npm install so that other users of your plugin, also get the NPM package dependencies.

  3. All plugins require an index.js file. The index.js file is used by the bot to process incoming commands, and to send commands over the WebSocket connection. Create an index.js file inside your plugin's directory.

  4. The index.js file must export an array of command objects. Each command is checked against each incoming message, and when a match is found, the action function for the command is ran. An example of an index.js file is:

module.exports = [{
  types: ['message'],
  regex: /hello/,
  action: function( chat, stanza ) {
		chat.replyTo( stanza.user.username, 'Hello, welcome to the stream!' );
  }
}

The above plugin, would reply 'Hello, welcome to the stream!' to whoever types 'hello' in chat.

  1. Plugins have access to all of the regular settings stored in the setup directory. In addition, plugins can also have their own settings, which are stored in a settings.json in the plugin's directory. Note: If your plugin depends on a settings.json file, ensure the settings.json file is ignored by git.

  2. Write a README.md! Without a README, users trying to install and use your plugin will be lost. Take the time to write out and explain how to use your code!

  3. See the core commands, and other plugins as examples.

(https://github.com/owenconti/livecodingtv-bot/tree/master/commands)[https://github.com/owenconti/livecodingtv-bot/tree/master/commands] (https://github.com/owenconti/livecodingtv-bot-plugins)[https://github.com/owenconti/livecodingtv-bot-plugins]

About

Approved plugins for the LCTV Bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published