New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

pluggable-slackbot

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pluggable-slackbot

A pluggable SlackBot to easily interface with your Slack instance.

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
13
333.33%
Maintainers
1
Weekly downloads
 
Created
Source

Pluggable Slackbot

A library to create an easily pluggable slackbot for your Slack instance.

Installation

npm install pluggable-slackbot or yarn add pluggable-slackbot

Usage

var pluggableSlackbot = require('pluggable-slackbot');

var bot = new pluggableSlackbot({
	token: 'your-slack-api-token', // requires legacy API token
	name: 'MyBot',
	iconUrl: 'url-to-bot-icon',
	pluginPath: __dirname + '/plugins',
});

Invoking in Slack

To invoke a reponse from your bot on Slack, you can either message the bot directly or reference it in a channel by starting your message with the bots name like SlackBot, flip a coin

Creating Plugins

You can create plugins and store them in the specified pluginPath.

There are example plugins in the example-plugins folder.

Required plugin methods

{
	/**
	 * config
	 *
	 * @type {object}
	 * @prop {bool} enabled
	 */
	config: {
		enabled: true,
	},

	/**
	 * matchRegex
	 *
	 * @type {regex}
	 */
	matchRegex: /string to match/g,

	/**
	 * run
	 *
	 * @param {object} [message]
	 * @returns {(object|bool)}
	 */
	run: function (message) {
		return {
			message: '',
			options: {},
		};

		/**
		 * returning false will abort the plugins response
		 */
	},
}

Optional plugin methods

{
	/**
	 * initialize
	 *
	 * @returns {void}
	 */
	initialize: function () {
		/**
		 * Anything that needs to be initialized when the plugin is
		 * first loaded goes here. This will only run when the bot
		 * is (re)started.
		 */
	},
}

FAQs

Package last updated on 30 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts