0.12.2 • Published 7 years ago

discord-client v0.12.2

Weekly downloads
10
License
MIT
Repository
-
Last release
7 years ago

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()
0.12.2

7 years ago

0.12.0

7 years ago

0.11.8

7 years ago

0.11.4

7 years ago

0.11.5

7 years ago

0.11.2

7 years ago

0.11.0

7 years ago

0.10.0

7 years ago