<commit_before># Butterfield

A Slack bot framework using Slack's [Real Time Messaging API](https://api.slack.com/rtm), Python 3 and [asyncio](https://docs.python.org/3/library/asyncio.html).

**Butterfield is unstable and being actively developed. Breaking changes will occur.**

## Echo bot example

This simple bot will listen for *message* events and echo the message to the same channel. 

	import asyncio
	from butterfield import Bot
	
	@asyncio.coroutine
	def echo(bot, msg):
		yield from bot.post(
			msg['channel'],
			msg['text']
		)
	
	b = Bot('slack-bot-key')
	b.listen('message', echo)
	b.start()

## Running butterfield

This package provides the *butterfield* command line utility. This command takes one argument, a path to a configuration file, and runs the bot as defined.<commit_msg>fix echo bot in example<commit_after># Butterfield

A Slack bot framework using Slack's [Real Time Messaging API](https://api.slack.com/rtm), Python 3 and [asyncio](https://docs.python.org/3/library/asyncio.html).

**Butterfield is unstable and being actively developed. Breaking changes will occur.**

## Echo bot example

This simple bot will listen for *message* events and echo the message to the same channel. 

	import asyncio
	from butterfield import Bot
	
	@asyncio.coroutine
	def echo(bot, msg: 'message'):
		yield from bot.post(
			msg['channel'],
			msg['text']
		)
	
	b = Bot('slack-bot-key')
	b.listen(echo)
	b.start()

## Running butterfield

This package provides the *butterfield* command line utility. This command takes one argument, a path to a configuration file, and runs the bot as defined.
{'fraction_non_alphanumeric': 0.10285006195786865, 'fraction_numerical': 0.0024783147459727386, 'mean_word_length': 4.295081967213115, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6451929', 'n_tokens_mistral': 505, 'n_tokens_neox': 470, 'n_words': 189}