changed over = to :, whoops

This commit is contained in:
2019-03-18 06:38:40 +11:00
parent 467dc136ff
commit f4601a7974
25 changed files with 194 additions and 190 deletions

View File

@@ -1,9 +1,10 @@
exports.name = "name" module.exports = {
exports.alias = ['clear'] name: "name",
exports.helptext = "helpmessage" alias: ['clear'],
exports.helphide = false helptext: "helpmessage",
exports.permissions = ['READ_MESSAGES'] helphide: false,
exports.args = ['template'] permissions: ['READ_MESSAGES'],
exports.category = 'general' args: ['template'],
category: 'general',
exports.command = (client, msg) => {} command: (client, msg) => { }
}

View File

@@ -3,12 +3,12 @@ const Discord = require('discord.js')
const request = require('request'); const request = require('request');
module.exports = { module.exports = {
name = "Anagram Finder", name: "Anagram Finder",
alias =['anagram', 'nagaram'], alias: ['anagram', 'nagaram'],
helptext = "finds anagrams up to 9 letters", helptext: "finds anagrams up to 9 letters",
permissions =['VIEW_CHANNEL'], permissions: ['VIEW_CHANNEL'],
args =['letters'], args: ['letters'],
command = (client, msg) => { command: (client, msg) => {
var url = "http://www.anagramica.com/best/:" var url = "http://www.anagramica.com/best/:"

View File

@@ -1,11 +1,11 @@
module.exports = { module.exports = {
name = "Change <@476369946386104330>'s Name", name: "Change <@476369946386104330>'s Name",
alias =['botname'], alias: ['botname'],
helptext = "Changes the bots name on the server", helptext: "Changes the bots name on the server",
permissions =["MANAGE_NICKNAMES"], permissions: ["MANAGE_NICKNAMES"],
args =["new-name"], args: ["new-name"],
category = 'admin', category: 'admin',
command = (client, msg) => { command: (client, msg) => {
msg.guild.me.setNickname(msg.suffix); msg.guild.me.setNickname(msg.suffix);
} }
} }

View File

@@ -1,11 +1,11 @@
module.exports = { module.exports = {
name = "Change Prefix", name: "Change Prefix",
alias =['changeprefix', 'prefix'], alias: ['changeprefix', 'prefix'],
helptext = "Changes the bots prefix for the server", helptext: "Changes the bots prefix for the server",
permissions =["ADMINISTRATOR"], permissions: ["ADMINISTRATOR"],
category = 'admin', category: 'admin',
args =["new-prefix"], args: ["new-prefix"],
command = (client, msg) => { command: (client, msg) => {
if (msg.suffix.length != 1) { if (msg.suffix.length != 1) {
msg.reply("please only use 1 character") msg.reply("please only use 1 character")
return; return;

View File

@@ -1,12 +1,12 @@
module.exports = { module.exports = {
name = "Clear Messages", name: "Clear Messages",
alias =['clear'], alias: ['clear'],
helptext = "Clears messages from the channel", helptext: "Clears messages from the channel",
helphide = false, helphide: false,
permissions =['VIEW_CHANNEL'], permissions: ['VIEW_CHANNEL'],
args =['number'], args: ['number'],
category = 'admin', category: 'admin',
command = (client, msg) => { command: (client, msg) => {
console.log("Clearing: " + msg.suffix); console.log("Clearing: " + msg.suffix);
msg.channel.bulkDelete(parseInt(msg.suffix) + 1); msg.channel.bulkDelete(parseInt(msg.suffix) + 1);
} }

View File

@@ -1,11 +1,11 @@
module.exports = { module.exports = {
name = 'Self Diagnosis', name: 'Self Diagnosis',
alias =['diagnose', 'webmd'], alias: ['diagnose', 'webmd'],
helptext = 'What cancer do you have today?', helptext: 'What cancer do you have today?',
helphide = false, helphide: false,
permissions =['READ_MESSAGES'], permissions: ['READ_MESSAGES'],
category = 'general', category: 'general',
command = (client, msg) => { command: (client, msg) => {
switch (getRandomInt(0, 25)) { switch (getRandomInt(0, 25)) {
case 0: case 0:
msg.reply("I'm sorry, It's Cancer."); msg.reply("I'm sorry, It's Cancer.");

View File

@@ -1,9 +1,9 @@
module.exports = { module.exports = {
name = "Emote Page Test", name: "Emote Page Test",
alias =['emotetest'], alias: ['emotetest'],
helptext = "testing for emote responses", helptext: "testing for emote responses",
helphide = true;, helphide: true,
command = (client, msg) => { command: (client, msg) => {
msg.reply("testing emote thing") msg.reply("testing emote thing")
.then(sent => { .then(sent => {

View File

@@ -1,11 +1,11 @@
module.exports = { module.exports = {
name = 'Get auto parent', name: 'Get auto parent',
alias =['getautoparent'], alias: ['getautoparent'],
helptext = 'gets the auto creation channel', helptext: 'gets the auto creation channel',
helphide = false, helphide: false,
permissions =['ADMINISTRATOR'], permissions: ['ADMINISTRATOR'],
category = 'admin', category: 'admin',
command = (client, msg) => { command: (client, msg) => {
client.database.get_setting("autoParent", msg.guild.id).then((r) => { client.database.get_setting("autoParent", msg.guild.id).then((r) => {
msg.reply(`${r} - ${msg.guild.channels.get(r).name}`); msg.reply(`${r} - ${msg.guild.channels.get(r).name}`);
}); });

View File

@@ -1,11 +1,11 @@
module.exports = { module.exports = {
name = 'Get auto voice', name: 'Get auto voice',
alias =['getautovoice'], alias: ['getautovoice'],
helptext = 'Set the auto-sorting channel', helptext: 'Set the auto-sorting channel',
helphide = false, helphide: false,
permissions =['READ_MESSAGES'], permissions: ['READ_MESSAGES'],
category = 'admin', category: 'admin',
command = (client, msg) => { command: (client, msg) => {
client.database.get_setting("autoVoice", msg.guild.id).then((r) => { client.database.get_setting("autoVoice", msg.guild.id).then((r) => {
msg.reply(`${r} - ${msg.guild.channels.get(r).name}`); msg.reply(`${r} - ${msg.guild.channels.get(r).name}`);
}); });

View File

@@ -2,12 +2,12 @@ const fs = require('fs')
const Discord = require('discord.js') const Discord = require('discord.js')
module.exports = { module.exports = {
name = "Help file", name: "Help file",
alias =['help', '?'], alias: ['help', '?'],
helptext = "Runs this help menu", helptext: "Runs this help menu",
permissions =['VIEW_CHANNEL'], permissions: ['VIEW_CHANNEL'],
args =['(general)/music/admin'], args: ['(general)/music/admin'],
command = (client, msg) => { command: (client, msg) => {
fs.readdir("./commands/", function (err, items) { fs.readdir("./commands/", function (err, items) {
var embed = new Discord.RichEmbed var embed = new Discord.RichEmbed
embed.color = 0x0ca9fe embed.color = 0x0ca9fe

View File

@@ -2,13 +2,13 @@ var request = require('request');
var url = "https://www.reddit.com/r/dadjokes/hot/.json?limit=100"; var url = "https://www.reddit.com/r/dadjokes/hot/.json?limit=100";
module.exports = { module.exports = {
name = 'joke', name: 'joke',
alias =['joke'], alias: ['joke'],
helptext = 'Fresh dad jokes from reddit.com/r/dadjokes', helptext: 'Fresh dad jokes from reddit.com/r/dadjokes',
helphide = false, helphide: false,
permissions =['READ_MESSAGES'], permissions: ['READ_MESSAGES'],
category = 'general', category: 'general',
command = (client, msg) => { command: (client, msg) => {
request({ request({
url: url, url: url,
json: true json: true

View File

@@ -1,20 +1,22 @@
exports.name = 'Kick' module.exports = {
exports.alias = ['kick'] name: 'Kick',
exports.helptext = 'Kicks users from the voice channel' alias: ['kick'],
exports.helphide = false helptext: 'Kicks users from the voice channel',
exports.permissions = ['MOVE_MEMBERS'] helphide: false,
exports.args = ['@Tag'] permissions: ['MOVE_MEMBERS'],
exports.category = 'admin' args: ['@Tag'],
exports.command = (client, msg) => { category: 'admin',
if (msg.mentions.members.array().length > 0) command: (client, msg) => {
msg.member.guild.createChannel('Kicked', 'voice') if (msg.mentions.members.array().length > 0)
.then(channel => { msg.member.guild.createChannel('Kicked', 'voice')
msg.mentions.members.first().setVoiceChannel(channel.id); .then(channel => {
c = channel; msg.mentions.members.first().setVoiceChannel(channel.id);
setTimeout(function () { c = channel;
c.delete() setTimeout(function () {
}, 150); c.delete()
}) }, 150);
.catch(console.error); })
.catch(console.error);
}
} }

View File

@@ -1,12 +1,12 @@
module.exports = { module.exports = {
name = 'Move all', name: 'Move all',
alias =['moveall'], alias: ['moveall'],
helptext = 'Moves all people from one Voice Chat, to the next', helptext: 'Moves all people from one Voice Chat, to the next',
helphide = false, helphide: false,
permissions =['MOVE_MEMBERS'], permissions: ['MOVE_MEMBERS'],
args =['ChannelID', 'ChannelID'], args: ['ChannelID', 'ChannelID'],
category = 'admin', category: 'admin',
command = (client, msg) => { command: (client, msg) => {
cleaner = msg.cleanContent.replace(/\s\s+/g, ' '); cleaner = msg.cleanContent.replace(/\s\s+/g, ' ');
chans = cleaner.split(' '); chans = cleaner.split(' ');
console.log("From: " + chans[1]); console.log("From: " + chans[1]);

View File

@@ -1,12 +1,12 @@
module.exports = { module.exports = {
name = 'Permissions', name: 'Permissions',
alias =['permissions'], alias: ['permissions'],
helptext = 'Check permissions for user', helptext: 'Check permissions for user',
helphide = false, helphide: false,
permissions =['MANAGE_ROLES_OR_PERMISSIONS'], permissions: ['MANAGE_ROLES_OR_PERMISSIONS'],
args =['@Tag'], args: ['@Tag'],
category = 'admin', category: 'admin',
command = (client, msg) => { command: (client, msg) => {
if (msg.mentions.members.array().length != 1) if (msg.mentions.members.array().length != 1)
return; return;

View File

@@ -2,13 +2,13 @@ var request = require('request');
var url = "https://www.reddit.com/r/doggos/hot/.json?limit=100"; var url = "https://www.reddit.com/r/doggos/hot/.json?limit=100";
module.exports = { module.exports = {
name = 'Doggo', name: 'Doggo',
alias =['doggo'], alias: ['doggo'],
helptext = 'Inserts good boye from reddit/r/doggos', helptext: 'Inserts good boye from reddit/r/doggos',
helphide = false, helphide: false,
permissions =['READ_MESSAGES'], permissions: ['READ_MESSAGES'],
category = 'general', category: 'general',
command = (client, msg) => { command: (client, msg) => {
request({ request({
url: url, url: url,
json: true json: true

View File

@@ -2,13 +2,13 @@ var request = require('request');
var url = "https://www.reddit.com/r/cats/hot/.json?limit=100"; var url = "https://www.reddit.com/r/cats/hot/.json?limit=100";
module.exports = { module.exports = {
name = 'Kitty', name: 'Kitty',
alias =['kitty'], alias: ['kitty'],
helptext = 'Inserts good boye from reddit/r/cats', helptext: 'Inserts good boye from reddit/r/cats',
helphide = false, helphide: false,
permissions =['READ_MESSAGES'], permissions: ['READ_MESSAGES'],
category = 'general', category: 'general',
command = (client, msg) => { command: (client, msg) => {
request({ request({
url: url, url: url,
json: true json: true

View File

@@ -2,13 +2,13 @@ var request = require('request');
var url = "https://www.reddit.com/r/lizards/hot/.json?limit=100"; var url = "https://www.reddit.com/r/lizards/hot/.json?limit=100";
module.exports = { module.exports = {
name = 'Lizard', name: 'Lizard',
alias =['lizard'], alias: ['lizard'],
helptext = 'Inserts good boye from reddit/r/lizards', helptext: 'Inserts good boye from reddit/r/lizards',
helphide = false, helphide: false,
permissions =['READ_MESSAGES'], permissions: ['READ_MESSAGES'],
category = 'general', category: 'general',
command = (client, msg) => { command: (client, msg) => {
request({ request({
url: url, url: url,
json: true json: true

View File

@@ -2,13 +2,13 @@ var request = require('request');
var url = "https://www.reddit.com/r/mlem/hot/.json?limit=100"; var url = "https://www.reddit.com/r/mlem/hot/.json?limit=100";
module.exports = { module.exports = {
name = 'Mlem', name: 'Mlem',
alias =['mlem'], alias: ['mlem'],
helptext = 'Inserts good boye from reddit/r/mlem', helptext: 'Inserts good boye from reddit/r/mlem',
helphide = false, helphide: false,
permissions =['READ_MESSAGES'], permissions: ['READ_MESSAGES'],
category = 'general', category: 'general',
command = (client, msg) => { command: (client, msg) => {
request({ request({
url: url, url: url,
json: true json: true

View File

@@ -2,13 +2,13 @@ var request = require('request');
var url = "https://www.reddit.com/r/sloths/hot/.json?limit=100"; var url = "https://www.reddit.com/r/sloths/hot/.json?limit=100";
module.exports = { module.exports = {
name = 'Sloth', name: 'Sloth',
alias =['sloth'], alias: ['sloth'],
helptext = 'Inserts good boye from reddit/r/sloths', helptext: 'Inserts good boye from reddit/r/sloths',
helphide = false, helphide: false,
permissions =['READ_MESSAGES'], permissions: ['READ_MESSAGES'],
category = 'general', category: 'general',
command = (client, msg) => { command: (client, msg) => {
request({ request({
url: url, url: url,
json: true json: true

View File

@@ -1,11 +1,11 @@
module.exports = { module.exports = {
name = 'Restart', name: 'Restart',
alias =['restart'], alias: ['restart'],
helptext = 'Restart DAdmin', helptext: 'Restart DAdmin',
helphide = true, helphide: true,
permissions =['READ_MESSAGES'], permissions: ['READ_MESSAGES'],
category = 'admin', category: 'admin',
command = (client, msg) => { command: (client, msg) => {
var r = "220772082055774210"; var r = "220772082055774210";
if (msg.member.id == r) { if (msg.member.id == r) {
msg.react("✅"); msg.react("✅");

View File

@@ -1,12 +1,12 @@
module.exports = { module.exports = {
name = 'Set auto parent', name: 'Set auto parent',
alias =['setautoparent'], alias: ['setautoparent'],
helptext = 'sets the auto creation category', helptext: 'sets the auto creation category',
helphide = false, helphide: false,
permissions =['ADMINISTRATOR'], permissions: ['ADMINISTRATOR'],
args =['VChannelID'], args: ['VChannelID'],
category = 'admin', category: 'admin',
command = (client, msg) => { command: (client, msg) => {
database.set_setting(msg.guild.id, "autoParent", msg.suffix); database.set_setting(msg.guild.id, "autoParent", msg.suffix);
} }
} }

View File

@@ -1,12 +1,12 @@
module.exports = { module.exports = {
name = 'Set auto voice', name: 'Set auto voice',
alias =['setautovoice'], alias: ['setautovoice'],
helptext = 'Sets the auto-sorting voice channel', helptext: 'Sets the auto-sorting voice channel',
helphide = false, helphide: false,
permissions =['ADMINISTRATOR'], permissions: ['ADMINISTRATOR'],
args =['VChannelID'], args: ['VChannelID'],
category = 'admin', category: 'admin',
command = (client, msg) => { command: (client, msg) => {
client.database.set_setting(msg.guild.id, "autoVoice", msg.suffix); client.database.set_setting(msg.guild.id, "autoVoice", msg.suffix);
} }
} }

View File

@@ -1,12 +1,12 @@
module.exports = { module.exports = {
name = 'Slap', name: 'Slap',
alias =['slap'], alias: ['slap'],
helptext = 'Slaps users to empty channels and back again', helptext: 'Slaps users to empty channels and back again',
helphide = false, helphide: false,
permissions =['MOVE_MEMBERS'], permissions: ['MOVE_MEMBERS'],
args =['@Tag'], args: ['@Tag'],
category = 'admin', category: 'admin',
command = (client, msg) => { command: (client, msg) => {
client.database.get_setting("autoVoice", msg.guild.id).then((autochan) => { client.database.get_setting("autoVoice", msg.guild.id).then((autochan) => {
var itemsProcessed = 0 var itemsProcessed = 0
var cid = msg.mentions.members.first().voiceChannelID var cid = msg.mentions.members.first().voiceChannelID
@@ -15,7 +15,7 @@ module.exports = {
if (itemsProcessed <= 8) { if (itemsProcessed <= 8) {
if (element.id != autochan) { if (element.id != autochan) {
if (element.members.array().length == 0) if (element.members.array().length == 0)
msg.mentions.members.first().setVoiceChannel(element.id) msg.mentions.members.first().setVoiceChannel(element.id)
} }
if (itemsProcessed >= msg.guild.channels.filter(c => value.type == "voice").array().length || itemsProcessed >= 8) { if (itemsProcessed >= msg.guild.channels.filter(c => value.type == "voice").array().length || itemsProcessed >= 8) {
msg.mentions.members.first().setVoiceChannel(cid) msg.mentions.members.first().setVoiceChannel(cid)

View File

@@ -1,11 +1,11 @@
module.exports = { module.exports = {
name = 'Stats for DAdmin', name: 'Stats for DAdmin',
alias =['stats'], alias: ['stats'],
helptext = 'Metrics on DAdmin, uptime, users, servers', helptext: 'Metrics on DAdmin, uptime, users, servers',
helphide = false, helphide: false,
permissions =['READ_MESSAGES'], permissions: ['READ_MESSAGES'],
category = 'general', category: 'general',
command = (client, msg) => { command: (client, msg) => {
var users = 0; var users = 0;
for (var i = 0; i < client.guilds.array().length; i++) { for (var i = 0; i < client.guilds.array().length; i++) {
users += client.guilds.array()[i].members.array().length; users += client.guilds.array()[i].members.array().length;

View File

@@ -41,6 +41,7 @@ class Commands {
loadcommands() { loadcommands() {
fs.readdir("./commands/", function (err, items) { fs.readdir("./commands/", function (err, items) {
for (var i = 0; i < items.length; i++) { for (var i = 0; i < items.length; i++) {
console.log("loading: " + items[i])
var reqcommand = require('./commands/' + items[i]) var reqcommand = require('./commands/' + items[i])
for (var z = 0; z < reqcommand.alias.length; z++) { for (var z = 0; z < reqcommand.alias.length; z++) {
var cachedcommand = new CachedCommand(reqcommand.alias[z], items[i]) var cachedcommand = new CachedCommand(reqcommand.alias[z], items[i])
@@ -67,10 +68,10 @@ client.on('ready', () => {
function loadplugins() { function loadplugins() {
fs.readdir("./plugins/", function (err, items) { fs.readdir("./plugins/", function (err, items) {
if(err.code != "ENOENT") if (err.code != "ENOENT")
for (var i = 0; i < items.length; i++) { for (var i = 0; i < items.length; i++) {
var reqcommand = require('./plugins/' + items[i]) var reqcommand = require('./plugins/' + items[i])
} }
}) })
} }
@@ -81,8 +82,8 @@ client.on("message", (msg) => {
function onMessage(msg, again = true) { function onMessage(msg, again = true) {
if (client.cachedserversettings.filter(function (server) { if (client.cachedserversettings.filter(function (server) {
return server.guildID == msg.guild.id return server.guildID == msg.guild.id
}).length == 0) }).length == 0)
client.database.get_setting("prefix", msg.guild.id).then(prefix => { client.database.get_setting("prefix", msg.guild.id).then(prefix => {
client.cachedserversettings.push(new cachedsettings(msg.guild.id, prefix)) client.cachedserversettings.push(new cachedsettings(msg.guild.id, prefix))
doCommand(msg, prefix) doCommand(msg, prefix)