Home

Awesome

If you'd like to take over this project, please find me on steam or matrix.

GitHub version GitHub tag node Repo Size License

Join the chat at https://gitter.im/Efreak/node-steam-chat-bot Dependency Status Codacy Badge Downloads per month

Stats Downloads

steam-chat-bot

This module is based on the original steam-chat-bot written by bonnici. The original module link is here.

Simplified interface for a steam chat bot. This is a wrapper around Steam for Node.js 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.

We also have our very own subreddit. If you like steam-chat-bot, please subscribe to it. We often post news, and other important information. It is also a place for users to get help if something doesn't work.

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 and also use a branch of libxmljs as described in this issue (TLDR is to run 'npm install polotek/libxmljs#vendor-src' before 'npm install').

Configuration:

Basic Config:

You almost certainly want more than this in your config, unless you're happy with all the defaults and only having a logTrigger.

var myBot = new ChatBot('username', 'password');
myBot.loadTriggers([
	{
		name: 'logTrigger',
		type: 'LogTrigger',
		options: { roomNames: roomNames }
	}
]);

There are also several example configurations in the examples folder.

If there is no example configuration for a specified trigger, please check the top of the trigger file for information on calling it. The trigger definition files may also have information on more advanced usage than is contained in the readme or wiki or example configs.

Public Functions

There are some public functions available for more advanced/programmatic usage of the bot.

Popular Triggers:

See TRIGGERS or the triggers folder for the full list of triggers and how to use them. If you want to contribute a trigger, please make sure to add a quick description and list of all parameters and how to use them at the top of the trigger file (required) and add a basic usage section to TRIGGERS (also required, need not be in-depth).

Management Triggers

General bot-related and chat-related functions.

Trade-related triggers

Other popular triggers

Writing Triggers

If you look at BaseTrigger.js, you can see a full list of available functions designed to be used from within plugins. You can also use a chatBot.js function() by calling this.chatBot.function() object from inside a trigger. Please see the Wiki for more information.

Heroku

See the bottom of example-heroku.js for an example of a simple webserver and self-pinger that satisfies heroku's requirements of 1 visit per hour to keep a free Dyno running. It also provides some simple statistics when you visit the /stats url. Read the top of the file to set it up correctly with heroku.

After you have example-heroku set up to your liking, follow the instructions here to set up heroku and upload your bot. Once it's uploaded, start it with heroku ps:scale web=1

Testing Policy: forthebadge

In other words, I don't do a whole lot of testing. I do my best not to break things, but stuff happens. If you found or fixed a bug, you know what to do.

Note: Please read about CONTRIBUTING before creating a pull request. If your pull request goes against what is said, it will not be accepted and we will ask you to fix it.