How to use the eris.CommandClient function in eris

To help you get started, we’ve selected a few eris examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github abalabahaha / eris / examples / basicCommands.js View on Github external
const Eris = require("eris");

// Replace BOT_TOKEN with your bot account's token
const bot = new Eris.CommandClient("BOT_TOKEN", {}, {
    description: "A test bot made with Eris",
    owner: "somebody",
    prefix: "!"
});

bot.on("ready", () => { // When the bot is ready
    console.log("Ready!"); // Log "Ready!"
});

bot.registerCommandAlias("halp", "help"); // Alias !halp to !help

bot.registerCommand("ping", "Pong!", { // Make a ping command
// Responds with "Pong!" when someone says "!ping"
    description: "Pong!",
    fullDescription: "This command could be used to check if the bot is up. Or entertainment when you're bored."
});
github abalabahaha / eris / examples / reactionButtons.js View on Github external
const Eris = require("eris");

// Replace BOT_TOKEN with your bot account's token
const bot = new Eris.CommandClient("BOT_TOKEN", {}, {
    description: "A test bot made with Eris",
    owner: "somebody",
    prefix: "!"
});

bot.on("ready", () => { // When the bot is ready
    console.log("Ready!"); // Log "Ready!"
});

bot.registerCommand("ping", "Pong!", { // Make a ping command
// Responds with "Pong!" when someone says "!ping"
    description: "Pong!",
    fullDescription: "This command could be used to check if the bot is up. Or entertainment when you're bored.",
    reactionButtons: [ // Add reaction buttons to the command
        {
            emoji: "⬅",
github Dragory / modmailbot / index.js View on Github external
const fs = require('fs');
const http = require('http');
const url = require('url');
const crypto = require('crypto');
const publicIp = require('public-ip');
const Eris = require('eris');
const moment = require('moment');
const Queue = require('./queue');
const config = require('./config');

const logServerPort = config.port || 8890;

const bot = new Eris.CommandClient(config.token, {}, {
  prefix: config.prefix || '!',
  ignoreSelf: true,
  ignoreBots: true,
  defaultHelpCommand: false,
});

let modMailGuild;
const modMailChannels = {};
const messageQueue = new Queue();

const blockFile = `${__dirname}/blocked.json`;
let blocked = [];

const logDir = `${__dirname}/logs`;
const logFileFormatRegex = /^([0-9\-]+?)__([0-9]+?)__([0-9a-f]+?)\.txt$/;
github dragonbanshee / node-steam-chat-bot / lib / triggers / discordTrigger.js View on Github external
DiscordRelay.prototype._onLoggedOn = function() {
	var that = this;
	if(this.discord) {
		return true;
	}
	this.discord = new Eris.CommandClient(this.options.token, {
		autoreconnect:true,
		disableEveryone:true //don't allow people to use @everyone and @here from steam...
	});
	this.discord.connect();

	this.discord.on('ready', function(){
		that.discordOn = true;
		that.winston.debug(that.chatBot.name+"/"+that.name+": Connected to discord as "+that.discord.user.username);
		for(var key in that.relays.steam) {
			that._sendMessageAfterDelay(that.relays.steam[key].steamChat, "Connected to discord as "+that.discord.user.username);
			if(that.chatBot.connected===true) {
				that.discord.createMessage(that.relays.steam[key].discordChannelID, "Connected to steam.");
			} else {
				that.discord.createMessage(that.relays.steam[key].discordChannelID, "Not yet connected to steam. Messages sent while disconnected will not be relayed.");
			}
		}