mixer-bot
Richard Wen
rrwen.dev@gmail.com
Simplified chat bot for the mixer live streaming platform
Note: This is based on a Mixer chat bot tutorial on the developer's page
Install
npm install -g mixer-bot
For the latest developer version, see Developer Notes.
Usage
The mixerbot
package can be used as a command line tool or programatically in Node.js.
In the Command Line
Create a .env
file in the current directory if it does not exist:
- Replace
<token>
with your access token - A file
.env
will be created (do not share this file)
mixer-bot env <token>
To run a mixer-bot:
<name>
is the name of the mixer-bot npm package or .js file
mixer-bot run <name>
If you want to create your own mixer-bot:
- Create a bot template file
mixer-bot template
- Edit this file to change bot behaviour
- Run the both with
mixer-bot run
mixer-bot template ./template.js
mixer-bot run template.js
In Node.js
An example usage of mixer-bot in node
:
const mixerbot = ; // Create a .env file in the same location and set// MIXER_ACCESS_TOKEN=***// MIXER_CHANNEL_ID=*** // Setup optionsvar options = {};optionson = {};optionsgreeting = 'Hello!'; // Setup channel ID// If left unset, this will be the id to your channel// Get your channel id here: https://mixer.com/api/v1/channels/<username>?fields=id// options.channel_id = '<CHANNEL_ID>'; // Welcome a user when they joinoptionson { socket = datasocket; return { socket; }}; // Assign bot to pong user if they message !pingoptionson { socket = datasocket; return { if responsemessagemessage0data socket; console; }}; // Handle errorsoptionson { return { console; console; }}; // Run mixer bot;
See Documentation for more details.
Contributions
- Reports for issues and suggestions can be made using the issue submission interface.
- Code contributions are submitted via pull requests
See CONTRIBUTING.md for more details.