npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mixer-bot

v0.1.2

Published

Simplified chat bot for the mixer live streaming platform

Downloads

25

Readme

mixer-bot

Richard Wen
[email protected]

Simplified chat bot for the mixer live streaming platform

npm version Build Status npm GitHub license Donate Twitter

Note: This is based on a Mixer chat bot tutorial on the developer's page

Install

  1. Install Node.js
  2. Install mixer-bot via npm
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:

  1. Create a bot template file mixer-bot template
  2. Edit this file to change bot behaviour
  3. 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 = require('mixer-bot');

// Create a .env file in the same location and set
// MIXER_ACCESS_TOKEN=***
// MIXER_CHANNEL_ID=***

// Setup options
var options = {};
options.on = {};
options.greeting = '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 join
options.on.UserJoin = data => {
    socket = data.socket;
    return response => {
        socket.call('msg',[
            `Hi ${response.username}! I'm pingbot! Write !ping and I will pong back!`,
        ]);
    }
};

// Assign bot to pong user if they message !ping
options.on.ChatMessage = data => {
    socket = data.socket;
    return response => {
        if (response.message.message[0].data.toLowerCase().startsWith('!ping')) {
            socket.call('msg', [`@${response.user_name} PONG!`]);
            console.log(`Ponged ${response.user_name}`);
        }
    }
};

// Handle errors
options.on.error = data => {
    return error => {
        console.error('Socket error');
        console.error(error);
    }
};

// Run mixer bot
mixerbot(options);

See Documentation for more details.

Contributions

  1. Reports for issues and suggestions can be made using the issue submission interface.
  2. Code contributions are submitted via pull requests

See CONTRIBUTING.md for more details.

See Also