<commit_before>[![GitHub version](https://badge.fury.io/gh/efreak%2Fnode-steam-chat-bot.svg)](http://badge.fury.io/gh/efreak%2Fnode-steam-chat-bot)
[![GitHub tag](https://img.shields.io/github/tag/efreak/node-steam-chat-bot.svg)]()
[![node](https://img.shields.io/node/v/steam-chat-bot.svg)]()
[![Repo Size](https://reposs.herokuapp.com/?path=Efreak/node-steam-chat-bot)]()
[![Packagist](https://img.shields.io/badge/license-MIT-44CC11.svg)](/LICENCE)

[![Dependencies](https://david-dm.org/efreak/node-steam-chat-bot.svg)](https://david-dm.org/efreak/node-steam-chat-bot)
[![Dependency Status](https://www.versioneye.com/user/projects/547014ce9dcf6d5567000b49/badge.svg?style=flat)](https://www.versioneye.com/user/projects/547014ce9dcf6d5567000b49)
[![Codacy Badge](https://www.codacy.com/project/badge/79e3862b9b2b4e0fbbcf9e980fcb6263)](https://www.codacy.com/public/efreak2004/node-steam-chat-bot)

[![NPM](https://nodei.co/npm/steam-chat-bot.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/steam-chat-bot/)

node-steam-chat-bot
===================

Simplified interface for a steam chat bot. This is a wrapper around [Steam for Node.js](https://github.com/seishun/node-steam) which is aimed at making an easily configurable chatbot that sits in Steam groups chat rooms and responds to various events. Responses are handled as a set of triggers of various types which can be configured to respond to a number of different chat messages. Steam requires that a user has at least one game before it can join chat rooms (unless it's a mod), so you'll need to buy a game for the bot account or make it a mod before it will be able to join.

If you have Steam Guard enabled you'll get a failed logon attempt the first time you try to log on and you'll be sent a Steam Guard code. Pass this code in with the constructor (e.g. `new ChatBot('username', 'password', { guardCode: 'XXXX' };)` and you should be able to log in. A sentry file will be stored, which should allow you to log in with a different computer using the same guard code. If you start getting logon failures again you should delete the sentry file, remove the guard code, and try to log in with neither so you get a fresh code emailed to you.

### Installation: 

Type `npm install steam-chat-bot`. If you want to run the development version, type `npm install efreak/node-steam-chat-bot#development` (or the url to your preferred repo/branch).

To get this running in Windows you'll need to follow the setup instructions for [node-gyp](https://github.com/TooTallNate/node-gyp#installation) and also use a branch of libxmljs as described in [this issue](https://github.com/polotek/libxmljs/issues/176) (TLDR is to run 'npm install polotek/libxmljs#vendor-src' before 'npm install').

### Current Triggers:


`AcceptChatInviteTrigger` - Joins a specified chatroom when invited and says an optional welcome message. set option autoJoinAfterDisconnect to add channels to autojoin list when used.

`AcceptFriendRequestTrigger` - Automatically accepts any friend requests sent to the bot.

`AddFriendTrigger` - provides a !add command. You should probably restrict this and other similar commands to admin user(s) only.

`BanCheckTrigger` - checks to see if a user has any VAC/economy/community bans via steam API. Requires a steam api key, defined as option apikey in the plugin, or globally defined as a chatBot option steamapikey

`BanTrigger` - bans a user from a groupchat. User does not need to be in groupchat for this to work.
<commit_msg>Expand options in README<commit_after>[![GitHub version](https://badge.fury.io/gh/efreak%2Fnode-steam-chat-bot.svg)](http://badge.fury.io/gh/efreak%2Fnode-steam-chat-bot)
[![GitHub tag](https://img.shields.io/github/tag/efreak/node-steam-chat-bot.svg)]()
[![node](https://img.shields.io/node/v/steam-chat-bot.svg)]()
[![Repo Size](https://reposs.herokuapp.com/?path=Efreak/node-steam-chat-bot)]()
[![Packagist](https://img.shields.io/badge/license-MIT-44CC11.svg)](/LICENCE)

[![Dependencies](https://david-dm.org/efreak/node-steam-chat-bot.svg)](https://david-dm.org/efreak/node-steam-chat-bot)
[![Dependency Status](https://www.versioneye.com/user/projects/547014ce9dcf6d5567000b49/badge.svg?style=flat)](https://www.versioneye.com/user/projects/547014ce9dcf6d5567000b49)
[![Codacy Badge](https://www.codacy.com/project/badge/79e3862b9b2b4e0fbbcf9e980fcb6263)](https://www.codacy.com/public/efreak2004/node-steam-chat-bot)

[![NPM](https://nodei.co/npm/steam-chat-bot.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/steam-chat-bot/)

node-steam-chat-bot
===================

Simplified interface for a steam chat bot. This is a wrapper around [Steam for Node.js](https://github.com/seishun/node-steam) which is aimed at making an easily configurable chatbot that sits in Steam groups chat rooms and responds to various events. Responses are handled as a set of triggers of various types which can be configured to respond to a number of different chat messages. Steam requires that a user has at least one game before it can join chat rooms (unless it's a mod), so you'll need to buy a game for the bot account or make it a mod before it will be able to join.

If you have Steam Guard enabled you'll get a failed logon attempt the first time you try to log on and you'll be sent a Steam Guard code. Pass this code in with the constructor (below) and you should be able to log in. A sentry file will be stored, which should allow you to log in with a different computer using the same guard code. If you start getting logon failures again you should delete the sentry file, remove the guard code, and try to log in with neither so you get a fresh code emailed to you.

````javascript
new ChatBot('username', 'password', {
	guardCode: 'XXXX', //this is required on the first run if you have steamguard enabled, but not after that.
	disableWebServer:false, //the built-in webserver is enabled by default
	webServerPort: 8080, //If you run steam-chat-bot as root, it will eat your babies. Do NOT run steam-chat-bot as root.
	autojoinFile: "bot.username.autojoin",
	consoleColors:true,
	consoleTime:true,
	consoleLogLevel:"info", //can also be error or debug
	logFile: "bot.username.log", //this does *not* log chatter. If you want to log chatter, use the logTrigger.
	sentryFile: "bot.username.sentry", //this is your ssfn file (no, you can't actually use an ssfn file)
	autoconnect: true, //Why would you *not* want it to autoconnect?
	autoReconnect: false, //You probably want to set this to true, though...
	babysitTimer: 5*60*1000 //that's 5 minutes, if you can't do math. The babysitter checks to make sure we're online if above is true.
})
````

### Installation: 

Type `npm install steam-chat-bot`. If you want to run the development version, type `npm install efreak/node-steam-chat-bot#development` (or the url to your preferred repo/branch).

To get this running in Windows you'll need to follow the setup instructions for [node-gyp](https://github.com/TooTallNate/node-gyp#installation) and also use a branch of libxmljs as described in [this issue](https://github.com/polotek/libxmljs/issues/176) (TLDR is to run 'npm install polotek/libxmljs#vendor-src' before 'npm install').

### Current Triggers:


`AcceptChatInviteTrigger` - Joins a specified chatroom when invited and says an optional welcome message. set option autoJoinAfterDisconnect to add channels to autojoin list when used.

`AcceptFriendRequestTrigger` - Automatically accepts any friend requests sent to the bot.

`AddFriendTrigger` - provides a !add command. You should probably restrict this and other similar commands to admin user(s) only.

`BanCheckTrigger` - checks to see if a user has any VAC/economy/community bans via steam API. Requires a steam api key, defined as option apikey in the plugin, or globally defined as a chatBot option steamapikey

`BanTrigger` - bans a user from a groupchat. User does not need to be in groupchat for this to work.

{'fraction_non_alphanumeric': 0.11168148240891448, 'fraction_numerical': 0.017778890697383247, 'mean_word_length': 4.730272596843616, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 32, 'lorem ipsum': 0, 'www.': 8, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '585156', 'n_tokens_mistral': 2596, 'n_tokens_neox': 2442, 'n_words': 912}