mirror of
https://github.com/litruv/DAdmin.git
synced 2026-07-24 10:46:14 +10:00
cleaned up anagram.js, combined module exports.
This commit is contained in:
@@ -1,31 +1,32 @@
|
|||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const Discord = require('discord.js')
|
const Discord = require('discord.js')
|
||||||
var request = require('request');
|
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) => {
|
||||||
|
|
||||||
exports.name = "Anagram Finder"
|
var url = "http://www.anagramica.com/best/:"
|
||||||
exports.alias = ['anagram', 'nagaram']
|
|
||||||
exports.helptext = "finds anagrams up to 9 letters"
|
|
||||||
exports.permissions = ['VIEW_CHANNEL']
|
|
||||||
exports.args = ['letters']
|
|
||||||
exports.command = (client, msg) => {
|
|
||||||
|
|
||||||
var url = "http://www.anagramica.com/best/:";
|
if (msg.suffix.length > 9) {
|
||||||
|
msg.reply("That anagram is too long. Max 9 Letters.")
|
||||||
if (msg.suffix.length > 9){
|
|
||||||
msg.reply("That anagram is too long. Max 9 Letters.");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
request({
|
request({
|
||||||
url: url + msg.suffix,
|
url: url + msg.suffix,
|
||||||
json: true
|
json: true
|
||||||
}, function (error, response, body) {
|
}, (error, response, body) => {
|
||||||
if (!error && response.statusCode === 200) {
|
if (!error && response.statusCode === 200) {
|
||||||
var replystring = "";
|
var replystring = ""
|
||||||
for (i = 0; i < body.best.length; i++)
|
for (i = 0; i < body.best.length; i++)
|
||||||
replystring += body.best[i] + ', ';
|
replystring += body.best[i] + ', '
|
||||||
msg.reply(replystring.substr(0, replystring.length - 2)); // Print the json response
|
msg.reply(replystring.substr(0, replystring.length - 2))
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
exports.name = "Change <@476369946386104330>'s Name"
|
module.exports = {
|
||||||
exports.alias = ['botname']
|
name = "Change <@476369946386104330>'s Name",
|
||||||
exports.helptext = "Changes the bots name on the server"
|
alias =['botname'],
|
||||||
exports.permissions = ["MANAGE_NICKNAMES"]
|
helptext = "Changes the bots name on the server",
|
||||||
exports.args = ["new-name"]
|
permissions =["MANAGE_NICKNAMES"],
|
||||||
exports.category = 'admin'
|
args =["new-name"],
|
||||||
exports.command = (client, msg) => {
|
category = 'admin',
|
||||||
|
command = (client, msg) => {
|
||||||
msg.guild.me.setNickname(msg.suffix);
|
msg.guild.me.setNickname(msg.suffix);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
exports.name = "Change Prefix"
|
module.exports = {
|
||||||
exports.alias = ['changeprefix','prefix']
|
name = "Change Prefix",
|
||||||
exports.helptext = "Changes the bots prefix for the server"
|
alias =['changeprefix', 'prefix'],
|
||||||
exports.permissions = ["ADMINISTRATOR"]
|
helptext = "Changes the bots prefix for the server",
|
||||||
exports.category = 'admin'
|
permissions =["ADMINISTRATOR"],
|
||||||
exports.args = ["new-prefix"]
|
category = 'admin',
|
||||||
exports.command = (client, msg) => {
|
args =["new-prefix"],
|
||||||
|
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;
|
||||||
@@ -13,4 +14,5 @@ exports.command = (client, msg) => {
|
|||||||
client.cachedserversettings.filter(function (server) {
|
client.cachedserversettings.filter(function (server) {
|
||||||
return server.guildID == msg.guild.id;
|
return server.guildID == msg.guild.id;
|
||||||
})[0].prefix = msg.suffix;
|
})[0].prefix = msg.suffix;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
exports.name = "Clear Messages"
|
module.exports = {
|
||||||
exports.alias = ['clear']
|
name = "Clear Messages",
|
||||||
exports.helptext = "Clears messages from the channel"
|
alias =['clear'],
|
||||||
exports.helphide = false
|
helptext = "Clears messages from the channel",
|
||||||
exports.permissions = ['VIEW_CHANNEL']
|
helphide = false,
|
||||||
exports.args = ['number']
|
permissions =['VIEW_CHANNEL'],
|
||||||
exports.category = 'admin'
|
args =['number'],
|
||||||
|
category = 'admin',
|
||||||
exports.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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
exports.name = 'Self Diagnosis'
|
module.exports = {
|
||||||
exports.alias = ['diagnose', 'webmd']
|
name = 'Self Diagnosis',
|
||||||
exports.helptext = 'What cancer do you have today?'
|
alias =['diagnose', 'webmd'],
|
||||||
exports.helphide = false
|
helptext = 'What cancer do you have today?',
|
||||||
exports.permissions = ['READ_MESSAGES']
|
helphide = false,
|
||||||
exports.category = 'general'
|
permissions =['READ_MESSAGES'],
|
||||||
exports.command = (client, msg) => {
|
category = 'general',
|
||||||
switch(getRandomInt(0,25)) {
|
command = (client, msg) => {
|
||||||
|
switch (getRandomInt(0, 25)) {
|
||||||
case 0:
|
case 0:
|
||||||
msg.reply("I'm sorry, It's Cancer.");
|
msg.reply("I'm sorry, It's Cancer.");
|
||||||
break;
|
break;
|
||||||
@@ -85,10 +86,11 @@ exports.command = (client, msg) => {
|
|||||||
msg.reply("I'm sorry, It's Bipolar Mood Disorder.");
|
msg.reply("I'm sorry, It's Bipolar Mood Disorder.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRandomInt(min, max) {
|
function getRandomInt(min, max) {
|
||||||
min = Math.ceil(min);
|
min = Math.ceil(min);
|
||||||
max = Math.floor(max);
|
max = Math.floor(max);
|
||||||
return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive
|
return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
exports.name = "Emote Page Test"
|
module.exports = {
|
||||||
exports.alias = ['emotetest']
|
name = "Emote Page Test",
|
||||||
exports.helptext = "testing for emote responses"
|
alias =['emotetest'],
|
||||||
exports.helphide = true;
|
helptext = "testing for emote responses",
|
||||||
exports.command = (client, msg) => {
|
helphide = true;,
|
||||||
|
command = (client, msg) => {
|
||||||
|
|
||||||
msg.reply ("testing emote thing")
|
msg.reply("testing emote thing")
|
||||||
.then(sent => {
|
.then(sent => {
|
||||||
sent.react('555213405217226776').then(
|
sent.react('555213405217226776').then(
|
||||||
() => message.react('555213429200388116'));
|
() => message.react('555213429200388116'));
|
||||||
@@ -15,4 +16,5 @@ exports.command = (client, msg) => {
|
|||||||
.catch(console.error);
|
.catch(console.error);
|
||||||
})
|
})
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
exports.name = 'Get auto parent'
|
module.exports = {
|
||||||
exports.alias = ['getautoparent']
|
name = 'Get auto parent',
|
||||||
exports.helptext = 'gets the auto creation channel'
|
alias =['getautoparent'],
|
||||||
exports.helphide = false
|
helptext = 'gets the auto creation channel',
|
||||||
exports.permissions = ['ADMINISTRATOR']
|
helphide = false,
|
||||||
exports.category = 'admin'
|
permissions =['ADMINISTRATOR'],
|
||||||
exports.command = (client, msg) => {
|
category = 'admin',
|
||||||
|
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}`);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,14 @@
|
|||||||
exports.name = 'Get auto voice'
|
module.exports = {
|
||||||
exports.alias = ['getautovoice']
|
name = 'Get auto voice',
|
||||||
exports.helptext = 'Set the auto-sorting channel'
|
alias =['getautovoice'],
|
||||||
exports.helphide = false
|
helptext = 'Set the auto-sorting channel',
|
||||||
exports.permissions = ['READ_MESSAGES']
|
helphide = false,
|
||||||
exports.category = 'admin'
|
permissions =['READ_MESSAGES'],
|
||||||
exports.command = (client, msg) => {
|
category = 'admin',
|
||||||
|
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}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const Discord = require('discord.js')
|
const Discord = require('discord.js')
|
||||||
|
|
||||||
exports.name = "Help file"
|
module.exports = {
|
||||||
exports.alias = ['help', '?']
|
name = "Help file",
|
||||||
exports.helptext = "Runs this help menu"
|
alias =['help', '?'],
|
||||||
exports.permissions = ['VIEW_CHANNEL']
|
helptext = "Runs this help menu",
|
||||||
exports.args = ['(general)/music/admin']
|
permissions =['VIEW_CHANNEL'],
|
||||||
exports.command = (client, msg) => {
|
args =['(general)/music/admin'],
|
||||||
|
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
|
||||||
@@ -17,10 +16,10 @@ exports.command = (client, msg) => {
|
|||||||
|
|
||||||
var suffix = msg.suffix;
|
var suffix = msg.suffix;
|
||||||
var lookingfor = 0
|
var lookingfor = 0
|
||||||
if (msg.suffix.toLowerCase() == "admin"){
|
if (msg.suffix.toLowerCase() == "admin") {
|
||||||
lookingfor = 1
|
lookingfor = 1
|
||||||
suffix = "admin"
|
suffix = "admin"
|
||||||
} else if (msg.suffix.toLowerCase() == "music"){
|
} else if (msg.suffix.toLowerCase() == "music") {
|
||||||
lookingfor = 2
|
lookingfor = 2
|
||||||
suffix = "music"
|
suffix = "music"
|
||||||
} else {
|
} else {
|
||||||
@@ -30,7 +29,7 @@ exports.command = (client, msg) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var description = "";
|
var description = "";
|
||||||
switch(lookingfor){
|
switch (lookingfor) {
|
||||||
case 0:
|
case 0:
|
||||||
description += "General Commands"
|
description += "General Commands"
|
||||||
break;
|
break;
|
||||||
@@ -50,14 +49,9 @@ exports.command = (client, msg) => {
|
|||||||
continue;
|
continue;
|
||||||
if (reqcommand.category == undefined)
|
if (reqcommand.category == undefined)
|
||||||
reqcommand.category = 'general'
|
reqcommand.category = 'general'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (reqcommand.category != suffix)
|
if (reqcommand.category != suffix)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
description += "**" + reqcommand.name + "** - *" + reqcommand.helptext + "* \n "
|
description += "**" + reqcommand.name + "** - *" + reqcommand.helptext + "* \n "
|
||||||
args = "";
|
args = "";
|
||||||
|
|
||||||
@@ -72,12 +66,12 @@ exports.command = (client, msg) => {
|
|||||||
})[0].prefix
|
})[0].prefix
|
||||||
|
|
||||||
description += reqcommand.alias[z] + " ";
|
description += reqcommand.alias[z] + " ";
|
||||||
if (z != reqcommand.alias.length -1)
|
if (z != reqcommand.alias.length - 1)
|
||||||
description += "/ ";
|
description += "/ ";
|
||||||
}
|
}
|
||||||
|
|
||||||
description += "\n" + args + "```"
|
description += "\n" + args + "```"
|
||||||
if (i != items.length -1)
|
if (i != items.length - 1)
|
||||||
description += "\n";
|
description += "\n";
|
||||||
|
|
||||||
delete require.cache[require.resolve('./' + items[i])]
|
delete require.cache[require.resolve('./' + items[i])]
|
||||||
@@ -88,4 +82,5 @@ exports.command = (client, msg) => {
|
|||||||
msg.channel.send(embed);
|
msg.channel.send(embed);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
var request = require('request');
|
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 = {
|
||||||
exports.name = 'joke'
|
name = 'joke',
|
||||||
exports.alias = ['joke']
|
alias =['joke'],
|
||||||
exports.helptext = 'Fresh dad jokes from reddit.com/r/dadjokes'
|
helptext = 'Fresh dad jokes from reddit.com/r/dadjokes',
|
||||||
exports.helphide = false
|
helphide = false,
|
||||||
exports.permissions = ['READ_MESSAGES']
|
permissions =['READ_MESSAGES'],
|
||||||
exports.category = 'general'
|
category = 'general',
|
||||||
exports.command = (client, msg) => {
|
command = (client, msg) => {
|
||||||
request({
|
request({
|
||||||
url: url,
|
url: url,
|
||||||
json: true
|
json: true
|
||||||
@@ -20,10 +20,11 @@ exports.command = (client, msg) => {
|
|||||||
msg.reply(body.data.children[jokenumber].data.title + " " + body.data.children[jokenumber].data.selftext); // Print the json response
|
msg.reply(body.data.children[jokenumber].data.title + " " + body.data.children[jokenumber].data.selftext); // Print the json response
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRandomInt(min, max) {
|
function getRandomInt(min, max) {
|
||||||
min = Math.ceil(min);
|
min = Math.ceil(min);
|
||||||
max = Math.floor(max);
|
max = Math.floor(max);
|
||||||
return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive
|
return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
exports.name = 'Move all'
|
module.exports = {
|
||||||
exports.alias = ['moveall']
|
name = 'Move all',
|
||||||
exports.helptext = 'Moves all people from one Voice Chat, to the next'
|
alias =['moveall'],
|
||||||
exports.helphide = false
|
helptext = 'Moves all people from one Voice Chat, to the next',
|
||||||
exports.permissions = ['MOVE_MEMBERS']
|
helphide = false,
|
||||||
exports.args = ['ChannelID', 'ChannelID']
|
permissions =['MOVE_MEMBERS'],
|
||||||
exports.category = 'admin'
|
args =['ChannelID', 'ChannelID'],
|
||||||
exports.command = (client, msg) => {
|
category = 'admin',
|
||||||
|
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]);
|
||||||
@@ -13,4 +14,5 @@ exports.command = (client, msg) => {
|
|||||||
m.setVoiceChannel(chans[2]);
|
m.setVoiceChannel(chans[2]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
exports.name = 'Permissions'
|
module.exports = {
|
||||||
exports.alias = ['permissions']
|
name = 'Permissions',
|
||||||
exports.helptext = 'Check permissions for user'
|
alias =['permissions'],
|
||||||
exports.helphide = false
|
helptext = 'Check permissions for user',
|
||||||
exports.permissions = ['MANAGE_ROLES_OR_PERMISSIONS']
|
helphide = false,
|
||||||
exports.args = ['@Tag']
|
permissions =['MANAGE_ROLES_OR_PERMISSIONS'],
|
||||||
exports.category = 'admin'
|
args =['@Tag'],
|
||||||
exports.command = (client, msg) => {
|
category = 'admin',
|
||||||
if(msg.mentions.members.array().length != 1)
|
command = (client, msg) => {
|
||||||
|
if (msg.mentions.members.array().length != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var perms = msg.mentions.members.first().permissions.toArray(true);
|
var perms = msg.mentions.members.first().permissions.toArray(true);
|
||||||
@@ -14,8 +15,9 @@ exports.command = (client, msg) => {
|
|||||||
var message = "";
|
var message = "";
|
||||||
for (var i = 0; i < perms.length; i++) {
|
for (var i = 0; i < perms.length; i++) {
|
||||||
message += perms[i];
|
message += perms[i];
|
||||||
if (i != perms.length -1)
|
if (i != perms.length - 1)
|
||||||
message += ", ";
|
message += ", ";
|
||||||
}
|
}
|
||||||
msg.reply(message);
|
msg.reply(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
var request = require('request');
|
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";
|
||||||
|
|
||||||
exports.name = 'Doggo'
|
module.exports = {
|
||||||
exports.alias = ['doggo']
|
name = 'Doggo',
|
||||||
exports.helptext = 'Inserts good boye from reddit/r/doggos'
|
alias =['doggo'],
|
||||||
exports.helphide = false
|
helptext = 'Inserts good boye from reddit/r/doggos',
|
||||||
exports.permissions = ['READ_MESSAGES']
|
helphide = false,
|
||||||
exports.category = 'general'
|
permissions =['READ_MESSAGES'],
|
||||||
exports.command = (client, msg) => {
|
category = 'general',
|
||||||
|
command = (client, msg) => {
|
||||||
request({
|
request({
|
||||||
url: url,
|
url: url,
|
||||||
json: true
|
json: true
|
||||||
@@ -16,14 +17,14 @@ exports.command = (client, msg) => {
|
|||||||
var sent = false;
|
var sent = false;
|
||||||
while (!sent) {
|
while (!sent) {
|
||||||
var jokenumber = getRandomInt(1, 25);
|
var jokenumber = getRandomInt(1, 25);
|
||||||
if (body.data.children[jokenumber].data.url.endsWith(".jpg"))
|
if (body.data.children[jokenumber].data.url.endsWith(".jpg")) {
|
||||||
{
|
msg.channel.send({ file: body.data.children[jokenumber].data.url });
|
||||||
msg.channel.send({file:body.data.children[jokenumber].data.url});
|
|
||||||
sent = true;
|
sent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRandomInt(min, max) {
|
function getRandomInt(min, max) {
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
var request = require('request');
|
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";
|
||||||
|
|
||||||
exports.name = 'Kitty'
|
module.exports = {
|
||||||
exports.alias = ['kitty']
|
name = 'Kitty',
|
||||||
exports.helptext = 'Inserts good boye from reddit/r/cats'
|
alias =['kitty'],
|
||||||
exports.helphide = false
|
helptext = 'Inserts good boye from reddit/r/cats',
|
||||||
exports.permissions = ['READ_MESSAGES']
|
helphide = false,
|
||||||
exports.category = 'general'
|
permissions =['READ_MESSAGES'],
|
||||||
exports.command = (client, msg) => {
|
category = 'general',
|
||||||
|
command = (client, msg) => {
|
||||||
request({
|
request({
|
||||||
url: url,
|
url: url,
|
||||||
json: true
|
json: true
|
||||||
@@ -16,14 +17,14 @@ exports.command = (client, msg) => {
|
|||||||
var sent = false;
|
var sent = false;
|
||||||
while (!sent) {
|
while (!sent) {
|
||||||
var jokenumber = getRandomInt(1, 25);
|
var jokenumber = getRandomInt(1, 25);
|
||||||
if (body.data.children[jokenumber].data.url.endsWith(".jpg"))
|
if (body.data.children[jokenumber].data.url.endsWith(".jpg")) {
|
||||||
{
|
msg.channel.send({ file: body.data.children[jokenumber].data.url });
|
||||||
msg.channel.send({file:body.data.children[jokenumber].data.url});
|
|
||||||
sent = true;
|
sent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRandomInt(min, max) {
|
function getRandomInt(min, max) {
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
var request = require('request');
|
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";
|
||||||
|
|
||||||
exports.name = 'Lizard'
|
module.exports = {
|
||||||
exports.alias = ['lizard']
|
name = 'Lizard',
|
||||||
exports.helptext = 'Inserts good boye from reddit/r/lizards'
|
alias =['lizard'],
|
||||||
exports.helphide = false
|
helptext = 'Inserts good boye from reddit/r/lizards',
|
||||||
exports.permissions = ['READ_MESSAGES']
|
helphide = false,
|
||||||
exports.category = 'general'
|
permissions =['READ_MESSAGES'],
|
||||||
exports.command = (client, msg) => {
|
category = 'general',
|
||||||
|
command = (client, msg) => {
|
||||||
request({
|
request({
|
||||||
url: url,
|
url: url,
|
||||||
json: true
|
json: true
|
||||||
@@ -16,14 +17,14 @@ exports.command = (client, msg) => {
|
|||||||
var sent = false;
|
var sent = false;
|
||||||
while (!sent) {
|
while (!sent) {
|
||||||
var jokenumber = getRandomInt(1, 25);
|
var jokenumber = getRandomInt(1, 25);
|
||||||
if (body.data.children[jokenumber].data.url.endsWith(".jpg"))
|
if (body.data.children[jokenumber].data.url.endsWith(".jpg")) {
|
||||||
{
|
msg.channel.send({ file: body.data.children[jokenumber].data.url });
|
||||||
msg.channel.send({file:body.data.children[jokenumber].data.url});
|
|
||||||
sent = true;
|
sent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRandomInt(min, max) {
|
function getRandomInt(min, max) {
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
var request = require('request');
|
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";
|
||||||
|
|
||||||
exports.name = 'Mlem'
|
module.exports = {
|
||||||
exports.alias = ['mlem']
|
name = 'Mlem',
|
||||||
exports.helptext = 'Inserts good boye from reddit/r/mlem'
|
alias =['mlem'],
|
||||||
exports.helphide = false
|
helptext = 'Inserts good boye from reddit/r/mlem',
|
||||||
exports.permissions = ['READ_MESSAGES']
|
helphide = false,
|
||||||
exports.category = 'general'
|
permissions =['READ_MESSAGES'],
|
||||||
exports.command = (client, msg) => {
|
category = 'general',
|
||||||
|
command = (client, msg) => {
|
||||||
request({
|
request({
|
||||||
url: url,
|
url: url,
|
||||||
json: true
|
json: true
|
||||||
@@ -16,14 +17,14 @@ exports.command = (client, msg) => {
|
|||||||
var sent = false;
|
var sent = false;
|
||||||
while (!sent) {
|
while (!sent) {
|
||||||
var jokenumber = getRandomInt(1, 25);
|
var jokenumber = getRandomInt(1, 25);
|
||||||
if (body.data.children[jokenumber].data.url.endsWith(".jpg"))
|
if (body.data.children[jokenumber].data.url.endsWith(".jpg")) {
|
||||||
{
|
msg.channel.send({ file: body.data.children[jokenumber].data.url });
|
||||||
msg.channel.send({file:body.data.children[jokenumber].data.url});
|
|
||||||
sent = true;
|
sent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRandomInt(min, max) {
|
function getRandomInt(min, max) {
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
var request = require('request');
|
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";
|
||||||
|
|
||||||
exports.name = 'Sloth'
|
module.exports = {
|
||||||
exports.alias = ['sloth']
|
name = 'Sloth',
|
||||||
exports.helptext = 'Inserts good boye from reddit/r/sloths'
|
alias =['sloth'],
|
||||||
exports.helphide = false
|
helptext = 'Inserts good boye from reddit/r/sloths',
|
||||||
exports.permissions = ['READ_MESSAGES']
|
helphide = false,
|
||||||
exports.category = 'general'
|
permissions =['READ_MESSAGES'],
|
||||||
exports.command = (client, msg) => {
|
category = 'general',
|
||||||
|
command = (client, msg) => {
|
||||||
request({
|
request({
|
||||||
url: url,
|
url: url,
|
||||||
json: true
|
json: true
|
||||||
@@ -16,14 +17,14 @@ exports.command = (client, msg) => {
|
|||||||
var sent = false;
|
var sent = false;
|
||||||
while (!sent) {
|
while (!sent) {
|
||||||
var jokenumber = getRandomInt(1, 25);
|
var jokenumber = getRandomInt(1, 25);
|
||||||
if (body.data.children[jokenumber].data.url.endsWith(".jpg"))
|
if (body.data.children[jokenumber].data.url.endsWith(".jpg")) {
|
||||||
{
|
msg.channel.send({ file: body.data.children[jokenumber].data.url });
|
||||||
msg.channel.send({file:body.data.children[jokenumber].data.url});
|
|
||||||
sent = true;
|
sent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRandomInt(min, max) {
|
function getRandomInt(min, max) {
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
exports.name = 'Restart'
|
module.exports = {
|
||||||
exports.alias = ['restart']
|
name = 'Restart',
|
||||||
exports.helptext = 'Restart DAdmin'
|
alias =['restart'],
|
||||||
exports.helphide = true
|
helptext = 'Restart DAdmin',
|
||||||
exports.permissions = ['READ_MESSAGES']
|
helphide = true,
|
||||||
exports.category = 'admin'
|
permissions =['READ_MESSAGES'],
|
||||||
exports.command = (client, msg) => {
|
category = 'admin',
|
||||||
|
command = (client, msg) => {
|
||||||
var r = "220772082055774210";
|
var r = "220772082055774210";
|
||||||
if (msg.member.id == r) {
|
if (msg.member.id == r) {
|
||||||
msg.react("✅");
|
msg.react("✅");
|
||||||
@@ -15,4 +16,5 @@ exports.command = (client, msg) => {
|
|||||||
} else {
|
} else {
|
||||||
msg.react("❌");
|
msg.react("❌");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
exports.name = 'Set auto parent'
|
module.exports = {
|
||||||
exports.alias = ['setautoparent']
|
name = 'Set auto parent',
|
||||||
exports.helptext = 'sets the auto creation category'
|
alias =['setautoparent'],
|
||||||
exports.helphide = false
|
helptext = 'sets the auto creation category',
|
||||||
exports.permissions = ['ADMINISTRATOR']
|
helphide = false,
|
||||||
exports.args = ['VChannelID']
|
permissions =['ADMINISTRATOR'],
|
||||||
exports.category = 'admin'
|
args =['VChannelID'],
|
||||||
exports.command = (client, msg) => {
|
category = 'admin',
|
||||||
|
command = (client, msg) => {
|
||||||
database.set_setting(msg.guild.id, "autoParent", msg.suffix);
|
database.set_setting(msg.guild.id, "autoParent", msg.suffix);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
exports.name = 'Set auto voice'
|
module.exports = {
|
||||||
exports.alias = ['setautovoice']
|
name = 'Set auto voice',
|
||||||
exports.helptext = 'Sets the auto-sorting voice channel'
|
alias =['setautovoice'],
|
||||||
exports.helphide = false
|
helptext = 'Sets the auto-sorting voice channel',
|
||||||
exports.permissions = ['ADMINISTRATOR']
|
helphide = false,
|
||||||
exports.args = ['VChannelID']
|
permissions =['ADMINISTRATOR'],
|
||||||
exports.category = 'admin'
|
args =['VChannelID'],
|
||||||
exports.command = (client, msg) => {
|
category = 'admin',
|
||||||
|
command = (client, msg) => {
|
||||||
client.database.set_setting(msg.guild.id, "autoVoice", msg.suffix);
|
client.database.set_setting(msg.guild.id, "autoVoice", msg.suffix);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,33 +1,28 @@
|
|||||||
exports.name = 'Slap'
|
module.exports = {
|
||||||
exports.alias = ['slap']
|
name = 'Slap',
|
||||||
exports.helptext = 'Slaps users to empty channels and back again'
|
alias =['slap'],
|
||||||
exports.helphide = false
|
helptext = 'Slaps users to empty channels and back again',
|
||||||
exports.permissions = ['MOVE_MEMBERS']
|
helphide = false,
|
||||||
exports.args = ['@Tag']
|
permissions =['MOVE_MEMBERS'],
|
||||||
exports.category = 'admin'
|
args =['@Tag'],
|
||||||
exports.command = (client, msg) => {
|
category = 'admin',
|
||||||
|
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
|
||||||
|
msg.guild.channels.filter(c => value.type == "voice").forEach(element => {
|
||||||
msg.guild.channels.filter(isVoice).forEach(element => {
|
itemsProcessed++
|
||||||
itemsProcessed++;
|
|
||||||
|
|
||||||
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) {
|
||||||
|
msg.mentions.members.first().setVoiceChannel(cid)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
if (itemsProcessed >= msg.guild.channels.filter(isVoice).array().length || itemsProcessed >= 8) {
|
|
||||||
msg.mentions.members.first().setVoiceChannel(cid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function isVoice(value) {
|
|
||||||
return value.type == "voice";
|
|
||||||
}
|
}
|
||||||
@@ -1,25 +1,23 @@
|
|||||||
exports.name = 'Stats for DAdmin'
|
module.exports = {
|
||||||
exports.alias = ['stats']
|
name = 'Stats for DAdmin',
|
||||||
exports.helptext = 'Metrics on DAdmin, uptime, users, servers'
|
alias =['stats'],
|
||||||
exports.helphide = false
|
helptext = 'Metrics on DAdmin, uptime, users, servers',
|
||||||
exports.permissions = ['READ_MESSAGES']
|
helphide = false,
|
||||||
exports.category = 'general'
|
permissions =['READ_MESSAGES'],
|
||||||
exports.command = (client, msg) => {
|
category = 'general',
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg.reply("Running DAdmin for " + millisecondsToStr(client.uptime) + " on " + client.guilds.array().length + " servers for " + users + " users, since 09 Aug 2018");
|
msg.reply("Running DAdmin for " + millisecondsToStr(client.uptime) + " on " + client.guilds.array().length + " servers for " + users + " users, since 09 Aug 2018");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function millisecondsToStr(milliseconds) {
|
||||||
|
|
||||||
function millisecondsToStr (milliseconds) {
|
function numberEnding(number) {
|
||||||
// TIP: to find current time in milliseconds, use:
|
|
||||||
// var current_time_milliseconds = new Date().getTime();
|
|
||||||
|
|
||||||
function numberEnding (number) {
|
|
||||||
return (number > 1) ? 's' : '';
|
return (number > 1) ? 's' : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,4 +45,3 @@ function millisecondsToStr (milliseconds) {
|
|||||||
}
|
}
|
||||||
return 'less than a second'; //'just now' //or other string you like;
|
return 'less than a second'; //'just now' //or other string you like;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user