Skip to content
This repository was archived by the owner on Dec 17, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion commands/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const embeds = require("../utilities/embeds");
const packagejson = require("../package.json");
const config = require("../config.json");
var os = require("os");

module.exports = {
Expand All @@ -10,6 +11,10 @@ module.exports = {
botPermissions: ["EMBED_LINKS"],
aliases: ["info"],
execute(message, args) {
message.channel.send(embeds.aboutEmbed(`${packagejson.version} (${packagejson.date})`, packagejson.dependencies["discord.js"].substring(1), `${os.type().replace(/_/g, " ")} ${os.release}`));
let owners = config.misc.owner;
for (let i = 0; i < owners.length; i++) {
owners[i] = `<@${owners[i]}>`;
}
message.channel.send(embeds.aboutEmbed(`${packagejson.version} (${packagejson.date})`, packagejson.dependencies["discord.js"].substring(1), `${os.type().replace(/_/g, " ")} ${os.release}`, owners));
},
};
2 changes: 1 addition & 1 deletion commands/counting.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
description: "Make VukkyBot tell things about counting!",
cooldown: 0,
guildOnly: true,
mysql: true,
requiredAPIs: ["mysql"],
usage: "<highscore or current>",
execute(message, args) {
var con = mysql.createConnection({
Expand Down
2 changes: 1 addition & 1 deletion commands/delwarn.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
args: true,
cooldown: 0,
guildOnly: true,
mysql: true,
requiredAPIs: ["mysql"],
usage: "<warning id>",
aliases: ["delwarning", "deletewarning", "deletewarn"],
execute(message, args) {
Expand Down
2 changes: 1 addition & 1 deletion commands/ohno.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const config = require("../config.json");
module.exports = {
name: "ohno",
description: "oh no! it's stupid",
botPermissions: ["ATTACH_FILES"],
botPermissions: ["ATTACH_FILES", "MANAGE_MESSAGES"],
args: true,
usage: "<text>",
async execute(message, args) {
Expand Down
2 changes: 1 addition & 1 deletion commands/opinion.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const config = require("../config.json");
module.exports = {
name: "opinion",
description: "father's son makes an opinion",
botPermissions: ["ATTACH_FILES"],
botPermissions: ["ATTACH_FILES", "MANAGE_MESSAGES"],
args: true,
usage: "[user] <text>",
async execute(message, args) {
Expand Down
2 changes: 1 addition & 1 deletion commands/rip.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const config = require("../config.json");
module.exports = {
name: "rip",
description: "rip",
botPermissions: ["ATTACH_FILES"],
botPermissions: ["ATTACH_FILES", "MANAGE_MESSAGES"],
usage: "[user]",
async execute(message, args) {
await message.react(config.misc.emoji.loading);
Expand Down
2 changes: 1 addition & 1 deletion commands/trash.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const config = require("../config.json");
module.exports = {
name: "trash",
description: "trash?",
botPermissions: ["ATTACH_FILES"],
botPermissions: ["ATTACH_FILES", "MANAGE_MESSAGES"],
usage: "[user]",
async execute(message, args) {
await message.react(config.misc.emoji.loading);
Expand Down
12 changes: 7 additions & 5 deletions commands/tweet.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
usage: "<content>",
guildOnly: true,
aliases: ["twt", "tw"],
requiredAPIs: ["twitter"],
execute(message, args) {
let attachments = [];
if(message.attachments.first()) attachments = message.attachments.map(attachment => attachment.url);
Expand Down Expand Up @@ -45,7 +46,7 @@ module.exports = {
if(!reaction || !reaction.emoji || !reaction.emoji.name) return message.channel.send("could not get result");
if(reaction.emoji.name == "⬆") {
await message.reactions.removeAll();
if(reaction.users.cache) console.log(`[twttr] tweet approved by ${reaction.users.cache.last().tag}: ${tweet}`);
if(reaction.users.cache) console.log(`[twttr] tweet by ${message.author.tag} (${message.author.id}) approved by ${reaction.users.cache.last().tag}: ${tweet}`);
var client = new Twitter({
consumer_key: process.env.TWITTER_KEY,
consumer_secret: process.env.TWITTER_SECRET,
Expand All @@ -68,7 +69,7 @@ module.exports = {
console.error(error);
await message.reactions.removeAll();
await message.react("❌");
message.reply("there was an error!", embeds.errorEmbed(`${error.message ? error.message : "Unknown error."}`));
message.reply("there was an error!", embeds.errorEmbed(error.message ? error.message : error[0].message ? error[0].message : "Unknown error."));
}
});
});
Expand All @@ -80,19 +81,20 @@ module.exports = {
.then(async function (tweet) {
await message.reactions.removeAll();
await message.react("✅");
console.log(`[twttr] tweet (https://twitter.com/i/status/${tweet.id_str}) by ${message.author.tag} (${message.author.id}) posted by ${reaction.users.cache.last().tag}: ${status.status}`);
message.reply(format(vukkytils.getString("TWEET_APPROVED"), `https://twitter.com/i/status/${tweet.id_str}`));
})
.catch(async function (error) {
await message.reactions.removeAll();
await message.react("❌");
message.reply("there was an error!", embeds.errorEmbed(`${error.message ? error.message : "Unknown error."}`));
throw error;
message.reply("there was an error!", embeds.errorEmbed(error.message ? error.message : error[0].message ? error[0].message : "Unknown error."));
console.error(error);
});
}
} else if (reaction.emoji.name == "⬇") {
if(!selfdownvote) {
await message.reactions.removeAll();
if(reaction.users.cache) console.log(`[twttr] tweet denied by ${reaction.users.cache.last().tag}: ${tweet}`);
if(reaction.users.cache) console.log(`[twttr] tweet by ${message.author.tag} (${message.author.id}) denied by ${reaction.users.cache.last().tag}: ${tweet}`);
await message.react("❌");
message.reply(vukkytils.getString("TWEET_DENIED"));
} else {
Expand Down
12 changes: 7 additions & 5 deletions commands/tweetreply.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
cooldown: 120,
aliases: ["replytweet", "twtr", "tweetr", "twr"],
usage: "<tweet ID> <content>",
requiredAPIs: ["twitter"],
guildOnly: true,
execute(message, args) {
let attachments = [];
Expand Down Expand Up @@ -48,7 +49,7 @@ module.exports = {
if(!reaction || !reaction.emoji || !reaction.emoji.name) return message.channel.send("could not get result");
if(reaction.emoji.name == "⬆") {
await message.reactions.removeAll();
if(reaction.users.cache) console.log(`[twttr] tweet reply (${args[0]}) approved by ${reaction.users.cache.last().tag}: ${tweet}`);
if(reaction.users.cache) console.log(`[twttr] tweet reply (${args[0]}) by ${message.author.tag} (${message.author.id}) approved by ${reaction.users.cache.last().tag}: ${tweet}`);
var client = new Twitter({
consumer_key: process.env.TWITTER_KEY,
consumer_secret: process.env.TWITTER_SECRET,
Expand All @@ -73,7 +74,7 @@ module.exports = {
console.error(error);
await message.reactions.removeAll();
await message.react("❌");
message.reply("there was an error!", embeds.errorEmbed(`${error.message ? error.message : "Unknown error."}`));
message.reply("there was an error!", embeds.errorEmbed(error.message ? error.message : error[0].message ? error[0].message : "Unknown error."));
}
});
});
Expand All @@ -85,19 +86,20 @@ module.exports = {
.then(async function (tweet) {
await message.reactions.removeAll();
await message.react("✅");
if(reaction.users.cache) console.log(`[twttr] tweet reply (https://twitter.com/i/status/${tweet.id_str}) by ${message.author.tag} (${message.author.id}) posted by ${reaction.users.cache.last().tag}: ${status.status}`);
message.reply(format(vukkytils.getString("TWEET_APPROVED"), `https://twitter.com/i/status/${tweet.id_str}`));
})
.catch(async function (error) {
await message.reactions.removeAll();
await message.react("❌");
message.reply("there was an error!", embeds.errorEmbed(`${error.message ? error.message : "Unknown error."}`));
throw error;
message.reply("there was an error!", embeds.errorEmbed(error.message ? error.message : error[0].message ? error[0].message : "Unknown error."));
console.error(error);
});
}
} else if (reaction.emoji.name == "⬇") {
if(!selfdownvote) {
await message.reactions.removeAll();
if(reaction.users.cache) console.log(`[twttr] tweet reply (${args[0]}) denied by ${reaction.users.cache.last().tag}: ${tweet}`);
if(reaction.users.cache) console.log(`[twttr] tweet reply (${args[0]}) by ${message.author.tag} (${message.author.id}) denied by ${reaction.users.cache.last().tag}: ${tweet}`);
message.react("❌");
message.reply(vukkytils.getString("TWEET_DENIED"));
} else {
Expand Down
97 changes: 97 additions & 0 deletions commands/vukkysmp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
const bot = "802596804977229864";

module.exports = {
name: "vukkysmp",
description: "VukkySMP management",
botPermissions: ["EMBED_LINKS"],
execute(message, args) {
async function countdown(message, command, options) {
let messages = ["5...", "4...", "3...", "2...", "1...", "0!"];
if(options.notif) {
await message.channel.send(`say ${message.author.tag} started a ${options.reverse ? "countup" : "countdown"}.`);
}
if(options.reverse) {
messages = ["Let's get counting!", "1...", "2...", "3...", "4...", "5!"];
}
await message.channel.send(`title @a actionbar "${messages[0]}"`);
setTimeout(async () => {
await message.channel.send(`title @a actionbar "${messages[1]}"`);
setTimeout(async () => {
await message.channel.send(`title @a actionbar "${messages[2]}"`);
setTimeout(async () => {
await message.channel.send(`title @a actionbar "${messages[3]}"`);
setTimeout(async () => {
await message.channel.send(`title @a actionbar "${messages[4]}"`);
setTimeout(async () => {
await message.channel.send(`title @a actionbar "${messages[5]}"`);
message.channel.send(command);
}, 1000);
}, 1000);
}, 1000);
}, 1000);
}, 1000);
}
if(message.channel.id == "805522341437243432") {
if(args[0] == "save") {
console.log(`[mcserv] ${message.author.id} (${message.author.tag}) saved the data.`);
message.channel.send(`say ${message.author.tag} saved the data.`)
.then(message.channel.send("save-all"))
.then(message.channel.send("title @a actionbar \"Saving your data...\""));
const filter = response => {
return response.content.includes("INFO] Saved the game") && response.author.id == bot;
};
message.channel.awaitMessages(filter, { max: 1 })
.then(collected => {
message.channel.send("title @a actionbar \"Data saved!\"");
});
} else if (args[0] == "stop") {
console.log(`[mcserv] ${message.author.id} (${message.author.tag}) stopped the server.`);
message.channel.send(`say ${message.author.tag} is shutting down the server.`)
.then(message.channel.send("title @a title \"Shutting down\""))
.then(message.channel.send("save-all"))
.then(message.channel.send("title @a actionbar \"Saving your data...\""));
const filter = response => {
return response.content.includes("INFO] Saved the game") && response.author.id == bot;
};
message.channel.awaitMessages(filter, { max: 1 })
.then(collected => {
message.channel.send("title @a actionbar \"Data saved!\"")
.then(countdown(message, "stop", { notif: false, reverse: false }));
});
} else if (args[0] == "reload") {
console.log(`[mcserv] ${message.author.id} (${message.author.tag}) reloaded the plugins.`);
message.channel.send(`say ${message.author.tag} is reloading the plugins.`)
.then(message.channel.send("title @a title \"Lag incoming!\""))
.then(message.channel.send("reload confirm"));
const filter = response => {
return response.author.id == bot;
};
message.channel.awaitMessages(filter, { max: 1 })
.then(collected => {
message.channel.send("title @a title \"Lag ended.\"");
});
} else if (args[0] == "restart") {
console.log(`[mcserv] ${message.author.id} (${message.author.tag}) restarted the server.`);
message.channel.send(`say ${message.author.tag} is restarting the server.`)
.then(message.channel.send("title @a title \"Restarting\""))
.then(message.channel.send("save-all"))
.then(message.channel.send("title @a actionbar \"Saving your data...\""));
const filter = response => {
return response.content.includes("INFO] Saved the game") && response.author.id == bot;
};
message.channel.awaitMessages(filter, { max: 1 })
.then(collected => {
message.channel.send("title @a actionbar \"Data saved!\"")
.then(countdown(message, "restart", { notif: false, reverse: false }));
});
} else if (args[0] == "countdown") {
countdown(message, args.slice(1).join(" "), { notif: true, reverse: false });
} else if (args[0] == "countup") {
countdown(message, args.slice(1).join(" "), { notif: true, reverse: true });
}
} else {
message.channel.send(`${message.channel.name} is not in the sudoers file. This incident will be reported.\nIn other words, you're not meant to use this command.`);
console.log(`[mcserv] ${message.author.id} (${message.author.tag}) attempted running mcserv in ${message.channel.id} (${message.channel.name})!`);
}
},
};
2 changes: 1 addition & 1 deletion commands/wanted.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const config = require("../config.json");
module.exports = {
name: "wanted",
description: "you are wanted! $5,000 reward!",
botPermissions: ["ATTACH_FILES"],
botPermissions: ["ATTACH_FILES", "MANAGE_MESSAGES"],
usage: "[user]",
async execute(message, args) {
await message.react(config.misc.emoji.loading);
Expand Down
2 changes: 1 addition & 1 deletion commands/warn.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = {
userPermissions: ["MANAGE_MESSAGES"],
usage: "<@user> <reason>",
cooldown: 0,
mysql: true,
requiredAPIs: ["mysql"],
guildOnly: true,
execute(message, args) {
if (args.slice(1).join(" ").length < 1) return message.channel.send(errorEmbed(`I was expecting more arguments!\nUsage: \`${process.env.BOT_PREFIX}warn <@user> <reason>\``));
Expand Down
2 changes: 1 addition & 1 deletion commands/warns.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
name: "warns",
description: "View warnings created using VukkyBot",
botPermissions: ["EMBED_LINKS", "MANAGE_MESSAGES"],
mysql: true,
requiredAPIs: ["mysql"],
guildOnly: true,
usage: "<@user | user id> (if not specified, shows self)",
aliases: ["warnings"],
Expand Down
5 changes: 5 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@
},
"wikipedia": {
"site": "en.wikipedia.org"
},
"tweet": {
"blacklist": {

}
}
}
}
3 changes: 3 additions & 0 deletions counting.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require("dotenv").config();
var sql;

const error = chalk.bold.red;
const warn = chalk.yellowBright;
const success = chalk.green;
var servers = {};
var cheader = `[${vukkytils.getString("COUNTING")}]`;
Expand Down Expand Up @@ -44,6 +45,8 @@ module.exports = {
con.query(sql, function (err, result) {
if (err) {
if(err.code == "ER_TABLE_EXISTS_ERROR") {
console.log(`${cheader} ${warn("Table already exists")}`);
} else {
console.log(`${cheader} ${error("Table creation failed")}`);
}
}
Expand Down
Loading