discord-client

0.12.2 • Public • Published

discord-client

Create Discord bots with Discord.js faster and better.

var Discord = require('discord-client');
var bot = new Discord('token');
 
bot.setPrefix('global', '!'); // Set the default prefix for each server to "!"
 
bot.command('ping', {response: 'Pong!'}); // Create the command "ping", which will respond with "Pong!"
bot.alias('ping', 'aliasname'); // Create an alias to "ping".
 
bot.command('prefix', { execute: function(client, msg, args) {
        // Discord.js is able to be used while making more advanced commands
 
        if(msg.channel.permissionsFor(msg.author).hasPermission('MANAGE_GUILD')) {
            if(args.length <= 4) {
                bot.setPrefix(msg.guild.id, args);
                msg.reply('Changed the prefix to `' + args + '`');
            } else {
                msg.reply('The prefix can\'t be over 4 characters!');
            }
        } else {
            msg.reply('You need the permission `MANAGE_SERVER` to run this!');
        }
    }
});
 
bot.connect()

Package Sidebar

Install

npm i discord-client

Weekly Downloads

2

Version

0.12.2

License

MIT

Last publish

Collaborators

  • appajs