# basicbot

> basicbot for bootstrapping other cmd based bots

Latest version **1.0.1** (published 2015-09-04) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install basicbot
pnpm add basicbot
yarn add basicbot
bun add basicbot
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2015-09-04 |
| First published | 2015-09-03 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mike Kozak |
| Maintainers | meteormanaged |

## Links

- npm: https://www.npmjs.com/package/basicbot
- Repository: https://github.com/meteormanaged/basicbot
- Homepage: https://github.com/meteormanaged/basicbot#readme
- Issues: https://github.com/meteormanaged/basicbot/issues
- npm.io page: https://npm.io/package/basicbot

## Dependencies (1)

- [slack-client](https://npm.io/package/slack-client.md) ^1.4.1

## Recent versions

- 1.0.1 (latest) — 2015-09-04
- 1.0.0 — 2015-09-03

## README

# Basicbot

Basicbot for our internal bot swarm.  Requires an options objection with commands in it.

Bots require a SLACK_TOKEN env variable.  Please pass this or declare it before initializing the bot.

Requires [slack-client](https://www.npmjs.com/package/slack-client)

## Usage:

	//Require the basicbot package - Usage is as a singleton.  
	var basicbot = require('basicbot');

	//Fly in your options for the bot (expects a cmds parameter)
	var botoptions = require('./lib/botoptions');

	//Initialize the bot
	basicbot(botoptions);

## Options:

	var options = {
		cmds: {
			projects: require("./lib/projects"),
			groups: require("./lib/groups"),
			issues: require("./lib/issues")
		}
	}

## Commands

	var projects(words, callback) {
		if (words[2] === 'destroy'){
			callback('You can't destroy projects.  They destroy you');
		}
	}
	
	module.exports = projects;

Commands should be structured to recieve an array of words of the message recieved and pass a callback containing either:

1. A string to be sent to the channel where the message was recieved.
2. A well formed Slack message object which can contain attachments, etc.  Form it cleanly and you'll have no problems.  Even a single attachment passed as an attachments property needs to be in an array.  

More info here:
[Slack Formatting](https://api.slack.com/docs/formatting)
[Slack Attachments](https://api.slack.com/docs/attachments)
	

Version 1.0.0 // Committed 9/2/2015

---
_Source: https://npm.io/package/basicbot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
