Updated to 1.1.0

This commit is contained in:
Emily 2020-03-09 12:11:33 +11:00
parent 95639872bd
commit 0874cbc450
80 changed files with 1067 additions and 6381 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
node_modules
data
config.js
package-lock.json

View file

View file

@ -8,7 +8,7 @@ Self hosting is generally not recommended, but instructions are provided below i
# Requirements
- git
- node.js v8.0.0 or higher
- node.js v12.0.0 or higher
- node-gyp build tools
- ffmpeg

5623
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,49 +1,42 @@
{
"name": "woomy",
"version": "0.5.0",
"description": "Discord bot made with <3 by mudkipscience#0001",
"main": "woomy.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node woomy.js"
"version": "1.1.0",
"description": "Woomy is a all-purpose discord bot built off the guidebot base and coded in node.js using discord.js.",
"main": "index.js",
"dependencies": {
"better-sqlite3": "^5.4.1",
"chalk": "^3.0.0",
"dblapi.js": "^2.3.1",
"discord.js": "^12.0.1",
"enmap": "^5.2.4",
"garfield": "^1.1.2",
"get-youtube-id": "^1.0.1",
"hastebin-gen": "^2.0.5",
"moment": "^2.24.0",
"moment-duration-format": "^2.3.2",
"prism-media": "^1.2.1",
"randomcolor": "^0.5.4",
"request": "^2.88.2",
"relevant-urban": "^2.0.0",
"urban": "^0.3.2",
"url-unshort": "^5.0.0",
"url-unshorten": "^1.0.6",
"weather-js": "^2.0.0",
"youtube-info": "^1.3.2",
"ytdl-core-discord": "^1.1.0"
},
"engines": {
"node": ">=8"
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/mudkipscience/woomy.git"
},
"author": "mudkipscience",
"dependencies": {
"better-sqlite-pool": "^0.2.2",
"chalk": "^2.4.2",
"cpu-stats": "^1.0.0",
"dblapi.js": "^2.3.0",
"discord.js": "^11.5.1",
"enmap": "^4.8.1",
"ffmpeg": "0.0.4",
"ffmpeg-static": "^2.5.0",
"garfield": "^1.1.2",
"get-youtube-id": "^1.0.1",
"moment": "^2.24.0",
"moment-duration-format": "^2.2.2",
"node-opus": "^0.3.2",
"nodemon": "^2.0.2",
"npm": "^6.13.4",
"openweather-apis": "^4.0.0",
"opusscript": "0.0.7",
"prism-media": "^1.2.0",
"randomcolor": "^0.5.4",
"regex": "^0.1.1",
"relevant-urban": "^2.0.0",
"request": "^2.88.0",
"splat2api": "^1.4.0",
"urban": "^0.3.2",
"weather-js": "^2.0.0",
"youtube-info": "^1.3.2",
"yt-search": "^0.4.1",
"ytdl-core": "^0.29.1",
"ytdl-core-discord": "github:amishshah/ytdl-core-discord"
}
"license": "MIT",
"bugs": {
"url": "https://github.com/mudkipscience/woomy/issues"
},
"homepage": "https://github.com/mudkipscience/woomy#readme"
}

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -0,0 +1,4 @@
{
"cisgender": "Someone who identifies with their assigned gender at birth.",
"transgender": "Someone who identifies with a gender that is not their assigned gender at birth."
}

122
resources/other/lyrics.json Normal file
View file

@ -0,0 +1,122 @@
{
"bohemian_rhapsody": [
"Is this the real life?",
"Is this just fantasy?",
"Caught in a landslide, no escape from reality",
"Open your eyes, look up to the skies and see",
"I'm just a poor boy, I need no sympathy",
"Because I'm easy come, easy go, little high, little low",
"Any way the wind blows doesn't really matter to me, to me",
"Mama, just killed a man",
"Put a gun against his head, pulled my trigger, now he's dead",
"Mama, life had just begun",
"But now I've gone and thrown it all away",
"Mama, ooh, didn't mean to make you cry",
"If I'm not back again this time tomorrow",
"Carry on, carry on as if nothing really matters",
"Too late, my time has come",
"sends shivers down my spine, body's aching all the time",
"Goodbye, everybody, I've got to go",
"Gotta leave you all behind and face the truth",
"Mama, ooh, (Anyway the wind blows)",
"I don't wanna die",
"I sometimes wish I'd never been born at all",
"i see a little silhouetto of a man",
"Scaramouche! Scaramouche! will you do the Fandango?",
"Thunderbolt and lightning, very, very fright'ning me",
"(Galileo) Galileo, (Galileo) Galileo, Galileo Figaro magnifico",
"I'm just a poor boy, nobody loves me",
"He's just a poor boy from a poor family",
"spare him his life from this monstrosity",
"Easy come, easy go, will you not let me go?",
"Bismillah! No, we will not let you go",
"(Let him go!) Bismillah! We will not let you go",
"(Let him go!) Bismillah! We will not let you go",
"(Let me go) Will not let you go",
"(Let me go) Will not let you go",
"(Let me go) Ah",
"no, no, no, no, no, no, no",
"(Oh mamma mia, mamma mia) Mamma mia, let me go",
"Beelzebub has the devil put aside for me, for me, for me!",
"So you think you can stone me and spit in my eye?",
"so you think you can love me and leave me to die?",
"Oh baby, can't do this to me, baby!",
"Just gotta get out, just gotta get right outta here!",
"Nothing really matters, anyone can see",
"nothing really matters",
"Nothing really matters, to me",
"any way the wind blows"
],
"creeper": [
"Aw man",
"So we back in the mine",
"Got our pickaxe swinging from side to side",
"Side side to side",
"This task a grueling one",
"Hope to find some diamonds tonight night night",
"Diamonds tonight",
"Heads up",
"You hear a sound turn around and look up",
"Total shock fills your body",
"Oh no it's you again",
"I can never forget those eyes eyes eyes",
"Eyes-eye-eyes",
"Cause baby tonight",
"The creeper's tryna steal all our stuff again",
"Cause baby tonight",
"You grab your pick, shovel and bolt again",
"And run run until it's done done",
"Until the sun comes up in the morn",
"Cause baby tonight",
"The creeper's tryna steal all our stuff again",
"Just when you think you're safe",
"Overhear some hissing from right behind",
"Right right behind",
"That's a nice life you have",
"Shame it's gotta end at this time time time",
"Time-time-time-time",
"Blows up",
"Then your health bar drops and you could use a one up",
"Get inside, don't be tardy",
"So now you're stuck in there",
"Half a heart is left, but don't die die die",
"Die-die-die",
"Cause baby tonight",
"The creeper's tryna steal all our stuff again",
"Cause baby tonight",
"You grab your pick shovel and bolt again",
"And run run until it's done done",
"Until the sun comes up in the morn",
"Cause baby tonight?",
"The creeper's tryna steal all our stuff again",
"Dig up diamonds and craft those diamonds",
"And make some armor, get it baby",
"Go and forge that like you so MLG pro",
"The sword's made of diamonds, so come at me bro, huh",
"Training in your room under the torchlight",
"Hone that form to get you ready for the big fight",
"Every single day and the whole night",
"Creeper's out prowlin', hoo, alright",
"Look at me, look at you",
"Take my revenge, that's what I'm gonna do",
"I'm a warrior baby, what else is new",
"And my blade's gonna tear through you, bring it",
"Cause baby tonight",
"The creeper's tryna steal all our stuff again",
"(Gather your stuff, yeah, let's take back the world)",
"Yeah baby tonight",
"Grab your sword armor and go",
"Take your revenge",
"So fight fight like it's the last last night",
"Of your life life show them your bite",
"Cause baby tonight",
"The creeper's tryna steal all our stuff again",
"Cause baby tonight",
"You grab your pick shovel and bolt again",
"And run run until it's done done",
"Until the sun comes up in the morn",
"Cause baby tonight",
"The creeper's tryna steal all our stuff again"
]
}

View file

@ -0,0 +1,3 @@
{
}

View file

@ -0,0 +1,3 @@
{
}

View file

@ -19,13 +19,6 @@ exports.run = async (client, message, args) => {
];
let mess = ball.random();
var msg = message.content.toLowerCase();
if (msg.includes("is donald trump a good president".toLowerCase())) {
return message.channel.send(
":8ball: Stupid question. You should be ashamed of yourself for even asking."
);
};
message.channel.send(":8ball: " + mess);
};

View file

@ -8,8 +8,8 @@ exports.run = (client, message) => {
.duration(client.uptime)
.format(" D [days], H [hrs], m [mins], s [secs]");
var mud = client.users.get(client.config.owners[0]).tag;
var flgx = client.users.get(client.config.owners[1]).tag;
var mud = client.users.cache.get(client.config.owners[0]).tag;
var flgx = client.users.cache.get(client.config.owners[1]).tag;
var build;
var prefix;
@ -25,21 +25,18 @@ exports.run = (client, message) => {
build = "production"
}
embed = new Discord.RichEmbed();
embed = new Discord.MessageEmbed();
embed.setTitle(`Woomy`);
embed.setColor(client.embedColour(message));
embed.setDescription(
`Woomy is a multipurpose bot developed by ${mud} and ${flgx}. You can suggest new features by joining my support server,
or using \`${prefix}feedback\``
embed.setThumbnail(client.user.avatarURL({format: "png", dynamic: true}))
embed.addField(
"General:", `• users: \`${client.users.cache.size}\`\n• channels: \`${client.channels.cache.size}\`\n• servers: \`${client.guilds.cache.size}\`\n• commands: \`${client.commands.size}\`\n• uptime: \`${duration}\``,true
);
embed.addField(
"General", `users: \`${client.users.size}\`\nchannels: \`${client.channels.size}\`\nservers: \`${client.guilds.size}\`\ncommands: \`${client.commands.size}\`\nuptime: \`${duration}\``,true
`Technical:`, `• RAM Usage: \`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB\`\n• OS: \`${require("os").type}\`\n• bot version: \`${client.version.number} (${build})\`\n• discord.js version: \`v${version}\`\n• node.js version: \`${process.version}\``,true
);
embed.addField(
`Technical`, `RAM Usage: \`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB\`\nOS: \`${require("os").type}\`\nbot version: \`${client.update.version} (${build})\`\ndiscord.js version: \`v${version}\`\nnode.js version: \`${process.version}\``,true
);
embed.addField(
"Links", "[Support](https://discord.gg/HCF8mdv) | [GitHub](https://github.com/mudkipscience/woomy) | [db.org](https://discordbots.org/bot/435961704145485835/vote) | [BFD](https://botsfordiscord.com/bots/435961704145485835/vote) | [top.gg](https://discordbotlist.com/bots/435961704145485835) | [discord.js](https://discord.js.org/#/) | [guidebot](https://github.com/AnIdiotsGuide/guidebot/)"
"Links:", "[Support](https://discord.gg/HCF8mdv) | [GitHub](https://github.com/mudkipscience/woomy) | [db.org](https://discordbots.org/bot/435961704145485835/vote) | [BFD](https://botsfordiscord.com/bots/435961704145485835/vote) | [top.gg](https://discordbotlist.com/bots/435961704145485835) | [discord.js](https://discord.js.org/#/) | [guidebot](https://github.com/AnIdiotsGuide/guidebot/)"
);
message.channel.send(embed);

View file

@ -13,10 +13,16 @@ exports.run = (client, message, args) => {
message.channel.startTyping();
let params = "h=Achievement+Get%21&i=1&t=" + encodeURIComponent(text);
message.channel.send({
files: [new Discord.Attachment(url + "?" + params, "achievement.png")]
});
message.channel.stopTyping();
try {
message.channel.stopTyping();
message.channel.send({
files: [new Discord.MessageAttachment(url + "?" + params, "achievement.png")]
});
} catch(err) {
message.channel.stopTyping();
message.channel.send(`<:error:466995152976871434> Error when generating image: \`${err}\``)
}
};
exports.conf = {

View file

@ -6,7 +6,7 @@ exports.run = async (client, message, args) => {
client.settings.set(message.guild.id, {});
}
var adminRole = message.guild.roles.get(settings.adminRole)
var adminRole = message.guild.roles.cache.get(settings.adminRole)
if (!args[0]) {
if(!adminRole) {
@ -31,17 +31,16 @@ exports.run = async (client, message, args) => {
);
};
let roleExists = message.guild.roles.find(r => r.name === args.join(" "));
if (!roleExists) {
return message.channel.send(
"<:error:466995152976871434> The specified role does not exist."
);
}
let role = client.findRole(joinedValue, message);
client.settings.set(message.guild.id, roleExists.id, "adminRole");
if (!role) {
return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`);
};
client.settings.set(message.guild.id, role.id, "adminRole");
message.channel.send(
`<:success:466995111885144095> The admin role has been set to \`${joinedValue}\`
`<:success:466995111885144095> The admin role has been set to \`${role.name}\`
`);
};
};

View file

@ -6,11 +6,7 @@ exports.run = async (client, message, args) => {
client.settings.set(message.guild.id, {});
}
if(!message.channel.permissionsFor(client.user).has("MANAGE_ROLES")) {
return message.channel.send("<:error:466995152976871434> This command requires the `manage roles` permission to work.")
}
var autorole = message.guild.roles.get(settings.autorole)
var autorole = message.guild.roles.cache.get(settings.autorole)
if (!args[0]) {
if(!autorole) {
@ -21,7 +17,15 @@ exports.run = async (client, message, args) => {
message.channel.send(`Users recieve this role upon joining: \`${autorole.name}\``)
}
} else if(args.join(" ").toLowerCase() == "off") {
if(settings.autorole == "off") {
return message.channel.send("<:error:466995152976871434> Autoroling has not been enabled.")
}
client.settings.set(message.guild.id, "off", "autorole");
return message.channel.send("<:success:466995111885144095> Autoroling has been disabled.")
} else {
const joinedValue = args.join(" ");
if (joinedValue.length < 1) {
return message.channel.send(
@ -35,17 +39,16 @@ exports.run = async (client, message, args) => {
);
};
let roleExists = message.guild.roles.find(r => r.name === args.join(" "));
if (!roleExists) {
return message.channel.send(
"<:error:466995152976871434> The specified role does not exist."
);
}
role = client.findRole(joinedValue, message);
client.settings.set(message.guild.id, roleExists.id, "autorole");
if (!role) {
return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`);
};
client.settings.set(message.guild.id, role.id, "autorole");
message.channel.send(
`<:success:466995111885144095> The autorole has been set to \`${joinedValue}\`
`<:success:466995111885144095> The autorole has been set to \`${role.name}\`
`);
};
};
@ -55,7 +58,7 @@ exports.conf = {
guildOnly: true,
aliases: [],
permLevel: "Administrator",
requiredPerms: []
requiredPerms: ["MANAGE_ROLES"]
};
exports.help = {

View file

@ -19,7 +19,7 @@ exports.run = (client, message, args) => {
user = users[0];
user = user.user;
}
message.channel.send(`**${user.tag}'s** avatar is: ${user.avatarURL}`);
message.channel.send(`**${user.tag}'s** avatar is: ${user.avatarURL({format: "png", dynamic: true})}`);
};
exports.conf = {

View file

@ -7,36 +7,34 @@ exports.run = async (client, message, args) => {
);
};
let user = message.mentions.members.first();
let user = message.mentions.members.first();
if (!user) {
let users;
users = client.searchForMembers(message.guild, args[0]);
if (users.length > 1)
return message.channel.send(
"<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead."
);
else if (users.length == 0)
return message.channel.send(
"<:error:466995152976871434> That user doesn't seem to exist. Try again!"
);
user = users[0];
};
if (user.user.id === client.user.id) {
return message.channel.send("lol no")
if (!user) {
let users;
users = client.searchForMembers(message.guild, args[0]);
if (users.length > 1)
return message.channel.send(
"<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead."
);
else if (users.length == 0)
return message.channel.send(
"<:error:466995152976871434> That user doesn't seem to exist. Try again!"
);
user = users[0];
};
if (user.user.id === message.guild.owner.id) {
return message.channel.send("<:error:466995152976871434> You can't ban the owner!")
};
let moderator = message.guild.member(message.author)
if (user.highestRole.position >= moderator.highestRole.position && moderator.user.id !== message.guild.ownerID) {
if (user.roles.highest.position >= moderator.roles.highest.position && moderator.user.id !== message.guild.ownerID) {
return message.channel.send(
`<:error:466995152976871434> You can't ban people higher ranked than yourself!`
);
};
let bot = message.guild.member(client.user)
if (user.highestRole.position >= bot.highestRole.position) {
if (user.roles.highest.position >= bot.roles.highest.position) {
return message.channel.send(
`<:error:466995152976871434> I can't ban people who are higher ranked than me!`
);
@ -49,22 +47,23 @@ exports.run = async (client, message, args) => {
let reason = args.slice(1).join(" ");
if (!reason) reason = `Banned by ${message.author.tag}`;
await user.ban(reason).catch(console.error);
await message.guild.members.ban(user, {reason: reason}).catch(console.error);
message.channel.send(`<:success:466995111885144095> Banned \`${user.user.tag}\``);
if (settings.modlogsChannel !== "off") {
const channel = message.guild.channels.find(
const channel = message.guild.channels.cache.find(
channel => channel.name === settings.modlogsChannel
);
if (channel) {
let embed = new Discord.RichEmbed();
let embed = new Discord.MessageEmbed();
embed.setColor("#BC0057");
embed.setAuthor("User banned!", user.user.avatarURL);
embed.setDescription(` User: ${user.user.tag} (${user.user.id})\n Mod: ${message.author} (${message.author.id})\n
Reason: ${reason}`)
embed.setAuthor("User banned!", user.user.avatarURL({format: "png", dynamic: true}));
embed.setDescription(
`• User: ${user.user.tag} (${user.user.id})\n• Mod: ${message.author} (${message.author.id})\n• Reason: ${reason}`
);
try {
channel.send({ embed });
channel.send(embed);
} catch (err) {
// probably no permissions to send messages/embeds there
};

View file

@ -45,7 +45,7 @@ exports.run = async (client, message, [action, ...member]) => {
};
let admin = message.guild.member(message.author)
if (user.highestRole.position >= admin.highestRole.position && admin.user.id !== message.guild.ownerID) {
if (user.roles.highest.position >= admin.roles.highest.position && admin.user.id !== message.guild.ownerID) {
return message.channel.send(
`<:error:466995152976871434> You can't blacklist people higher ranked than yourself!`
);

View file

@ -1,61 +1,13 @@
const Discord = require("discord.js");
const lyric = require('../../resources/other/lyrics.json')
exports.run = async (client, message, args, level) => {
const lyrics = [
"Is this the real life?",
"i this just fantasy?",
"Caught in a landslide, no escape from reality",
"open your eyes, look up to the skies and see",
"I'm just a poor boy, I need no sympathy",
"because I'm easy come, easy go, little high, little low",
"Any way the wind blows doesn't really matter to me, to me",
"mama, just killed a man",
"Put a gun against his head, pulled my trigger, now he's dead",
"mama, life had just begun",
"But now I've gone and thrown it all away",
"mama, ooh, didn't mean to make you cry",
"If I'm not back again this time tomorrow",
"carry on, carry on as if nothing really matters",
"Too late, my time has come",
"sends shivers down my spine, body's aching all the time",
"Goodbye, everybody, I've got to go",
"gotta leave you all behind and face the truth",
"Mama, ooh, (Anyway the wind blows)",
"i don't wanna die",
"I sometimes wish I'd never been born at all",
"i see a little silhouetto of a man",
"Scaramouche! Scaramouche! will you do the Fandango?",
"thunderbolt and lightning, very, very fright'ning me",
"(Galileo) Galileo, (Galileo) Galileo, Galileo Figaro magnifico",
"i'm just a poor boy, nobody loves me",
"He's just a poor boy from a poor family",
"spare him his life from this monstrosity",
"Easy come, easy go, will you not let me go?",
"bismillah! No, we will not let you go",
"(Let him go!) Bismillah! We will not let you go",
"(let him go!) Bismillah! We will not let you go",
"(Let me go) Will not let you go",
"(let me go) Will not let you go",
"(Let me go) Ah",
"no, no, no, no, no, no, no",
"(Oh mamma mia, mamma mia) Mamma mia, let me go",
"beelzebub has the devil put aside for me, for me, for me!",
"So you think you can stone me and spit in my eye?",
"so you think you can love me and leave me to die?",
"Oh baby, can't do this to me, baby!",
"just gotta get out, just gotta get right outta here!",
"Nothing really matters, anyone can see",
"nothing really matters",
"Nothing really matters, to me",
"any way the wind blows"
];
const lyrics = lyric.bohemian_rhapsody;
var runtop = true;
var runbottom = false;
for(var br = 0; br < lyrics.length; br++) {
{
if (runtop === true) {
var response = await client.awaitReply(message, lyrics[br]);
response = response.toLowerCase();
runbottom = false;
};

View file

@ -1,5 +1,5 @@
exports.run = (client, message) => {
message.channel.send(client.update.changelog)
message.channel.send(client.version.changelog)
};
exports.conf = {

View file

@ -1,29 +1,46 @@
const randomColour = require("randomcolor");
exports.run = async (client, message, args, level) => {
var colour;
if(!args[0]) {
var colour = randomColour();
}
colour = randomColour();
} else if(isHex(args.join(" ")) != true) {
colour = stringToHex(args.join(" "));
} else {
colour = args[0]
}
if(args[0]) {
if(args[0].startsWith('#')) {
colour = args[0];
} else {
colour = `#${args[0]}`;
}
if(colour.length > 7) return message.channel.send(
`<:error:466995152976871434> Has to be a hex code! Usage: \`${client.commands.get(`colour`).help.usage}\``
);
if(colour.length < 7) return message.channel.send(
`<:error:466995152976871434> Has to be a hex code! Usage: \`${client.commands.get(`colour`).help.usage}\``
);
};
embed = new Discord.RichEmbed();
embed = new Discord.MessageEmbed();
embed.setTitle(colour)
embed.setColor(colour);
embed.setDescription(colour)
embed.setImage("https://api.alexflipnote.xyz/colour/image/" + colour.replace("#", ""));
message.channel.send(embed)
};
function isHex(string) {
var str = string;
if(str.charAt(0) == "#") {
str = str.slice(1)
};
return typeof str === 'string'
&& str.length === 6
&& !isNaN(Number('0x' + str))
}
function stringToHex(string) {
var hash = 0;
for (var i = 0; i < string.length; i++) {
hash = string.charCodeAt(i) + ((hash << 5) - hash);
}
var colour = '#';
for (var i = 0; i < 3; i++) {
var value = (hash >> (i * 8)) & 0xFF;
colour += ('00' + value.toString(16)).substr(-2);
}
return colour;
};
exports.conf = {
enabled: true,
guildOnly: false,
@ -36,5 +53,5 @@ exports.help = {
name: "colour",
category: "Utility",
description: "Gives you a random colour",
usage: "colour <hex>"
usage: "colour <hex> **OR** colour <text>"
};

View file

@ -1,6 +1,6 @@
exports.run = async (client, message, args) => {
message.channel.send(
`**Credits:**\n \`mudkipscience#3739\` and \`FLGX#9896\`for developing the bot\n \`An Idiots Guide\` for the Guidebot bot base\n \`dellannie#6057\` for helping with the music commands\n \`TheCakeChicken#9088\` and \`Tina the Cyclops girl#0064\` for helping me not suck at coding\n \`AirVentTrent\` for the icon, find him on Instagram`
`**Credits:**\n\`mudkipscience#8904\` and \`FLGX#9896\`for developing the bot\n\`An Idiots Guide\` for the Guidebot bot base\n \`dellannie#6057\` for helping with the music commands\n \`TheCakeChicken#9088\` and \`Tina the Cyclops girl#0064\` for helping me not suck at coding\n \`AirVentTrent\` for the icon, find him on Instagram`
);
};

View file

@ -1,75 +1,7 @@
const lyric = require('../../resources/other/lyrics.json')
exports.run = async (client, message, args, level) => {
const lyrics = [
"Aw man",
"so we back in the mine",
"Got our pickaxe swinging from side to side",
"side side to side",
"This task a grueling one",
"hope to find some diamonds tonight night night",
"Diamonds tonight",
"heads up",
"You hear a sound turn around and look up",
"total shock fills your body",
"Oh no it's you again",
"i can never forget those eyes eyes eyes",
"Eyes-eye-eyes",
"cause baby tonight",
"The creeper's tryna steal all our stuff again",
"cause baby tonight",
"You grab your pick, shovel and bolt again",
"and run run until it's done done",
"Until the sun comes up in the morn",
"cause baby tonight",
"The creeper's tryna steal all our stuff again",
"just when you think you're safe",
"Overhear some hissing from right behind",
"right right behind",
"That's a nice life you have",
"shame it's gotta end at this time time time",
"Time-time-time-time",
"blows up",
"Then your health bar drops and you could use a one up",
"get inside, don't be tardy",
"So now you're stuck in there",
"half a heart is left, but don't die die die",
"Die-die-die",
"cause baby tonight",
"The creeper's tryna steal all our stuff again",
"cause baby tonight",
"You grab your pick shovel and bolt again",
"and run run until it's done done",
"Until the sun comes up in the morn",
"cause baby tonight?",
"The creeper's tryna steal all our stuff again",
"dig up diamonds and craft those diamonds",
"And make some armor, get it baby",
"go and forge that like you so MLG pro",
"The sword's made of diamonds, so come at me bro, huh",
"training in your room under the torchlight",
"Hone that form to get you ready for the big fight",
"every single day and the whole night",
"Creeper's out prowlin', hoo, alright",
"look at me, look at you",
"Take my revenge, that's what I'm gonna do",
"i'm a warrior baby, what else is new",
"And my blade's gonna tear through you, bring it",
"cause baby tonight",
"The creeper's tryna steal all our stuff again",
"(gather your stuff, yeah, let's take back the world)",
"Yeah baby tonight",
"grab your sword armor and go",
"Take your revenge",
"so fight fight like it's the last last night",
"Of your life life show them your bite",
"cause baby tonight",
"The creeper's tryna steal all our stuff again",
"cause baby tonight",
"You grab your pick shovel and bolt again",
"and run run until it's done done",
"Until the sun comes up in the morn",
"cause baby tonight",
"The creeper's tryna steal all our stuff again"
];
var lyrics = lyric.creeper;
var runtop = true;
var runbottom = false;
@ -77,7 +9,6 @@ exports.run = async (client, message, args, level) => {
{
if (runtop === true) {
var response = await client.awaitReply(message, lyrics[br]);
response = response.toLowerCase();
runbottom = false;
};

View file

@ -1,27 +0,0 @@
exports.run = (client, message, args, level) => {
if(!args[0]) {
return message.channel.send(
`<:error:466995152976871434> No message provided.
Usage: \`${client.commands.get(`echo`).help.usage}\``
);
};
if (message.content.includes("@everyone")) return message.channel.send(message.author);
const sayMessage = args.join(" ");
message.delete().catch(O_o => {});
message.channel.send(sayMessage);
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["say"],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "echo",
category: "Fun",
description: "Makes Woomy copy what the user says.",
usage: "echo [message]"
};

43
src/commands/emoji.js Normal file
View file

@ -0,0 +1,43 @@
exports.run = async (client, message, args) => {
if(!args[0]) {
return message.channel.send(`You need to specify a custom emoji. Usage: \`${client.commands.get(`emoji`).help.usage}\``)
};
var ID;
var format = ".png"
var string = args[0].replace(/\D/g,'');
if(args[0].charAt(1) == "a" && args[0].charAt(2) == ":") {
format = ".gif"
};
console.log(string.length)
if(string.length > 18) {
ID = string.slice(string.length - 18);
} else {
ID = string;
};
if(!ID) {
return message.channel.send(`<:error:466995152976871434> Invalid emoji. This command only works with custom emojis.`)
};
message.channel.send("https://cdn.discordapp.com/emojis/" + ID + format)
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "emoji",
category: "Utility",
description: "Enlarges and links an custom emoji",
usage: "emoji [emoji]"
};

View file

@ -30,7 +30,12 @@ exports.run = (client, message, args) => {
return `${specialChars[letter]} `
};
return letter
}).join('');
}).join('');
if(emojified.length > 2000) {
return message.channel.send("<:error:466995152976871434> The emojified message exceeds 2000 characters.")
}
message.channel.send(emojified);
};

View file

@ -1,11 +1,32 @@
const hastebin = require('hastebin-gen');
exports.run = async (client, message, args) => {
const code = args.join(" ");
try {
const evaled = eval(code);
const clean = await client.clean(client, evaled);
if(clean.length > 2000) {
hastebin(clean, { extension: "txt" }).then(haste => {
return message.channel.send('`OUTPUT`\n' + haste);
}).catch(error => {
client.logger.err(error);
});
return;
}
message.channel.send(`\`OUTPUT\` \`\`\`js\n${await clean}\n\`\`\``);
} catch (err) {
message.channel.send(`\`ERROR\` \`\`\`xl\n${await client.clean(client, err)}\n\`\`\``);
const errclean = await client.clean(client, err);
if(errclean.length > 2000) {
hastebin(errclean, { extension: "txt" }).then(haste => {
return message.channel.send('`ERROR`\n' + haste);
}).catch(error => {
client.logger.err(error);
});
return;
}
message.channel.send(`\`ERROR\` \`\`\`xl\n${await errclean}\n\`\`\``);
}
};

View file

@ -1,9 +1,9 @@
exports.run = (client, message, args, level) => {
if(!args[0]) return message.channel.send(`<:error:466995152976871434> You didn't give me any feedback! Usage: \`${client.commands.get(`feedback`).help.usage}\``)
const feedback = args.join(" ")
let guild = client.guilds.get("410990517841690625")
let channel = guild.channels.get("438825830949453824")
let embed = new Discord.RichEmbed()
let guild = client.guilds.cache.get("410990517841690625")
let channel = guild.channels.cache.get("438825830949453824")
let embed = new Discord.MessageEmbed()
.setTitle(`Feedback:`)
.setColor(client.embedColour(message))
.addField("User:",message.author.tag)

View file

@ -1,13 +1,13 @@
exports.run = (client, message, args) => {
if(!args[0]) {
return message.channel.send(
`<:error:466995152976871434> Invalid choice. Usage: \`${client.commands.get(`emojify`).help.usage}\``
`<:error:466995152976871434> Invalid choice. Usage: \`${client.commands.get(`flip`).help.usage}\``
);
};
if(args[0].toLowerCase() != "heads" || args[0].toLowerCase() != "tails") {
if(args[0].toLowerCase() != "heads" && args[0].toLowerCase() != "tails") {
return message.channel.send(
`<:error:466995152976871434> Invalid choice. Usage: \`${client.commands.get(`emojify`).help.usage}\``
`<:error:466995152976871434> Invalid choice. Usage: \`${client.commands.get(`flip`).help.usage}\``
);
};
var coin = [

View file

@ -18,48 +18,49 @@ exports.run = async (client, message, [member, ...role2add], query) => {
);
user = users[0];
}
let role = role2add.join(" ");
let joinedValue = role2add.join(" ");
let gRole = client.findRole(joinedValue, message);
let gRole = message.guild.roles.find(r => r.name === role);
if (!gRole) {
return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`);
}
};
let moderator = message.guild.member(message.author)
if (gRole.position >= moderator.highestRole.position) {
if (gRole.position >= moderator.roles.highest.position) {
return message.channel.send(
"<:error:466995152976871434> You cannot give roles higher than your own!"
);
}
var bot = message.guild.members.get(client.user.id)
if (gRole.position >= bot.highestRole.position) {
var bot = message.guild.members.cache.get(client.user.id)
if (gRole.position >= bot.roles.highest.position) {
return message.channel.send(
`<:error:466995152976871434> I cannot give roles higher than my own!`
);
}
if (user.roles.has(gRole.id)) {
if (user.roles.cache.has(gRole.id)) {
return message.channel.send(
"<:error:466995152976871434> They already have that role!"
);
}
await user.addRole(gRole.id);
await user.roles.add(gRole.id);
message.channel.send(
`<:success:466995111885144095> Gave \`${user.user.tag}\` the \`${gRole.name}\` role.`
);
if (client.getSettings(message.guild.id).modlogsChannel !== "off") {
const channel = message.guild.channels.find(
const channel = message.guild.channels.cache.find(
channel => channel.name === client.getSettings(message.guild.id).modlogsChannel
);
if (channel) {
let embed = new Discord.RichEmbed();
let embed = new Discord.MessageEmbed();
embed.setColor("#00c09a");
embed.setAuthor("Role given:", user.user.avatarURL);
embed.setDescription(` User: ${user} (${user.user.id})\n Mod: ${message.author} (${message.author.id})\n Role: ${gRole}`)
embed.setAuthor("Role given:", user.user.avatarURL({format: "png", dynamic: true}));
embed.setDescription(` User: ${user} (${user.user.id})\n Mod: ${message.author} (${message.author.id})\n Role: ${gRole}`)
try {
channel.send({ embed });
} catch (err) {

View file

@ -7,7 +7,7 @@ exports.run = async (client, message, args) => {
);
};
user = client.users.get(args[0])
user = client.users.cache.get(args[0])
if(!user) {
return message.channel.send("<:error:466995152976871434> Invalid ID")
}
@ -20,25 +20,27 @@ exports.run = async (client, message, args) => {
let reason = args.slice(1).join(" ");
if (!reason) reason = `Banned by ${message.author.tag}`;
await message.guild.ban(args[0], reason).catch(console.error);
await message.guild.members.ban(args[0], {reason: reason}).catch(console.error);
message.channel.send(`<:success:466995111885144095> Hackbanned \`${user.tag}\``);
if (settings.modlogsChannel !== "off") {
const channel = message.guild.channels.find(
const channel = message.guild.channels.cache.find(
channel => channel.name === settings.modlogsChannel
);
if (channel) {
let embed = new Discord.RichEmbed();
embed.setColor("#7c0136");
embed.setAuthor("User preemptively banned!", user.avatarURL);
embed.setDescription(` User: ${user.tag} (${user.id})\n Mod: ${message.author} (${message.author.id})\n Reason: ${reason}`)
let embed = new Discord.MessageEmbed();
embed.setColor("#BC0057");
embed.setAuthor("User banned!", user.avatarURL({format: "png", dynamic: true}));
embed.setDescription(
`• User: ${user.tag} (${user.id})\n• Mod: ${message.author} (${message.author.id})\n• Reason: ${reason}`
);
try {
channel.send({ embed });
channel.send(embed);
} catch (err) {
// probably no permissions to send messages/embeds there
};
};
}
};
};

View file

@ -1,5 +1,5 @@
exports.run = (client, message, args, level) => {
embed = new Discord.RichEmbed();
embed = new Discord.MessageEmbed();
embed.setColor(client.embedColour(message));
var ran = false;
@ -141,7 +141,7 @@ exports.run = (client, message, args, level) => {
embed.setTitle(prefix + command.help.name);
embed.setDescription(
` **Description:** ${command.help.description}\n **Usage:** ${prefix + command.help.usage}\n **Permission Level:** ${cmd.conf.permLevel} \n **Guild Only:** ${cmd.conf.guildOnly}\n **Aliases:** ${aliases}\n **Required perms:** ${requiredPerms}`
` **Description:** ${command.help.description}\n **Usage:** ${prefix + command.help.usage}\n **Permission Level:** ${cmd.conf.permLevel} \n **Guild Only:** ${cmd.conf.guildOnly}\n• **Aliases:** ${aliases}\n **Required perms:** ${requiredPerms}`
);
embed.setFooter("Arguments in [] are required, <> are optional.");

View file

@ -0,0 +1,33 @@
const request = require('request')
exports.run = async (client, message) => {
message.channel.startTyping();
request({
url: "http://inspirobot.me/api?generate=true"
},
function(error, res, body) {
if(body.length > 0) {
message.channel.send({
files: [new Discord.MessageAttachment(body)]
});
message.channel.stopTyping();
} else {
message.channel.send('<:error:466995152976871434> API error, please retry.')
message.channel.stopTyping();
};
});
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "inspirobot",
category: "Fun",
description: "Returns an inspirational message generated by inspirobot.",
usage: "inspirobot"
};

View file

@ -27,14 +27,14 @@ if (user.user.id === message.guild.owner.id) {
return message.channel.send("<:error:466995152976871434> You can't kick the owner!")
}
let moderator = message.guild.member(message.author)
if (user.highestRole.position >= moderator.highestRole.position && moderator.user.id !== message.guild.ownerID) {
if (user.roles.highest.position >= moderator.roles.highest.position && moderator.user.id !== message.guild.ownerID) {
return message.channel.send(
`<:error:466995152976871434> You can't kick people higher ranked than yourself!`
);
}
let bot = message.guild.member(client.user)
if (user.highestRole.position >= bot.highestRole.position) {
if (user.roles.highest.position >= bot.roles.highest.position) {
return message.channel.send(
`<:error:466995152976871434> I can't kick people who are higher ranked than me!`
);
@ -51,16 +51,16 @@ await user.kick(reason).catch(console.error);
message.channel.send(`<:success:466995111885144095> Kicked \`${user.user.tag}\``);
if (settings.modlogsChannel !== "off") {
const channel = message.guild.channels.find(
const channel = message.guild.channels.cache.find(
channel => channel.name === settings.modlogsChannel
);
if (channel) {
let embed = new Discord.RichEmbed();
let embed = new Discord.MessageEmbed();
embed.setColor("#fd0061");
embed.setAuthor("User kicked!", user.user.avatarURL);
embed.setAuthor("User kicked!", user.user.avatarURL({format: "png", dynamic: true}));
embed.setDescription(
` User: ${user.user.tag} (${user.user.id})\n Mod: ${message.author} (${message.author.id})\n Reason: ${reason}`
` User: ${user.user.tag} (${user.user.id})\n Mod: ${message.author} (${message.author.id})\n Reason: ${reason}`
);
try {
channel.send({ embed });

View file

@ -22,17 +22,14 @@ exports.run = (client, message, args) => {
}
let result = (new Function( 'return ' + exercise )());
if (exercise === "9+10" || exercise === "9 + 10") {
result = "21"
}
message.channel.send(`\`RESULTS:\`\n\`\`\`${result}\`\`\``);
message.channel.send(`\`RESULT:\`\n\`\`\`${result}\`\`\``);
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["calculate"],
aliases: ["calculate", "calc"],
permLevel: "User",
requiredPerms: []
};

View file

@ -1,5 +1,4 @@
exports.run = async (client, message) => {
const settings = message.settings;
if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {});

View file

@ -6,7 +6,7 @@ exports.run = async (client, message, args) => {
client.settings.set(message.guild.id, {});
}
var modRole = message.guild.roles.get(settings.modRole)
var modRole = message.guild.roles.cache.get(settings.modRole)
if (!args[0]) {
if(!modRole) {
@ -31,17 +31,16 @@ exports.run = async (client, message, args) => {
);
};
let roleExists = message.guild.roles.find(r => r.name === args.join(" "));
if (!roleExists) {
return message.channel.send(
"<:error:466995152976871434> The specified role does not exist."
);
}
let role = client.findRole(joinedValue, message);
client.settings.set(message.guild.id, roleExists.id, "modRole");
if (!role) {
return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`);
};
client.settings.set(message.guild.id, role.id, "modRole");
message.channel.send(
`<:success:466995111885144095> The mod role has been set to \`${joinedValue}\`
`<:success:466995111885144095> The mod role has been set to \`${role.name}\`
`);
};
};

View file

@ -24,12 +24,12 @@ exports.run = async (client, message, [args, ...reason], level) => {
};
let moderator = message.guild.member(message.author)
if (message.settings.mutedRole.position >= moderator.highestRole.position && level < 2) {
if (message.settings.mutedRole.position >= moderator.roles.highest.position && level < 2) {
return message.channel.send(
"<:error:466995152976871434> The muted role is positioned above the moderator role! Please move the muted role below the moderator role."
);
};
if (user.highestRole.position >= moderator.highestRole.position && moderator.user.id !== message.guild.ownerID) {
if (user.roles.highest.position >= moderator.roles.highest.position && moderator.user.id !== message.guild.ownerID) {
return message.channel.send(
`<:error:466995152976871434> You can't mute people who have a higher role than you!`
);
@ -37,56 +37,38 @@ exports.run = async (client, message, [args, ...reason], level) => {
let bot = message.guild.member(client.user)
if (user.highestRole.position >= bot.highestRole.position) {
if (user.roles.highest.position >= bot.roles.highest.position) {
return message.channel.send(
`<:error:466995152976871434> I can't mute people who have a higher role than me!`
);
}
var role = message.guild.roles.get(settings.mutedRole);
var modrole = message.guild.roles.get(settings.modRole);
var role = message.guild.roles.cache.get(settings.mutedRole);
if(!role) {
if (!modrole.id) {
return message.channel.send(
"<:error:466995152976871434> There is no mod role set for this server. Please set one using `" + message.settings.prefix + "modrole <role>` before using this command."
);
};
let rolepos = (modrole.position)
rolepos = rolepos-1
try {
role = await message.guild.createRole({
name: "Muted",
color: "#707fa5",
permissions: [],
position: rolepos
});
} catch(e) {
client.logger.log(`Mute command error: \n${e}`, "error")
};
client.settings.set(message.guild.id, role.id, "mutedRole");
message.channel.send("Created a `Muted` role, since your server didn't have one.")
if (!role) {
return message.channel.send(
"<:error:466995152976871434> There is no muted role set for this server. Please set one using `" + message.settings.prefix + "mutedrole <role>` before using this command."
);
};
if (bot.highestRole.position <= role.position) {
if (bot.roles.highest.position <= role.position) {
return message.channel.send(
"<:error:466995152976871434> The muted role is above my highest role! Please move the muted role below my highest role."
);
};
message.guild.channels.forEach(async (channel, id) => {
await channel.overwritePermissions(role, {
message.guild.channels.cache.forEach(async (channel, id) => {
await channel.updateOverwrite(role, {
SEND_MESSAGES: false,
ADD_REACTIONS: false
});
});
if (user.roles.has(role.id)) {
if (user.roles.cache.has(role.id)) {
return message.channel.send("<:error:466995152976871434> They're already muted!")
}
await user.addRole(role.id);
await user.roles.add(role.id);
message.channel.send(`<:success:466995111885144095> Muted \`${user.user.tag}\``)
var muteReason = reason.join(" ");
@ -96,20 +78,19 @@ exports.run = async (client, message, [args, ...reason], level) => {
}
if (settings.modlogsChannel !== "off") {
const channel = message.guild.channels.find(
const channel = message.guild.channels.cache.find(
channel => channel.name === settings.modlogsChannel
);
if (channel) {
let embed = new Discord.RichEmbed();
let embed = new Discord.MessageEmbed();
embed.setColor("#a652bb");
embed.setAuthor("User muted!", user.user.avatarURL);
embed.setAuthor("User muted!", user.user.avatarURL({format: "png", dynamic: true}));
embed.setDescription(
` User: ${user} (${user.user.id})\n Mod: ${message.author} (${message.author.id})\n
Reason: ${muteReason}`
`• User: ${user} (${user.user.id})\n• Mod: ${message.author} (${message.author.id})\n• Reason: ${muteReason}`
);
try {
channel.send({ embed });
channel.send(embed);
} catch (err) {
// probably no permissions to send messages/embeds there
}
@ -120,7 +101,7 @@ exports.run = async (client, message, [args, ...reason], level) => {
exports.conf = {
enabled: true,
guildOnly: true,
aliases: ["stfu"],
aliases: [],
permLevel: "Moderator",
requiredPerms: ["MANAGE_ROLES", "MANAGE_CHANNELS"]
};

View file

@ -6,7 +6,7 @@ exports.run = async (client, message, args) => {
client.settings.set(message.guild.id, {});
}
var mutedRole = message.guild.roles.get(settings.mutedRole)
var mutedRole = message.guild.roles.cache.get(settings.mutedRole)
if (!args[0]) {
if(!mutedRole) {
@ -21,7 +21,7 @@ exports.run = async (client, message, args) => {
const joinedValue = args.join(" ");
if (joinedValue.length < 1) {
return message.channel.send(
`<:error:466995152976871434> You didn't specify a role. Usage: \`${client.commands.get(`mutedRole`).help.usage}\``
`<:error:466995152976871434> You didn't specify a role. Usage: \`${client.commands.get(`mutedrole`).help.usage}\``
);
};
@ -31,17 +31,16 @@ exports.run = async (client, message, args) => {
);
};
let roleExists = message.guild.roles.find(r => r.name === args.join(" "));
if (!roleExists) {
return message.channel.send(
"<:error:466995152976871434> The specified role does not exist."
);
}
let role = client.findRole(joinedValue, message);
client.settings.set(message.guild.id, roleExists.id, "mutedRole");
if (!role) {
return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`);
};
client.settings.set(message.guild.id, role.id, "mutedRole");
message.channel.send(
`<:success:466995111885144095> The muted role has been set to \`${joinedValue}\`
`<:success:466995111885144095> The muted role has been set to \`${role.name}\`
`);
};
};

View file

@ -7,7 +7,7 @@ exports.run = async (client, message) => {
}
var song = guild.queue[0];
var elapsedTime = client.createTimestamp(guild.dispatcher.time / 1000);
var elapsedTime = client.createTimestamp(guild.dispatcher.streamTime / 1000);
var timestamp;
if(song.duration == 0) {
@ -16,14 +16,14 @@ exports.run = async (client, message) => {
timestamp = `\`[${elapsedTime + "/" + client.createTimestamp(song.duration)}]\``;
};
embed = new Discord.RichEmbed();
embed = new Discord.MessageEmbed();
embed.setTitle("Now playing:")
embed.setThumbnail(song.thumbnail)
embed.setColor(client.embedColour(message));
embed.setDescription(`**[${song.title}](https://www.youtube.com/watch?v=${song.id})**`)
embed.addField("Channel:", song.author, true)
embed.addField("Time:", timestamp, true)
embed.setFooter("Requested by " + song.requestedBy.tag, song.requestedBy.avatarURL)
embed.setFooter("Requested by " + song.requestedBy.tag, song.requestedBy.avatarURL({format: "png", dynamic: true}))
message.channel.send(embed)
};

View file

@ -12,6 +12,10 @@ exports.run = (client, message, args) => {
owoified = owoified.replace(/ove/g, 'uv')
owoified = owoified.replace(/!+/g, ' ' + faces[~~(Math.random() * faces.length)] + ' ')
if(owoified.length > 2000) {
return message.channel.send("<:error:466995152976871434> The owoified message exceeds 2000 characters.")
}
message.channel.send(owoified)
};

View file

@ -1,8 +1,8 @@
exports.run = async (client, message) => { // eslint-disable-line no-unused-vars
const msg = await message.channel.send("<:wait:467115775849922570> Please wait...");
exports.run = async (client, message) => {
const msg = await message.channel.send("⏱️ Please wait...");
msg.edit(
`:ping_pong: Pong! Latency is ${msg.createdTimestamp - message.createdTimestamp}ms, API Latency is ${Math.round(client.ping)}ms`
);
`:ping_pong: Pong! Latency is ${msg.createdTimestamp - message.createdTimestamp}ms, API Latency is ${Math.round(client.ws.ping)}ms`
);
};
exports.conf = {

View file

@ -9,7 +9,7 @@ module.exports.run = (client, message, args, level) =>{
return;
}
let voiceChannel = message.member.voiceChannel;
let voiceChannel = message.member.voice.channel;
if(!voiceChannel) return message.channel.send('<:error:466995152976871434> You need to be in a voice channel to use this command!');
message.channel.send(`🔎 searching YouTube for \`${args.join(" ")}\``);

View file

@ -1,4 +1,4 @@
exports.run = (client, message, args, level) => {
exports.run = async (client, message, args, level) => {
const settings = message.settings;
if(message.channel.name === settings.chatlogsChannel) {
@ -13,36 +13,35 @@ exports.run = (client, message, args, level) => {
return message.channel.send("<:error:466995152976871434> Can only purge a maximum of 100 messages!")
}
if (!amount) return message.channel.send(
'<:error:466995152976871434> You didn\'t tell me how many messages to purge. Usage: \`' + client.commands.get(`purge`).help.usage + "`"
);
message.delete().catch(O_o => {});
if (!amount) return message.channel.send(
'<:error:466995152976871434> You didn\'t tell me how many messages to purge. Usage: \`' + client.commands.get(`purge`).help.usage + "`"
);
message.channel.fetchMessages({
limit: amount,
}).then((messages) => {
message.channel.bulkDelete(messages, true).catch(console.error);
message.channel.send(`<:success:466995111885144095> Purged ${amount} messages!`).then(m => m.delete(5000));
});
await message.delete().catch(O_o => {});
if (settings.modlogsChannel !== "off") {
const channel = message.guild.channels.find(
channel => channel.name === settings.modlogsChannel
);
message.channel.messages.fetch({
limit: amount,
}).then((messages) => {
message.channel.bulkDelete(messages, true).catch(console.error);
message.channel.send(`<:success:466995111885144095> Purged ${amount} messages!`).then(m => m.delete({timeout: 5000}));
});
if (settings.modlogsChannel !== "off") {
const channel = message.guild.channels.cache.find(
channel => channel.name === settings.modlogsChannel
);
if (channel) {
let embed = new Discord.RichEmbed();
embed.setColor("#a62019");
embed.setAuthor(`${amount} messages purged!`, message.author.avatarURL);
embed.setDescription(` Mod: ${message.author} (${message.author.id})`)
try {
channel.send({ embed });
} catch (err) {
// probably no permissions to send messages/embeds there
};
if (channel) {
let embed = new Discord.MessageEmbed();
embed.setColor("#a62019");
embed.setAuthor(`${amount} messages purged!`, message.author.avatarURL({format: "png", dynamic: true}));
embed.setDescription(`• Channel: ${message.channel.name} (${message.channel.id})\n• Mod: ${message.author} (${message.author.id})\n• Amount: \`${amount}\``)
try {
channel.send({ embed });
} catch (err) {
};
};
};
};
exports.conf = {

View file

@ -60,11 +60,11 @@ exports.run = (client, message, args) => {
return false;
}
var embed = new Discord.RichEmbed();
var embed = new Discord.MessageEmbed();
embed.setTitle(`Queue for: ${message.guild.name}`);
embed.setColor(client.embedColour(message));
var elapsedTime = client.music.getGuild(message.guild.id).dispatcher.time / 1000
var elapsedTime = client.music.getGuild(message.guild.id).dispatcher.streamTime / 1000
var totalDuration = queue[0].duration - elapsedTime;
let timeRemaining = "";

View file

@ -8,7 +8,7 @@ exports.run = async (client, message, args, level) => {
var raidToggle;
var embColour;
var mutedRole = message.guild.roles.get(settings.mutedRole)
var mutedRole = message.guild.roles.cache.get(settings.mutedRole)
if(!mutedRole) {
return message.channel.send(
@ -36,15 +36,15 @@ exports.run = async (client, message, args, level) => {
};
};
if (settings.modlogsChannel !== "off") {
const channel = message.guild.channels.find(
const channel = message.guild.channels.cache.find(
channel => channel.name === settings.modlogsChannel
);
if (channel) {
let embed = new Discord.RichEmbed();
let embed = new Discord.MessageEmbed();
embed.setColor(embColour);
embed.setAuthor(raidToggle, message.author.avatarURL);
embed.setDescription(`Mod: ${message.author} (${message.author.id})`)
embed.setAuthor(raidToggle, message.author.avatarURL({dynamic: true}));
embed.setDescription(`Mod: ${message.author} (${message.author.id})`)
try {
channel.send({ embed });
} catch (err) {

View file

@ -11,7 +11,7 @@ exports.run = (client, message) => {
"<:error:466995152976871434> Example cannot exceed 2000 characters!"
);
embed = new Discord.RichEmbed()
embed = new Discord.MessageEmbed()
.setTitle(json.word)
.setURL(json.permalink)
.setColor("#EFFF00")

View file

@ -1,9 +1,14 @@
exports.run = async (client, message) => {// eslint-disable-line no-unused-vars
// This actually shuts down the bot, you'll need to use something like pm2 to get it to restart
await message.channel.send("<:reboot:467216876938985482> Restarting...");
client.commands.forEach( async cmd => {
await client.unloadCommand(cmd);
});
process.exit(1);
process.exit();
};
exports.conf = {

View file

@ -1,12 +1,11 @@
exports.run = async (client, message, [colour, ...givenRole], query) => {
let role = givenRole.join(" ");
let gRole = message.guild.roles.find(r => r.name === role);
let gRole = client.findRole(role, message);
if (!gRole) {
return message.channel.send(
`<:error:466995152976871434> That role doesn't seem to exist. Usage: \`${client.commands.get(`rolecolour`).help.usage}\``
);
}
return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`);
};
if(!colour.startsWith('#')) {
colour = `#`+colour;
@ -19,14 +18,14 @@ exports.run = async (client, message, [colour, ...givenRole], query) => {
);
let moderator = message.guild.member(message.author)
if (gRole.position >= moderator.highestRole.position) {
if (gRole.position >= moderator.roles.highest.position) {
return message.channel.send(
"<:error:466995152976871434> You cannot modify roles higher than your own!"
);
}
var bot = message.guild.members.get(client.user.id)
if (gRole.position >= bot.highestRole.position) {
var bot = message.guild.members.cache.get(client.user.id)
if (gRole.position >= bot.roles.highest.position) {
return message.channel.send(
`<:error:466995152976871434> I cannot modify roles higher than my own!`
);
@ -34,7 +33,7 @@ exports.run = async (client, message, [colour, ...givenRole], query) => {
await gRole.edit({color: colour})
message.channel.send(
`<:success:466995111885144095> Role colour changed to \`${colour}\``);
`<:success:466995111885144095> The colour of the role \`${gRole.name}\` has been set to \`${colour}\``);
};
exports.conf = {

View file

@ -5,10 +5,11 @@ exports.run = async (client, message, args, level) => {
`<:error:466995152976871434> You didn't provide me with a role name or ID! Usage: \`${client.commands.get(`roleinfo`).help.usage}\``
);
var role = message.guild.roles.get(args[0])
if(!role) {
role = message.guild.roles.find(r => r.name === args.join(" "));
}
let role = client.findRole(args.join(" "), message);
if (!role) {
return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`);
};
if(!role) {
return message.channel.send(`<:error:466995152976871434> Role not found.`)
@ -20,11 +21,10 @@ exports.run = async (client, message, args, level) => {
var hoist = `No`
}
var embed = new Discord.RichEmbed();
var embed = new Discord.MessageEmbed();
embed.setColor(role.color)
embed.setDescription(
`**Name:** ${role.name}\n **ID:** ${role.id}\n**Hex:** ${role.hexColor}\n**Members:** ${role.members.size}
\n**Position:** ${role.position}\n**Hoisted:** ${hoist}`
`• **Name:** ${role.name}\n• **ID:** ${role.id}\n• **Hex:** ${role.hexColor}\n• **Members:** ${role.members.size}\n• **Position:** ${role.position}\n• **Hoisted:** ${hoist}`
);
message.channel.send(embed)
};

View file

@ -1,16 +1,23 @@
const url = "https://demirramon.com/gen/undertale_text_box.png";
exports.run = (client, message, args) => {
let text = args.join(" ");
if (!text) {
return message.channel.send(
`<:error:466995152976871434> No message provided. Usage: \`${client.commands.get(`sans`).help.usage}\``
);
}
message.channel.startTyping();
let params = "box=undertale&boxcolor=white&character=undertale-sans&expression=default&charcolor=white&font=determination&asterisk=true&mode=regular&text=" + encodeURIComponent(text);
message.channel.send({files: [new Discord.Attachment(url + "?" + params, "undertale.png")]});
try {
message.channel.stopTyping();
message.channel.send({files: [new Discord.MessageAttachment(url + "?" + params, "undertale.png")]});
} catch(err) {
message.channel.stopTyping();
message.channel.send(`<:error:466995152976871434> Error when generating image: \`${err}\``)
}
};
exports.conf = {

28
src/commands/say.js Normal file
View file

@ -0,0 +1,28 @@
exports.run = (client, message, args, level) => {
if(!args[0]) {
return message.channel.send(
`<:error:466995152976871434> No message provided. Usage: \`${client.commands.get(`echo`).help.usage}\``
);
};
if (message.content.includes("@everyone")) {
return message.channel.send(`<@${message.author.id}>`);
};
message.delete().catch(O_o => {});
message.channel.send(args.join(" "));
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["echo"],
permLevel: "User",
requiredPerms: ["MANAGE_MESSAGES"]
};
exports.help = {
name: "say",
category: "Fun",
description: "Makes Woomy copy what the user says.",
usage: "echo <-hide> [message]"
};

View file

@ -1,5 +1,5 @@
exports.run = (client, message) => {
message.channel.send(`**${message.guild}'s** icon is:\n${message.guild.iconURL}`)
message.channel.send(`**${message.guild}'s** icon is:\n${message.guild.iconURL({format: "png", dynamic: true})}`)
};
exports.conf = {

View file

@ -1,40 +1,84 @@
exports.run = (client, message) => {
let guild = message.guild
var roleCount = 0;
let roles = guild.roles
roles.forEach((role) => { roleCount = roleCount + 1; });
var guild = message.guild
var badges = "";
var members = `${guild.memberCount} (${guild.memberCount-guild.members.cache.filter(member => member.user.bot).size} users | ${guild.members.cache.filter(member => member.user.bot).size} bots)`;
var chanCount = 0;
let channels = guild.channels
channels.forEach((channel) => { chanCount = chanCount + 1; });
var roles = 0;
guild.roles.cache.forEach((role) => {
roles = roles + 1;
});
var emojiList = "";
let emojis = guild.emojis;
emojis.forEach((emoji) => { emojiList = emojiList + emoji; });
eListOutput = `\n**Emojis:** ${emojiList}`;
if(emojiList === "") eListOutput = "";
var channels = 0;
var categories = 0;
var text = 0;
var voice = 0;
let vlvl = guild.verificationLevel;
if(vlvl === 0) vlvl = "None";
if(vlvl === 1) vlvl = "Low";
if(vlvl === 2) vlvl = "Medium";
if(vlvl === 3) vlvl = "(╯°□°)╯︵ ┻━┻"
if(vlvl === 4) vlvl = "┻━┻彡 ヽ(ಠ益ಠ)ノ彡┻━┻"
guild.channels.cache.forEach((channel) => {
if(channel.type == "category") {
categories = categories + 1;
} else {
if(channel.type == "text") {
text = text + 1;
};
content = `**ID:** ${guild.id}\n**Owner:** ${guild.owner}\n**Region:** ${guild.region}\n**Verification Level:** ${vlvl}\n**Members:** ${guild.memberCount}\n**Roles:** ${roleCount}\n**Channels:** ${chanCount}\n**Created:** ${guild.createdAt}${eListOutput}`;
if (content.length > 2048) {
eListOutput = "";
if(channel.type == "voice") {
voice = voice + 1;
};
content = `**ID:** ${guild.id}\n**Owner:** ${guild.owner}\n**Region:** ${guild.region}\n**Verification Level:** ${vlvl}\n**Members:** ${guild.memberCount}\n**Roles:** ${roleCount}\n**Channels:** ${chanCount}\n**Created:** ${guild.createdAt}`;
channels = channels + 1;
};
});
var channelString = `${channels} (${text} text | ${voice} voice | ${categories} categories)`
if(guild.premiumTier > 0) {
badges = badges += "<:boosted:685704824175853624> "
}
let embed = new Discord.RichEmbed()
if(guild.partnered == true) {
badges = badges += "<:partnered:685704834779054107> "
}
if(guild.verified == true) {
badges = badges += "<:verified:685704812435734569>"
}
if(badges.length > 0) {
badges = badges += "\n"
}
var boosts;
if(guild.premiumTier == 1) {
boosts = `${guild.premiumSubscriptionCount} (level 1)`
} else if(guild.premiumTier == 2) {
boosts = `${guild.premiumSubscriptionCount} (level 2)`
} else if(guild.premiumTier == 3) {
boosts = `${guild.premiumSubscriptionCount} (level 3)`
} else {
boosts = guild.premiumSubscriptionCount;
};
var emojis = 0;
var static = 0;
var animated = 0;
guild.emojis.cache.forEach((emoji) => {
if(emoji.animated == true) {
animated = animated + 1;
} else {
static = static + 1;
};
emojis = emojis + 1;
});
emojiString = `${emojis} (${static} static | ${animated} animated)`
let embed = new Discord.MessageEmbed()
.setColor(message.guild.member(client.user).displayHexColor)
.setAuthor(guild.name)
.setDescription(content)
.setThumbnail(message.guild.iconURL);
.setTitle(guild.name)
.setDescription(`${badges}• **ID:** ${guild.id}\n• **Owner:** ${guild.owner}\n• **Region:** ${guild.region.toProperCase()}\n• **Boosts:** ${boosts}\n• **Members:** ${members}\n• **Channels:** ${channelString}\n• **Roles:** ${roles}\n• **Emojis:** ${emojiString}\n• **Creation date:** ${guild.createdAt}`)
.setThumbnail(message.guild.iconURL({format: "png", dynamic: true}));
message.channel.send(embed);
};

View file

@ -3,9 +3,9 @@ exports.run = async (client, message, args) => {
const settings = message.settings;
if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {});
modChan = message.guild.channels.find(channel => channel.name === settings.modlogsChannel) || "__Disabled__";
chatChan = message.guild.channels.find(channel => channel.name === settings.chatlogsChannel) || "__Disabled__"
greetChan = message.guild.channels.get(settings.welcomeChannel) || "__Disabled__";
modChan = message.guild.channels.cache.find(channel => channel.name === settings.modlogsChannel) || "__Disabled__";
chatChan = message.guild.channels.cache.find(channel => channel.name === settings.chatlogsChannel) || "__Disabled__"
greetChan = message.guild.channels.cache.get(settings.welcomeChannel) || "__Disabled__";
prefix = settings.prefix;
var raidMode;
@ -23,10 +23,10 @@ exports.run = async (client, message, args) => {
raidMode += "`"
}
var modRole = message.guild.roles.get(settings.modRole);
var adminRole = message.guild.roles.get(settings.adminRole);
var autorole = message.guild.roles.get(settings.autorole);
var mutedRole = message.guild.roles.get(settings.mutedRole);
var modRole = message.guild.roles.cache.get(settings.modRole);
var adminRole = message.guild.roles.cache.get(settings.adminRole);
var autorole = message.guild.roles.cache.get(settings.autorole);
var mutedRole = message.guild.roles.cache.get(settings.mutedRole);
var blacklist = "";
if(settings.modRole == "off" || !modRole) {
@ -70,18 +70,17 @@ exports.run = async (client, message, args) => {
} else {
if(settings.blacklisted.length > 0) {
settings.blacklisted.forEach(function(user) {
blacklist += "`" + (client.users.get(user).tag || user.tag) + "`, "
blacklist += "`" + (client.users.cache.get(user).tag || user.tag) + "`, "
});
blacklist = blacklist.substring(0, blacklist.length - 2);
};
};
embed = new Discord.RichEmbed()
embed.setAuthor("Settings for: " + message.guild.name, message.guild.iconURL)
embed = new Discord.MessageEmbed()
embed.setAuthor("Settings for: " + message.guild.name, message.guild.iconURL({dynamic: true}))
embed.setColor(message.guild.member(client.user).displayHexColor)
embed.setDescription("You can edit these settings using the commands in the 'configure' section of the help command.")
embed.addField("General:", `Prefix: \`${prefix}\`\nChat logging: ${chatChan}\nMod logging: ${modChan}\nRaid mode: ${raidMode}\nJoin/leave channel: ${greetChan}\nWelcome message: ${welcomeMessage}\nLeave message: ${leaveMessage}`, true)
embed.addField("Roles:", `Moderator: ${modRole}\nAdministrator: ${adminRole}\nMuted: ${mutedRole}\nBlacklisted: ${blacklist}\nAutorole: ${autorole}`, true);
embed.addFields({ name: "General:", value: `Prefix: \`${prefix}\`\nChat logging: ${chatChan}\nMod logging: ${modChan}\nRaid mode: ${raidMode}\nJoin/leave channel: ${greetChan}\nWelcome message: ${welcomeMessage}\nLeave message: ${leaveMessage}`, inline: true}, {name: "Roles:", value: `Moderator: ${modRole}\nAdministrator: ${adminRole}\nMuted: ${mutedRole}\nBlacklisted: ${blacklist}\nAutorole: ${autorole}`, inline: true})
message.channel.send(embed)
};

View file

@ -6,7 +6,7 @@ exports.run = (client, message, args, level) => {
"<:error:466995152976871434> Nothing is playing."
);
let vc = message.guild.members.get(client.user.id).voiceChannel;
let vc = message.guild.members.cache.get(client.user.id).voiceChannel;
if(vc != message.member.voiceChannel) return message.channel.send(
'<:error:466995152976871434> You need to be in my voice channel to use this command!'

99
src/commands/softban.js Normal file
View file

@ -0,0 +1,99 @@
exports.run = async (client, message, args) => {
const settings = (message.settings = client.getSettings(message.guild.id));
if(!args[0]) {
return message.channel.send(
`<:error:466995152976871434> No username provided. Usage: \`${client.commands.get(`ban`).help.usage}\``
);
};
let user = message.mentions.members.first();
if (!user) {
let users;
users = client.searchForMembers(message.guild, args[0]);
if (users.length > 1)
return message.channel.send(
"<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead."
);
else if (users.length == 0)
return message.channel.send(
"<:error:466995152976871434> That user doesn't seem to exist. Try again!"
);
user = users[0];
};
if(!user.bannable) {
return message.channel.send(`<:error:466995152976871434> Specified user is not bannable.`)
};
let mod = message.guild.member(message.author);
let bot = message.guild.member(client.user);
if (user.roles.highest.position >= mod.roles.highest.position) {
return message.channel.send(
`<:error:466995152976871434> You can't softban people who are higher ranked than you are!`
);
};
if (user.roles.highest.position >= bot.roles.highest.position) {
return message.channel.send(
`<:error:466995152976871434> I can't softban people who are higher ranked than you myself!`
);
};
if(!user.bannable) {
return message.channel.send(`<:error:466995152976871434> Specified user is not bannable.`)
};
var days = args[args.length - 1]
try {
days = Number(days);
} catch(err) {};
console.log(typeof days)
console.log(days)
if(isNaN(days)) {
return message.channel.send(`<:error:466995152976871434> Invalid number. Did you forget to specify how many days worth of messages to clear? Usage: \`${client.commands.get(`softban`).help.usage}\``)
} else if (days < 1 || days > 7) {
return message.channel.send(`<:error:466995152976871434> Number too large/small. The max amount of days I can clear is 7.`)
} else {
await message.guild.members.ban(user, {reason: `Softbanned by ${message.author.tag}`, days: days});
await message.guild.members.unban(user);
message.channel.send(`<:success:466995111885144095> Softbanned \`${user.user.tag}\``);
if (settings.modlogsChannel !== "off") {
const channel = message.guild.channels.cache.find(
channel => channel.name === settings.modlogsChannel
);
if (channel) {
let embed = new Discord.MessageEmbed();
embed.setColor("#F38159");
embed.setAuthor("User softbanned!", user.user.avatarURL({format: "png", dynamic: true}));
embed.setDescription(
`• User: ${user.user.tag} (${user.user.id})\n• Mod: ${message.author} (${message.author.id})\n• Days cleared: ${days}`
);
try {
channel.send(embed);
} catch (err) {};
};
};
};
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: "Moderator",
requiredPerms: ["BAN_MEMBERS"]
};
exports.help = {
name: "softban",
category: "Moderation",
description: "Bans then unbans a user, clearing their messages.",
usage: "softban [user] [days]"
};

View file

@ -4,7 +4,7 @@ exports.run = async (client, message) => {
let guild = client.music.getGuild(message.guild.id);
if(guild.queue.length < 1 || !guild.playing || !guild.dispatcher) return message.channel.send("<:error:466995152976871434> Nothing is playing.");
if(!message.member.voiceChannel) return message.channel.send('<:error:466995152976871434> You need to be in voice channel to use this command!');
if(!message.member.voice.channel) return message.channel.send('<:error:466995152976871434> You need to be in voice channel to use this command!');
guild.playing = false;
guild.paused = false;

View file

@ -20,30 +20,31 @@ exports.run = async (client, message, [member, ...role2add], query) => {
}
let role = role2add.join(" ");
let gRole = message.guild.roles.find(r => r.name === role);
gRole = client.findRole(role, message);
if (!gRole) {
return message.channel.send(`<:error:466995152976871434> That role doesn't seem to exist. Try again!`);
}
};
let moderator = message.guild.member(message.author)
if (gRole.position >= moderator.highestRole.position) {
if (gRole.position >= moderator.roles.highest.position) {
return message.channel.send(
"<:error:466995152976871434> You cannot take roles higher than your own!"
);
}
var bot = message.guild.members.get(client.user.id)
if (gRole.position >= bot.highestRole.position) {
var bot = message.guild.members.cache.get(client.user.id)
if (gRole.position >= bot.roles.highest.position) {
return message.channel.send(
`<:error:466995152976871434> I can't take roles higher than my own!`
);
}
if (!user.roles.has(gRole.id)) {
if (!user.roles.cache.has(gRole.id)) {
return message.channel.send(
"<:error:466995152976871434> They don't have that role!"
);
}
await user.removeRole(gRole.id);
await user.roles.remove(gRole.id);
message.channel.send(
`<:success:466995111885144095> Took the \`${gRole.name}\` role from \`${
user.user.tag
@ -51,15 +52,15 @@ exports.run = async (client, message, [member, ...role2add], query) => {
);
if (client.getSettings(message.guild.id).modlogsChannel !== "off") {
const channel = message.guild.channels.find(
const channel = message.guild.channels.cache.find(
channel => channel.name === client.getSettings(message.guild.id).modlogsChannel
);
if (channel) {
let embed = new Discord.RichEmbed();
let embed = new Discord.MessageEmbed();
embed.setColor("#008369");
embed.setAuthor("Role taken:", user.user.avatarURL);
embed.setDescription(` User: ${user} (${user.user.id})\n Mod: ${message.author} (${message.author.id})\n Role: ${gRole}`)
embed.setAuthor("Role taken:", user.user.avatarURL({format: "png", dynamic: true}));
embed.setDescription(` User: ${user} (${user.user.id})\n Mod: ${message.author} (${message.author.id})\n Role: ${gRole}`)
try {
channel.send({ embed });
} catch (err) {

View file

@ -21,53 +21,50 @@ exports.run = async (client, message, args, level) => {
if (user.user.id === client.user.id) {
return message.channel.send("lol no")
}
if (user.user.id === message.guild.owner.id) {
return message.channel.send("<:error:466995152976871434> You can't unmute the owner!")
}
let moderator = message.guild.member(message.author)
if (message.settings.mutedRole.position >= moderator.highestRole.position && level < 2) {
if (message.settings.mutedRole.position >= moderator.roles.highest.position && level < 2) {
return message.channel.send(
"<:error:466995152976871434> The muted role is positioned above the moderator role! Please move the muted role below the moderator role."
);
}
if (user.highestRole.position >= moderator.highestRole.position && moderator.user.id !== message.guild.ownerID) {
if (user.roles.highest.position >= moderator.roles.highest.position && moderator.user.id !== message.guild.ownerID) {
return message.channel.send(
`<:error:466995152976871434> You can't unmute people who have a higher role than you!`
);
};
let bot = message.guild.member(client.user)
if (user.highestRole.position >= bot.highestRole.position) {
if (user.roles.highest.position >= bot.roles.highest.position) {
return message.channel.send(
`<:error:466995152976871434> I can't unmute people who have a higher role than me!`
);
}
let role = message.guild.roles.get(settings.mutedRole)
let role = message.guild.roles.cache.get(settings.mutedRole)
if(!role) {
return message.channel.send(
"<:error:466995152976871434> Mute role not found! Please set one using `~settings edit mutedRole <role>`"
);
}
if (!user.roles.has(role.id)) {
if (!user.roles.cache.has(role.id)) {
return message.channel.send("<:error:466995152976871434> They aren't muted!")
}
await user.removeRole(role.id);
await user.roles.remove(role.id);
message.channel.send(`<:success:466995111885144095> Unmuted \`${user.user.tag}\``)
if (settings.modlogsChannel !== "off") {
const channel = message.guild.channels.find(
const channel = message.guild.channels.cache.find(
channel => channel.name === settings.modlogsChannel
);
if (channel) {
let embed = new Discord.RichEmbed();
let embed = new Discord.MessageEmbed();
embed.setColor("#7a2f8f");
embed.setAuthor("User unmuted!", user.user.avatarURL);
embed.setDescription(` User: ${user} (${user.user.id})\n Mod: ${message.author} (${message.author.id})`)
embed.setAuthor("User unmuted!", user.user.avatarURL({format: "png", dynamic: true}));
embed.setDescription(` User: ${user} (${user.user.id})\n Mod: ${message.author} (${message.author.id})`)
try {
channel.send({ embed });
} catch (err) {

View file

@ -19,14 +19,14 @@ exports.run = async (client, message, args) => {
"<:error:466995152976871434> Example cannot exceed 2000 characters!"
);
embed = new Discord.RichEmbed()
embed = new Discord.MessageEmbed()
.setTitle(output.word)
.setURL(output.urbanURL)
.setColor("#EFFF00")
.setDescription(output.definition || "None")
.addField("Example", output.example || "None")
.addField("Upvotes", output.thumbsUp, true)
.addField("Downvotes", output.thumbsDown, true)
.addFields(
{name: "Example", value: output.example || "None"}, {name: "Upvotes", value: output.thumbsUp, inline: true}, {name: "Downvotes", value: output.thumbsDown, inline: true}
)
.setFooter(`Submitted by ${output.author}`)
message.channel.send(embed);

View file

@ -1,24 +1,26 @@
const Discord = require("discord.js");
exports.run = (client, message, args) => {
var user;
var nickString = "";
var guildString = "";
var guild;
var nick = "";
var roles = "";
var presence = "";
var badges = "";
var status;
var createdAt;
var avurl;
var tag;
var id;
var createdAt;
var colour;
var avatarURL;
var bot;
if(message.guild) {
user = message.mentions.members.first();
if(!args[0]) {
user = message.guild.members.get(message.author.id)
}
user = message.guild.members.cache.get(message.author.id)
};
if (!user) {
var users;
users = client.searchForMembers(message.guild, args[0]);
@ -33,56 +35,78 @@ exports.run = (client, message, args) => {
user = users[0];
};
if (!user.nickname) {
nickString = "";
} else {
nickString = `**Nickname:** ${user.nickname}\n`;
if(user.nickname) {
nick = `\n• **Nickname:** ${user.nickname}`;
};
var roleList = "`";
let roles = user.roles;
roles.forEach((role) => { roleList = roleList + role.name + "`, `"; });
roleList = roleList.substring(0, roleList.length - 4);
roleList += "`";
guildString = `\n **Roles:** ${roleList}\n**Guild Join Date:** ${user.joinedAt}`
if(user.user.id == message.guild.ownerID) {
badges = "<:owner:685703193694306331>\n"
}
tag = user.user.tag;
createdTimestamp = user.user.createdTimestamp;
var date = new Date(createdTimestamp * 1000);
var hours = date.getHours();
var minutes = "0" + date.getMinutes();
var seconds = "o" + date.getSeconds();
console.log(date)
user.roles.cache.forEach((role) => {
roles = roles + role.name + "`, `"
});
roles = roles.substr(0, roles.length -4);
guild = `\n• **Roles:** \`${roles}\`\n• **Server join date:** ${user.joinedAt}`;
id = user.user.id;
tag = user.user.tag;
colour = user.displayHexColor;
avurl = user.user.avatarURL({format: "png", dynamic: true});
createdAt = user.user.createdAt;
colour = user.displayHexColor
avatarURL = user.user.avatarURL
} else {
user = message.author;
tag = user.tag;
id = user.id;
createdAt = user.createdAt;
tag = user.tag;
colour = ["#ff9d68", "#ff97cb", "#d789ff", "#74FFFF"].random();
avatarURL = user.avatarURL;
avurl = user.avatarURL({format: "png", dynamic: true});
createdAt = user.createdAt;
};
let isBot = user.bot;
if (isBot === true) {
isBot = "Yes";
} else {
isBot = "No";
if(user.presence.status == "online") {
status = `online <:status_online:685462758023626762>`
};
if (!user.presence.game) {
gameString = "";
} else {
gameString = `\n**Playing:** ${user.presence.game}`;
if(user.presence.status == "idle") {
status = `idle <:status_idle:685462771529154561>`
};
embed = new (require("discord.js")).RichEmbed();
embed.setTitle(tag)
embed.setDescription(
`${nickString}**ID:** ${id}\n**Bot:** ${isBot}\n**Status:** ${user.presence.status}${gameString}${guildString}\n**Discord Join Date:** ${createdAt}`
);
if(user.presence.status == "dnd") {
status = `do not disturb <:status_dnd:685462782963220495>`
};
if(user.presence.status == "offline") {
status = `offline <:status_offline:685462758229016633>`
};
if(user.presence.activities[0]) {
presence = "\n• **Presence:** ";
if(user.presence.activities[0].type == "PLAYING") {
presence += `Playing ${user.presence.activities[0].name}`;
};
if(user.presence.activities[0].type == "STREAMING") {
presence += `Streaming ${user.presence.activities[0].name}`;
};
if(user.presence.activities[0].type == "CUSTOM_STATUS") {
presence += `${user.presence.activities[0].state}`;
};
};
embed = new Discord.MessageEmbed();
embed.setTitle(tag);
embed.setThumbnail(avurl);
embed.setDescription(`${badges}• **ID:** ${id}${nick}\n• **Status:** ${status}${presence}${guild}\n• **Account created:** ${createdAt}`)
embed.setColor(colour);
embed.setThumbnail(avatarURL);
message.channel.send(embed);
};

View file

@ -1,7 +1,7 @@
const weather = require("weather-js");
exports.run = async (client, message, args, error) => {
if(!args[0]) {
message.channel.send(
return message.channel.send(
`<:error:466995152976871434> You didn't give me a location. Usage: \`${client.commands.get(`weather`).help.usage}\``
);
};
@ -9,10 +9,13 @@ exports.run = async (client, message, args, error) => {
if(args.join(" ").toLowerCase() == "antarctica") {
return;
}
message.channel.startTyping();
weather.find({search: args.join(" "), degreeType: 'C'}, function(err, result) {
if(err) client.logger.log(`weather.js error: ${JSON.stringify(error)}`, "error")
if(result.length < 2 || !result) {
message.channel.stopTyping();
return message.channel.send("<:error:466995152976871434> City not found!");
};
@ -34,11 +37,12 @@ exports.run = async (client, message, args, error) => {
embedColour = "#ff614f"
};
embed = new Discord.RichEmbed();
embed = new Discord.MessageEmbed();
embed.addField(`Weather for ${location.name}:`, `**Condition:** ${current.skytext}\n**Temperature:** ${current.temperature}\n**Feels like:** ${current.feelslike}\n**Humidity:** ${current.humidity}%\n**Wind:** ${current.winddisplay}\n**Warnings:** ${warning}`)
embed.setThumbnail(current.imageUrl)
embed.setFooter(`Last updated at ${current.observationtime} ${current.date}`)
embed.setColor(embedColour)
embed.setColor(embedColour)
message.channel.stopTyping();
message.channel.send(embed)
});
};

View file

@ -2,17 +2,18 @@ const Discord = require("discord.js")
exports.run = async (client, message) =>{
message.channel.send("Woomy!")
const voiceChannel = message.member.voiceChannel;
const voiceChannel = message.member.voice.channel;
if (!voiceChannel) return;
const permissions = voiceChannel.permissionsFor(message.client.user);
if (!permissions.has('CONNECT')) return;
if (!permissions.has('SPEAK')) return;
if (client.music.getGuild(message.guild.id).playing == true) return;
if (!voiceChannel.permissionsFor(message.client.user).has('CONNECT')) return;
if (!voiceChannel.permissionsFor(message.client.user).has('SPEAK')) return;
if (client.music.getGuild(message.guild.id).playing == true || !client.music.getGuild(message.guild.id).queue[0]) return;
voiceChannel.join()
.then(connection => {
const dispatcher = connection.playFile(`/home/container/media/sounds/WOOMY.MP3`);
dispatcher.on("end", end => {voiceChannel.leave()});
const dispatcher = connection.play(`/home/container/resources/audio/WOOMY.MP3`);
dispatcher.on("finish", end => {voiceChannel.leave()});
})
};

View file

@ -1,3 +1,3 @@
module.exports = async (client, error) => {
client.logger.log(`Discord.js error: \n${JSON.stringify(error)}`, "error");
client.logger.log(`d.js err: \n${JSON.stringify(error.stack)}`, "error");
};

View file

@ -1,17 +1,15 @@
const Discord = require("discord.js");
const chalk = require("chalk");
module.exports = (client, guild) => {
client.logger.log(`Guild joined.`, "info");
client.settings.ensure(guild.id, client.config.defaultSettings);
if(client.devmode === true) return;
channel = client.channels.get("458896120639127552");
let embed = new Discord.RichEmbed();
if(client.devmode == false) {
channel = client.channels.cache.get("458896120639127552");
embed = new Discord.MessageEmbed();
embed.setColor("#F38159");
embed.setAuthor("Joined a new server:")
embed.setDescription(` Name: \`${guild.name}\`\n Size: \`${guild.members.size}\``)
embed.setFooter(`I'm now in ${client.guilds.size} servers!`)
channel.send(embed);
embed.setDescription(`Joined a new server with \`${guild.members.cache.size}\` members! I'm now in \`${client.guilds.cache.size}\` servers.`)
channel.send(embed)
};
};

View file

@ -1,24 +1,20 @@
const Discord = require("discord.js");
const chalk = require('chalk');
const Discord = require('discord.js');
module.exports = (client, guild) => {
client.logger.log(chalk.redBright(`Guild left.`), "cmd");
client.logger.log(`Guild left.`, "info");
if(client.devmode === true) return;
if(!guild) {
if(!guild.available) {
return;
}
};
channel = client.channels.get("458896120639127552");
let embed = new Discord.RichEmbed();
embed.setColor("#9494FF");
embed.setAuthor("Left a server:")
embed.setDescription(` Name: \`${guild.name}\``)
embed.setFooter(`I'm now in ${client.guilds.size} servers.`)
channel.send(embed);
channel = client.channels.cache.get("458896120639127552");
embed = new Discord.MessageEmbed();
embed.setColor("#9494FF");
embed.setDescription(`Left a server. I'm now in \`${client.guilds.cache.size}\` servers.`)
channel.send(embed)
if (client.settings.has(guild.id)) {
client.settings.delete(guild.id);
}
};
};

View file

@ -2,7 +2,7 @@ module.exports = async (client, member) => {
const settings = client.getSettings(member.guild.id);
if (settings.welcomeMessage !== "off") {
let chanExists = member.guild.channels.get(settings.welcomeChannel)
let chanExists = member.guild.channels.cache.get(settings.welcomeChannel)
if (!chanExists) {
return;
};
@ -11,17 +11,17 @@ module.exports = async (client, member) => {
welcomeMessage = welcomeMessage.replace("[[members]]", member.guild.memberCount);
member.guild.channels
.get(settings.welcomeChannel)
.cache.get(settings.welcomeChannel)
.send(welcomeMessage)
.catch(console.error);
}
if (settings.autorole !== "off") {
let aRole = member.guild.roles.get(settings.autorole)
let aRole = member.guild.roles.cache.get(settings.autorole)
if (!aRole) {
return;
};
await member.addRole(aRole.id).catch(console.error);
await member.roles.add(aRole.id).catch(console.error);
};
if(settings.raidMode !== "off") {
@ -29,18 +29,18 @@ module.exports = async (client, member) => {
member.kick("User bounced.")
if (settings.chatlogsChannel !== "off") {
const channel = member.guild.channels.find(
const channel = member.guild.channels.cache.find(
channel => channel.name === settings.chatlogsChannel
);
if (channel) {
let embed = new Discord.RichEmbed();
let embed = new Discord.MessageEmbed();
embed.setColor("#1f1f1f");
embed.setAuthor("User bounced:", member.user.avatarURL);
embed.setAuthor("User bounced:", member.user.avatarURL({dynamic: true}));
embed.setDescription(` User: ${member} (${member.user.id})`, true);
embed.setFooter(`New users are being automatically kicked because raidmode is enabled.`)
try {
channel.send({ embed });
channel.send(embed);
} catch (err) {
// probably no permissions to send messages/embeds there
};
@ -48,24 +48,24 @@ module.exports = async (client, member) => {
return;
}
}
let mRole = member.guild.roles.get(settings.mutedRole)
let mRole = member.guild.roles.cache.get(settings.mutedRole)
if (!mRole) {
return;
};
await member.addRole(mRole.id).catch(console.error);
await member.roles.add(mRole.id).catch(console.error);
if (settings.chatlogsChannel !== "off") {
const channel = member.guild.channels.find(
const channel = member.guild.channels.cache.find(
channel => channel.name === settings.chatlogsChannel
);
if (channel) {
let embed = new Discord.RichEmbed();
let embed = new Discord.MessageEmbed();
embed.setColor("#1f1f1f");
embed.setAuthor("User automatically muted:", member.user.avatarURL);
embed.setAuthor("User automatically muted:", member.user.avatarURL({dynamic: true}));
embed.setDescription(` User: ${member} (${member.user.id})`, true);
embed.setFooter(`New users are being automatically muted because raidmode is enabled.`)
try {
channel.send({ embed });
channel.send(embed);
} catch (err) {
// probably no permissions to send messages/embeds there
};
@ -74,14 +74,14 @@ module.exports = async (client, member) => {
};
if (settings.chatlogsChannel !== "off") {
const channel = member.guild.channels.find(
const channel = member.guild.channels.cache.find(
channel => channel.name === settings.chatlogsChannel
);
if (channel) {
let embed = new Discord.RichEmbed();
let embed = new Discord.MessageEmbed();
embed.setColor("#0099e1");
embed.setAuthor("User joined:", member.user.avatarURL);
embed.setAuthor("User joined:", member.user.avatarURL({dynamic: true}));
embed.setDescription(` User: ${member} (${member.user.id})`, true);
try {
channel.send({ embed });

View file

@ -2,7 +2,7 @@ module.exports = async (client, member) => {
const settings = client.getSettings(member.guild.id);
if (settings.leaveMessage !== "off") {
let chanExists = member.guild.channels.get(settings.welcomeChannel)
let chanExists = member.guild.channels.cache.get(settings.welcomeChannel)
if (!chanExists) {
return;
};
@ -11,20 +11,20 @@ module.exports = async (client, member) => {
leaveMessage = leaveMessage.replace("[[members]]", member.guild.memberCount);
member.guild.channels
.get(settings.welcomeChannel)
.cache.get(settings.welcomeChannel)
.send(leaveMessage)
.catch(console.error);
};
if (settings.chatlogsChannel !== "off") {
const channel = member.guild.channels.find(
const channel = member.guild.channels.cache.find(
channel => channel.name === settings.chatlogsChannel
);
if (channel) {
let embed = new Discord.RichEmbed();
let embed = new Discord.MessageEmbed();
embed.setColor("#006798");
embed.setAuthor("User left:", member.user.avatarURL);
embed.setAuthor("User left:", member.user.avatarURL({dynamic: true}));
embed.setDescription(` ${member.user.tag} (${member.user.id})`, true);
try {
channel.send({ embed });

View file

@ -22,11 +22,11 @@ module.exports = async (client, message) => {
perms = message.channel.permissionsFor(client.user);
var modRole = message.guild.roles.get(settings.modRole);
var adminRole = message.guild.roles.get(settings.adminRole);
var autorole = message.guild.roles.get(settings.autorole);
var mutedRole = message.guild.roles.get(settings.mutedRole);
var welcomeChannel = message.guild.channels.get(settings.welcomeChannel);
var modRole = message.guild.roles.cache.get(settings.modRole);
var adminRole = message.guild.roles.cache.get(settings.adminRole);
var autorole = message.guild.roles.cache.get(settings.autorole);
var mutedRole = message.guild.roles.cache.get(settings.mutedRole);
var welcomeChannel = message.guild.channels.cache.get(settings.welcomeChannel);
if(!welcomeChannel && settings.welcomeChannel != "off" || !adminRole && settings.adminRole != "None set" || !modRole && settings.modRole != "None set" || !mutedRole && settings.mutedRole != "None set" || !autorole && settings.autorole != "off") {
@ -37,7 +37,7 @@ module.exports = async (client, message) => {
var welcomeReset = false;
if(!adminRole && settings.adminRole != "None set") {
var role = message.guild.roles.find(r => r.name === settings.adminRole);
var role = message.guild.roles.cache.find(r => r.name === settings.adminRole);
if(!role) {
adminReset = true;
client.settings.set(message.guild.id, client.config.defaultSettings.adminRole, "adminRole");
@ -47,7 +47,7 @@ module.exports = async (client, message) => {
};
if(!mutedRole && settings.mutedRole != "None set") {
var role = message.guild.roles.find(r => r.name === settings.mutedRole);
var role = message.guild.roles.cache.find(r => r.name === settings.mutedRole);
if(!role) {
mutedReset = true;
client.settings.set(message.guild.id, client.config.defaultSettings.mutedRole, "mutedRole");
@ -57,7 +57,7 @@ module.exports = async (client, message) => {
};
if(!modRole && settings.modRole != "None set") {
var role = message.guild.roles.find(r => r.name === settings.modRole);
var role = message.guild.roles.cache.find(r => r.name === settings.modRole);
if(!role) {
modReset = true;
client.settings.set(message.guild.id, client.config.defaultSettings.modRole, "modRole");
@ -67,7 +67,7 @@ module.exports = async (client, message) => {
};
if(!autorole && settings.autorole != "off") {
var role = message.guild.roles.find(r => r.name === settings.autorole);
var role = message.guild.roles.cache.find(r => r.name === settings.autorole);
if(!role) {
autoReset = true;
client.settings.set(message.guild.id, client.config.defaultSettings.autorole, "autorole");
@ -77,7 +77,7 @@ module.exports = async (client, message) => {
};
if(!welcomeChannel && settings.welcomeChannel != "off") {
var channel = message.guild.channels.find(c => c.name === settings.welcomeChannel);
var channel = message.guild.channels.cache.find(c => c.name === settings.welcomeChannel);
if(!channel) {
welcomeReset = true;
client.settings.set(message.guild.id, client.config.defaultSettings.welcomeChannel, "welcomeChannel");
@ -119,7 +119,7 @@ module.exports = async (client, message) => {
};
if (!message.member) {
await message.guild.fetchMember(message.author);
await message.guild.members.fetch(message.author);
};
if(message.settings.blacklisted != "ARRAY" && settings.blacklisted.length > 0) {
@ -144,10 +144,10 @@ module.exports = async (client, message) => {
const cmd = client.commands.get(command) || client.commands.get(client.aliases.get(command));
if (!cmd) return;
if (commandRanRecently.has(message.author.id)) {
return message.channel.send(
`<:wait:467115775849922570> You are being ratelimited. Please try again in 2 seconds.`
`⏱️ You are being ratelimited. Please try again in 2 seconds.`
)
.then(m => m.delete(2000));
};
@ -219,9 +219,9 @@ module.exports = async (client, message) => {
commandRanRecently.add(message.author.id);
setTimeout(() => {
commandRanRecently.delete(message.author.id);
}, 2000);
}, {timeout: 2000});
client.logger.cmd(`${client.config.permLevels.find(l => l.level === level).name} ${message.author.username} (${message.author.id}) ran command ${cmd.help.name}`);
cmd.run(client, message, args, level);
};
};

View file

@ -6,7 +6,7 @@ module.exports = (client, message) => {
const settings = (message.settings = client.getSettings(message.guild.id));
if (settings.chatlogsChannel !== "off") {
const channel = message.guild.channels.find(
const channel = message.guild.channels.cache.find(
channel => channel.name === settings.chatlogsChannel
)
@ -21,9 +21,9 @@ module.exports = (client, message) => {
}
if (channel) {
let embed = new Discord.RichEmbed();
let embed = new Discord.MessageEmbed();
embed.setColor("#f93a2f");
embed.setAuthor("Message deleted!", message.member.user.avatarURL);
embed.setAuthor("Message deleted!", message.member.user.avatarURL({dynamic: true}));
if (msg == "") {
msg = "**An image was deleted, but is not shown for privacy reasons.**"
} else {

View file

@ -8,14 +8,14 @@ module.exports = (client, omsg, nmsg) => {
));
if (settings.chatlogsChannel !== "off") {
const channel = nmsg.guild.channels.find(
const channel = nmsg.guild.channels.cache.find(
channel => channel.name === settings.chatlogsChannel
);
if (channel) {
let embed = new Discord.RichEmbed();
let embed = new Discord.MessageEmbed();
embed.setColor("#fff937");
embed.setAuthor("Message Edited!", nmsg.member.user.avatarURL);
embed.setAuthor("Message Edited!", nmsg.member.user.avatarURL({dynamic: true}));
if (omsg.content == "") {
omsg.content = "**[IMAGE]**"
} else if (nmsg.content == "") {
@ -29,7 +29,7 @@ module.exports = (client, omsg, nmsg) => {
return;
}
embed.setDescription(` Author: ${nmsg.member} (${nmsg.member.user.id})\n Channel: ${nmsg.channel}\n Old message: ${omsg.content}\n New message: ${nmsg.content}`)
embed.setDescription(` Author: ${nmsg.member} (${nmsg.member.user.id})\n• Channel: ${nmsg.channel}\n• Old message: ${omsg.content}\n New message: ${nmsg.content}`)
try {
channel.send({ embed });
} catch (err) {

View file

@ -6,13 +6,13 @@ module.exports = client => {
client.lockActivity = false;
client.logger.log(`Connected to Discord as ${client.user.tag} | v${client.update.version}`, "ready");
client.logger.log(`Connected to Discord as ${client.user.tag} | v${client.version.number}`, 'ready');
let channel;
let channel1;
try { channel = client.guilds.get('410990517841690625').channels.get('570963998342643732'); } catch(err) {};
try { channel1 = client.guilds.get('410990517841690625').channels.get('570963481189154822'); } catch(err) {};
try { channel = client.guilds.cache.get('410990517841690625').channels.cache.get('570963998342643732'); } catch(err) {};
try { channel1 = client.guilds.cache.get('410990517841690625').channels.cache.get('570963481189154822'); } catch(err) {};
if(client.devmode == true) {
client.logger.warn("Running in development mode.")
@ -25,8 +25,9 @@ module.exports = client => {
let randomActivity = activityArray.random();
client.user.setActivity(`${prefix + randomActivity} | v${client.update.version}`, {type: "PLAYING"});
client.user.setActivity(`${prefix + randomActivity} | v${client.version.number}`, {type: "PLAYING"});
setInterval(() => {
randomActivity = activityArray.random();
if(client.lockActivity == false) client.user.setActivity(`${prefix + randomActivity} | v${client.update.version}`, {type: "PLAYING"})}, 30000);
if(client.lockActivity == false) client.user.setActivity(`${prefix + randomActivity} | v${client.version.number}`, {type: "PLAYING"});
}, 30000);
};

67
src/index.js Normal file
View file

@ -0,0 +1,67 @@
const Discord = require('discord.js');
const { promisify } = require('util');
const readdir = promisify(require('fs').readdir);
const Enmap = require('enmap');
const chalk = require('chalk');
const DBL = require("dblapi.js");
const client = new Discord.Client();
client.config = require('../config');
client.version = require('../version.json');
client.logger = require('./modules/Logger');
require("./modules/functions")(client);
client.logger.setClient(client);
client.commands = new Enmap();
client.aliases = new Enmap();
client.settings = new Enmap({name: 'settings', dataDir: '../data'});
client.blacklist = new Enmap({name: 'blacklist', dataDir: '../data'});
client.devmode = false;
if(process.env['USER'] != 'container') {
client.devmode = true;
};
if(client.devmode === false) {
const dblapi = new DBL(client.config.dblkey, client);
};
const init = async () => {
const cmdFiles = await readdir("./commands/");
client.logger.info(`Loading ${cmdFiles.length} commands.`);
cmdFiles.forEach(file => {
if (!file.endsWith(".js")) {
return;
};
const response = client.loadCommand(file);
if (response) {
console.log(response);
};
});
const evtFiles = await readdir("./events/");
client.logger.info(`Loading ${evtFiles.length} events.`);
evtFiles.forEach(file => {
if (!file.endsWith(".js")) {
return;
};
const eventName = file.split(".")[0];
const event = require(`./events/${file}`);
client.on(eventName, event.bind(null, client));
});
client.levelCache = {};
for (let i = 0; i < client.config.permLevels.length; i++) {
const thisLevel = client.config.permLevels[i];
client.levelCache[thisLevel.name] = thisLevel.level;
};
if(client.devmode === true) {
client.login(client.config.devtoken);
} else {
client.login(client.config.token);
};
};
init();

View file

@ -2,53 +2,63 @@ const chalk = require("chalk");
const moment = require("moment");
exports.log = (content, type = "log") => {
const timestamp = `[${moment().format("YYYY-MM-DD HH:mm:ss")}]`;
const timestamp1 = `\`${moment().format("YYYY-MM-DD HH:mm:ss")}\`:`;
const timestamp = chalk.grey(`[${moment().format("YYYY-MM-DD HH:mm:ss")}]`);
let channel;
try { channel = client.guilds.get('410990517841690625').channels.get('570963481189154822'); } catch(err) {}
try { channel = client.guilds.cache.get('410990517841690625').channels.cache.get('570963481189154822'); } catch(err) {}
switch (type) {
case "log": {
try { if (client.user.id === "435961704145485835") {
channel.send(`${timestamp1} ` + content);
};
} catch(err) {};
return console.log(`${timestamp} ${chalk.cyanBright(`[${type.toUpperCase()}] -`)} ${content} `);
case "info": {
try {
if (client.devmode == false) {
channel.send(`\`${timestamp}\`: ` + content);
};
} catch(err) {};
return console.log(`${timestamp} ${chalk.cyanBright(`[${type.toUpperCase()}]`)} ${content} `);
};
case "warn": {
try { if (client.user.id === "435961704145485835") {
channel.send(`${timestamp1} ` + content);
};
} catch(err) {};
try {
if (client.devmode == false) {
channel.send(`\`${timestamp}\`: ` + content);
};
} catch(err) {};
return console.log(`${timestamp} ${chalk.yellowBright(`[${type.toUpperCase()}]`)} ${content} `);
};
case "error": {
try { if (client.user.id === "439594675230212096") {
channel.send(`${timestamp1} ` + content);
};
} catch(err) {}
try {
if (client.devmode == false) {
channel.send(`\`${timestamp}\`: ` + content);
};
} catch(err) {}
return console.log(`${timestamp} ${chalk.redBright(`[${type.toUpperCase()}]`)} ${content} `);
};
case "debug": {
try { if (client.user.id === "435961704145485835") {
channel.send(`${timestamp1} ` + content);
};
} catch(err) {};
try {
if (client.devmode == false) {
channel.send(`\`${timestamp}\`: ` + content);
};
} catch(err) {};
return console.log(`${timestamp} ${chalk.magentaBright(`[${type.toUpperCase()}]`)} ${content} `);
};
case "cmd": {
try { if (client.user.id === "435961704145485835") {
channel.send(`${timestamp1} ` + content);
};
} catch(err) {};
try {
if (client.devmode == false) {
channel.send(`\`${timestamp}\` ` + content);
};
} catch(err) {};
return console.log(`${timestamp} ${chalk.whiteBright(`[${type.toUpperCase()}]`)} ${content}`);
};
case "ready": {
return console.log(`${timestamp} ${chalk.greenBright (`[${type.toUpperCase()}]`)} ${content}`);
};
default: throw new TypeError("Logger type must be either warn, debug, log, ready, cmd or error.");
default: throw new TypeError("Logger type must be either warn, debug, info, ready, cmd or error.");
};
};
@ -58,9 +68,10 @@ exports.warn = (...args) => this.log(...args, "warn");
exports.debug = (...args) => this.log(...args, "debug");
exports.info = (...args) => this.log(...args, "info");
exports.cmd = (...args) => this.log(...args, "cmd");
exports.setClient = function(c)
{
exports.setClient = function(c) {
client = c;
};

View file

@ -70,7 +70,6 @@ module.exports = client => {
client.loadCommand = commandName => {
try {
client.logger.log(`Loading command: ${commandName}`);
const props = require(`../commands/${commandName}`);
if (props.init) {
props.init(client);
@ -109,15 +108,6 @@ module.exports = client => {
return false;
};
// EMBED COLOUR CONTROL
client.embedColour = function(msg) {
if(!msg.guild) {
return ["#ff9d68", "#ff97cb", "#d789ff", "#74FFFF"].random();
} else {
return msg.guild.member(client.user).displayHexColor;
};
};
// MEMBER SEARCH
client.searchForMembers = function(guild, query) {
if (!query) return;
@ -127,14 +117,14 @@ module.exports = client => {
var b;
try {
b = guild.members.find(x => x.displayName.toLowerCase() == query);
if (!b) guild.members.find(x => x.user.username.toLowerCase() == query);
b = guild.members.cache.find(x => x.displayName.toLowerCase() == query);
if (!b) guild.members.cache.find(x => x.user.username.toLowerCase() == query);
} catch (err) {};
if (b) a.push(b);
guild.members.forEach(member => {
guild.members.cache.forEach(member => {
if (
(member.displayName.toLowerCase().startsWith(query) ||
member.user.username.toLowerCase().startsWith(query)) &&
member.user.tag.toLowerCase().startsWith(query)) &&
member.id != (b && b.id)
) {
a.push(member);
@ -143,7 +133,7 @@ module.exports = client => {
return a;
};
// Music stuff
// MUSIC
client.music = {guilds: {}};
client.music.isYoutubeLink = function(input) {
@ -194,7 +184,7 @@ module.exports = client => {
client.music.play = async function(message, input, bypassQueue)
{
let voiceChannel = message.member.voiceChannel;
let voiceChannel = message.member.voice.channel;
if(!voiceChannel) return message.channel.send('<:error:466995152976871434> You need to be in a voice channel to use this command!');
let permissions = voiceChannel.permissionsFor(client.user);
@ -204,7 +194,7 @@ module.exports = client => {
if (!permissions.has('SPEAK')) {
return message.channel.send('<:error:466995152976871434> I do not have permission to join your voice channel.');
}
if (message.member.voiceChannel.joinable != true) {
if (voiceChannel.joinable != true) {
return message.channel.send("<:error:466995152976871434> I do not have permission to join your voice channel.")
}
@ -260,9 +250,9 @@ module.exports = client => {
try
{
let dispatcher = client.music.getGuild(message.guild.id).dispatcher = connection.playOpusStream(await ytdl("https://www.youtube.com/watch?v=" + id, {highWaterMark: 1024 * 1024 * 32}));
let dispatcher = client.music.getGuild(message.guild.id).dispatcher = connection.play(await ytdl("https://www.youtube.com/watch?v=" + id, {highWaterMark: 1024 * 1024 * 32}), {type: 'opus'});
dispatcher.on('end', (a, b) =>
dispatcher.on('finish', (a, b) =>
{
end(a == "silent");
});
@ -284,7 +274,7 @@ module.exports = client => {
}
}
// COVNERT SECONDS TO TIMESTAMP
// MUSIC - TIMESTAMP
client.createTimestamp = function(duration){
hrs = ~~(duration / 60 / 60),
min = ~~(duration / 60) % 60,
@ -310,7 +300,29 @@ module.exports = client => {
return time;
};
// MISCELLANEOUS NON-CRITICAL FUNCTIONS
//FIND ROLE
client.findRole = function(input, message) {
var role;
role = message.guild.roles.cache.find(r => r.name.toLowerCase() === input.toLowerCase());
if(!role) {
role = message.guild.roles.cache.get(input.toLowerCase());
};
if(!role) {
return;
};
return role;
};
// EMBED COLOUR
client.embedColour = function(msg) {
if(!msg.guild) {
return ["#ff9d68", "#ff97cb", "#d789ff", "#74FFFF"].random();
} else {
return msg.guild.member(client.user).displayHexColor;
};
};
// <String>.toPropercase() returns a proper-cased string
Object.defineProperty(String.prototype, "toProperCase", {
@ -340,6 +352,6 @@ module.exports = client => {
});
process.on("unhandledRejection", err => {
client.logger.error(`Unhandled rejection: ${err}`);
client.logger.error(`Unhandled rejection: ${err.stack}`);
});
};

View file

@ -1,4 +0,0 @@
{
"version": "1.0.2",
"changelog": "**Updated to 1.0:**\n> - Music commands have been competely reworked. They're now less buggy and more feature rich!\n> - Added `nowplaying` command\n> - Added `blacklist` command, which lets you stop users from using commands in your server\n> - Woomy works in DM's again\n> - Renamed `calculate` to `math`\n> - The filter has been removed because it sucked\n> - Lots of minor changes to lots of commands\n> - Woomy now lists the permissions she needs to run specific commands in `help`\n> - Invite now lets you choose what permissions Woomy gets\n**Notes:**\n> - Woomy skipped from 0.7.0 to 1.0 so she could have a better way to name her updates. For example, the X in (X.Y.Z) will change only if there is a huge update like a rewrite, Y will change when new features are added to Woomy and Z will change when minor updates are made, like bug fixes.\n> - Woomy is now open source! You can view her code at https://github.com/mudkipscience/woomy"
}

4
version.json Normal file
View file

@ -0,0 +1,4 @@
{
"number": "1.1.0",
"changelog": "**1.1.0 CHANGELOG:**\n> • Added `~softban`, bans and unbans a user to clear messages\n> • Added `~emoji`, enlarges custom emojis\n> • Added `~inspirobot`, generates an inspirational quote\n> • `~serverinfo` has been changed to be more consistent, and also now displays boosts and if the server is partnered and stuff\n> • `~userinfo` has been changed to be more consistent, also added some stuff\n> • `~about` has been changed, added a thumbnail and removed the description\n> • `~colour` has been changed, it can now generate colours from text\n> • `~hackban` no longer has its own embed\n> • `~eval` now logs to hastebin if output is too large\n> • role names are no longer case sensitive\n> • `~echo` renamed `~say`\n> • Users with the ADMINISTRATOR permission now automatically recieve woomy admin\n> • Fixed `~flip`, `~purge`, `~bohemian_rhapsody` and `~creeper`\n> • Guild join/leave messages no longer include the guild name\n> • Some emojis have been changed\n> • Woomy now supports discord.js v12\n> • Files have been restructured\n> • Logger now logs error stack\n> • Restart now exits with code 0"
}

View file

@ -1,63 +0,0 @@
const Discord = require("discord.js");
const { promisify } = require("util");
const readdir = promisify(require("fs").readdir);
const Enmap = require("enmap");
const chalk = require("chalk");
const client = new Discord.Client();
client.config = require("./config");
client.update = require("./update.json");
client.logger = require("./src/modules/Logger");
client.logger.setClient(client);
require("./src/modules/functions.js")(client);
if(process.env['USER'] != 'container') {
client.devmode = true;
};
if(client.devmode === false) {
const DBL = require("dblapi.js");
const dbl = new DBL(client.config.dblkey, client);
};
client.commands = new Enmap();
client.aliases = new Enmap();
client.settings = new Enmap({name: "settings"});
client.warnings = new Enmap({name: "warnings"});
client.blacklist = new Enmap({name: "blacklist"});
//client.points = new Enmap({name: "points"});
const init = async () => {
const cmdFiles = await readdir("./src/commands/");
client.logger.log(chalk.greenBright(`Loading ${cmdFiles.length} commands.`));
cmdFiles.forEach(f => {
if (!f.endsWith(".js")) return;
const response = client.loadCommand(f);
if (response) console.log(response);
});
const evtFiles = await readdir("./src/events/");
client.logger.log(chalk.greenBright(`Loading ${evtFiles.length} events.`));
evtFiles.forEach(file => {
const eventName = file.split(".")[0];
client.logger.log(`Loading Event: ${eventName}`);
const event = require(`./src/events/${file}`);
client.on(eventName, event.bind(null, client));
});
client.levelCache = {};
for (let i = 0; i < client.config.permLevels.length; i++) {
const thisLevel = client.config.permLevels[i];
client.levelCache[thisLevel.name] = thisLevel.level;
}
if(client.devmode === true) {
client.login(client.config.devtoken);
}
if(client.devmode !== true) {
client.login(client.config.token);
}
};
init();