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"
exports.alias = ['clear']
exports.helptext = "helpmessage"
exports.helphide = false
exports.permissions = ['READ_MESSAGES']
exports.args = ['template']
exports.category = 'general'
exports.command = (client, msg) => {}
module.exports = {
name: "name",
alias: ['clear'],
helptext: "helpmessage",
helphide: false,
permissions: ['READ_MESSAGES'],
args: ['template'],
category: 'general',
command: (client, msg) => { }
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -2,12 +2,12 @@ const fs = require('fs')
const Discord = require('discord.js')
module.exports = {
name = "Help file",
alias =['help', '?'],
helptext = "Runs this help menu",
permissions =['VIEW_CHANNEL'],
args =['(general)/music/admin'],
command = (client, msg) => {
name: "Help file",
alias: ['help', '?'],
helptext: "Runs this help menu",
permissions: ['VIEW_CHANNEL'],
args: ['(general)/music/admin'],
command: (client, msg) => {
fs.readdir("./commands/", function (err, items) {
var embed = new Discord.RichEmbed
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";
module.exports = {
name = 'joke',
alias =['joke'],
helptext = 'Fresh dad jokes from reddit.com/r/dadjokes',
helphide = false,
permissions =['READ_MESSAGES'],
category = 'general',
command = (client, msg) => {
name: 'joke',
alias: ['joke'],
helptext: 'Fresh dad jokes from reddit.com/r/dadjokes',
helphide: false,
permissions: ['READ_MESSAGES'],
category: 'general',
command: (client, msg) => {
request({
url: url,
json: true

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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