How to use the eris.Client 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 JamesMatchett / AWS-Discord-Bot / DiscordBot / src / Bot.js View on Github external
);

const aws = new Aws(options);

const eris = require('eris');
const { BOT_TOKEN } = require('../config.json');
const { ROLEID } = require('../config.json');
const { CHANNELID } = require('../config.json');

const PREFIX = '$aws';
const HelpDocs =
    '\n Help Docs: \n `start`: Starts the server \n `stop`: Stops the server \n `status`: Returns the server status  ';


// Create a Client instance with our bot token.
const bot = new eris.Client(BOT_TOKEN);

// When the bot is connected and ready, log to console.
bot.on('ready', () => {
    console.log('Connected and ready.');
});

const commandHandlerForCommandName = {};
commandHandlerForCommandName['start'] = (msg, args) => {
    startStop(true, msg);
};

commandHandlerForCommandName['stop'] = (msg, args) => {
    startStop(false, msg);
};

commandHandlerForCommandName['help'] = (msg, args) => {
github 7coil / discordmail / server / discord / index.js View on Github external
// Get the required shit together
const Discord = require('eris');
const config = require('config');
const { commands } = require('./cogs');
const handler = require('./handler');
const botlist = require('./botlist');
const r = require('./../db');

const client = new Discord.Client(config.get('api').discord.token, {
	maxShards: config.get('discord').shards
});

const prefixes = config.get('discord').prefix.user;

client.once('ready', () => {
	console.log('All shards are online');

	// Set up currently playing game
	client.editStatus('online', {
		name: `${prefixes[0]} help`,
		type: 0
	});

	setInterval(() => {
		botlist(client);
github GilbertGobbels / GAwesomeBot / Platform / Discord.js View on Github external
module.exports = (db, auth, config) => {
	// Create a new Eris bot client
	const eris = require("eris");
	process.setMaxListeners(0);
	const bot = new eris.Client(auth.platform.login_token, {
		disableEvents: {
			MESSAGE_DELETE_BULK: true,
			TYPING_START: true
		},
		getAllUsers: true,
		maxShards: config.shard_count || 1
	});
	bot.isReady = false;

	// Sequentially send an array
	bot.sendArray = (ch, arr, i, options, callback) => {
		if (i === null) {
			i = 0;
		}
		if(i>=arr.length) {
			if(callback) {
github Khaazz / AxonCore / example / src / Bot.js View on Github external
templateConf,
    tokenConf,

    utils: MyUtils, // use your own Utils
    logger: null, // custom Logger
    db: null, // custom DB Service
    axonSchema: null,
    guildSchema: MyGuildSchema,
};

/**
 * new AxonClient(token, erisOptions, AxonOptions, modules)
 *
 * new Client(token, erisOptions, AxonOptions) => Modules imported in Client
 */
const client = new Eris.Client(
    tokenConf.bot.token,
    {
        autoreconnect: true,
        defaultImageFormat: 'png',
        defaultImageSize: 512,
        disableEveryone: true,
        getAllUsers: false,
        messageLimit: 100,
        restMode: true,
    }
);

const Bot = new Client(
    client,
    AxonOptions
);
github Terminal / discordapps.dev / src / bot / index.js View on Github external
const Discord = require('eris');
const config = require('config');
const r = require('./../db');

const client = new Discord.Client(config.get('discord').token);

client.on('ready', () => {
	console.log('Discord Bot is online');

	client.editStatus('online', {
		name: 'list.mss.ovh',
		type: 0
	});

	module.exports.guild = client.guilds.get(config.get('discord').guild);
	module.exports.channel = module.exports.guild.channels.get(config.get('discord').channel);
});

client.on('guildMemberAdd', (guild, member) => {
	if (module.exports.guild.id === guild.id) {
		if (member.bot) {
github Yahweasel / craig / craig / client.js View on Github external
function mkClient(token) {
    var ret;
    if (shard) {
        ret = new Eris.Client(token, {
            firstShardID: +process.env["SHARD_ID"],
            lastShardID: +process.env["SHARD_ID"],
            maxShards: +process.env["SHARD_COUNT"]
        });
    } else {
        ret = new Eris.Client(token);
    }
    return ret;
}
github Dragory / ZeppelinBot / backend / src / index.ts View on Github external
connect().then(async conn => {
  const client = new Client(`Bot ${process.env.TOKEN}`, {
    getAllUsers: false,
    restMode: true,
  });
  client.setMaxListeners(100);

  client.on("debug", message => {
    if (message.includes(" 429 ")) {
      logger.info(`[RATELIMITED] ${message}`);
    }
  });

  const allowedGuilds = new AllowedGuilds();
  const guildConfigs = new Configs();

  const bot = new Knub(client, {
    plugins: availablePlugins,
github Dragory / modmailbot / src / legacy / legacyMigrator.js View on Github external
async function migrateOpenThreads() {
  const bot = new Eris.Client(config.token);

  const toReturn = new Promise(resolve => {
    bot.on('ready', async () => {
      const oldThreads = await jsonDb.get('threads', []);

      const promises = oldThreads.map(async oldThread => {
        const existingOpenThread = await knex('threads')
          .where('channel_id', oldThread.channelId)
          .first();

        if (existingOpenThread) return;

        const oldChannel = bot.getChannel(oldThread.channelId);
        if (! oldChannel) return;

        const threadMessages = await oldChannel.getMessages(1000);