Skip to content

Commit

Permalink
v2.0.1, added and edited new cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
night0721 committed Jun 14, 2021
1 parent b946d5f commit 940fe83
Show file tree
Hide file tree
Showing 10 changed files with 228 additions and 831 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
node_modules/
/.env
/commands/CODM/
commands/CODM/
/dashboard/
/util/Data/aliases.json
/util/Data/attachments.json
Expand All @@ -9,6 +9,6 @@ node_modules/
/util/Data/perk.json
/util/Data/skins.json
/util/Data/weapons.json
/util/functions/common.json
/util/functions/common.js
/util/bash.sh
/bot.js
84 changes: 61 additions & 23 deletions cat/Path/fight.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,73 @@
const { Client, Message, MessageEmbed } = require("discord.js");
module.exports = {
name: "fight",
description: "Gooooooooooooooooooolag!",
timeout: 10000,
description: "Goooooooooooooooolag!",
timeout: 15000,
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const Fight = [
"`Snow Gae`",
"`Not Gae`",
"`Ultimate Gae`",
"`Gae`",
"`Gae beyond repair`",
"`Akimbo Gae`",
"`Mega Gae`",
"`Super Gae`",
"`Ultra Gae`",
"`Terminal Gae`",
"`Dead`",
"`Path Gae`",
"`Cheez Gae`",
"`Zero Gae`",
"`KDR Gae`",
"`! not Gae`",
const gaes = [
"Gae",
"Super Gae",
"Ultra Gae",
"Snow Gae",
"Ultimate Gae",
"Terminal Gae",
"Akimbo Gae",
"Dead(extended timer)",
"Mega Gae",
"Cheez Gae",
"Gath Gae",
"Koosun Gae",
"KDR Gae",
"Gaezer Gae",
"Big Gae",
"Horni Gae",
"Zero Gae",
"Gae beyond repair",
"Dead×2(extended timer)",
"Not Gae",
"Animus Gae",
"Dust Gae",
"Orcus Gae",
"Gulag Cleaner",
"Kedar Gae",
"Smol Gae",
"Meta Gae",
"Mono Gae",
"Stippled Gae",
"BSA Gae",
"Oreo Gae",
"Random Gae",
"Tortol Gae",
"Amogus Gae",
"Gae×2",
"Dan Gae",
"Real Gae©®™",
"Mastered Ultra Instinct Gae",
"Bamboozled",
"More Gae",
"Morrre Gae",
"Most Gae",
"Undisputable Gae",
"Gae Prince of Horni",
"Gae with Y",
"Phatopenisis Gae",
"Gathophile",
"a Bot",
"locknload with 200 round RPD gae",
"ros gae",
];
const fightIndex = Fight[Math.floor(Math.random() * Fight.length)];
message.channel.send(
`**You have taken a chance at redemption in The Gulag, you fight only to find out that you're ${fightIndex}. If you somehow turned out to not be gae, DM an admin to get unmuted early you lucky bastard!!**`
);
const gae = gaes[Math.floor(Math.random() * gaes.length)];
const embed = new MessageEmbed()
.setTitle("**Gulag Fight**")
.setDescription(
`**${message.author}has taken a chance at redemption in The Gulag. \nYou fight only to find out that you're \`${gae}\`. If you somehow turned out to not be gae, DM an admin to get your timer halved ||only if your mute is less than 69m||**`
)
.setColor(5198940);
message.channel.send(embed);
},
};
26 changes: 26 additions & 0 deletions commands/Moderation/pin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const { Client, Message, MessageEmbed } = require("discord.js");

module.exports = {
name: "pin",
usage: "(Message ID)",
description: "Pin a message in the server",
BotPerm: "MANAGE_MESSAGES",
UserPerm: "MANAGE_MESSAGES",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
if (!args[0]) return client.err(message, "Moderation", "pin", 27);
try {
const ch = message.guild.channels.cache.get(message.channel.id);
const msgs = await ch.messages.fetch(args[0]);
if (!msgs) return client.err(message, "Moderation", "pin", 52);
await msgs.pin();
} catch (e) {
console.log(e);
return client.err(message, "Moderation", "pin", 999);
}
},
};
127 changes: 98 additions & 29 deletions commands/Owner/eval.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { Client, Message, MessageEmbed } = require("discord.js");
const util = require("util");
const Discord = require("discord.js");
module.exports = {
name: "eval",
category: "Owner",
Expand All @@ -13,35 +12,105 @@ module.exports = {
*/
run: async (client, message, args) => {
let code = args.join(" ");
const embed = new MessageEmbed();
if (!code) {
return client.err(message, "Owner", "eval", "Missing 'Code' argument");
if (!code) return client.err(message, "Owner", "eval", 53);
function CheckFilter(object) {
if (typeof object === "string") {
object = object.replace(
new RegExp(client.token || process.env.TOKEN, "gi"),
"Cannot eval Token"
);
} else if (typeof object === "object") {
if (Array.isArray(object)) {
for (let i = 0; i < object.length; i++) {
object[i] = CheckFilter(object[i]);
}
} else {
for (let key in object) {
object[key] = CheckFilter(object[key]);
}
}
}
return object;
}
let oldSend = Discord.TextChannel.prototype.send;
Discord.TextChannel.prototype.send = async function send(content, options) {
return oldSend.bind(this)(CheckFilter(content), CheckFilter(options));
};
let evaled;
try {
let evaled = await eval(code),
output;
if (evaled.constructor.name === `Promise`) {
output = `📤 Output (Promise)`;
} else {
output = `📤 Output`;
}
if (evaled.length > 800) {
evaled = evaled.substring(0, 800) + `...`;
}
embed
.addField(`📥 Input`, `\`\`\`\n${code}\n\`\`\``)
.addField(output, `\`\`\`js\n${evaled}\n\`\`\``)
.setColor(client.color)
.addField(`Status`, `\`\`\`diff\n+ Success\`\`\``);
return message.channel.send(embed);
} catch (e) {
console.log(e.stack);
embed
.addField(`📥 Input`, `\`\`\`\n${code}\n\`\`\``)
.addField(`📤 Output`, `\`\`\`js\n${e}\n\`\`\``)
.addField(`Status`, `\`\`\`diff\n- Failed\`\`\``)
.setColor(client.color);
return message.channel.send(embed);
evaled = eval(code);
if (evaled instanceof Promise) evaled = await evaled;
} catch (err) {
evaled = err;
}
if (typeof evaled !== "string") evaled = require("util").inspect(evaled);
evaled = new (require("string-toolkit"))().toChunks(evaled, 750);
let reactions = ["❌", "⏪", "◀️", "⏹️", "▶️", "⏩"],
page = 0,
evaledEmbed = new Discord.MessageEmbed()
.setColor(client.color)
.setDescription(`\`\`\`js\n${evaled[0]}\n\`\`\``)
.addField(`Type of`, `\`\`\`js\n${typeof evaled[0]}\n\`\`\``);
let mainMessage = await message.channel.send(evaledEmbed);
Discord.TextChannel.prototype.send = oldSend;
await Promise.all(
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).map(r =>
mainMessage.react(r)
)
);
let filter = (reaction, user) =>
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).some(
e => e === reaction.emoji.name
) && user.id === message.author.id;
let collector = mainMessage.createReactionCollector(filter, {
time: 300000,
});
collector.on("collect", async (reaction, user) => {
switch (reaction.emoji.name) {
case "❌":
await collector.stop();
return mainMessage.delete();
break;
case "⏪":
if (evaled.length === 1 || page === 0) return;
page = 0;
break;
case "◀️":
if (evaled.length === 1) return;
if (page === 0) {
page = evaled.length - 1;
} else {
page -= 1;
}
break;
case "⏹️":
await collector.stop();
for (let reaction of mainMessage.reactions.cache.array()) {
await reaction.users.remove(client.user.id);
}
return;
break;
case "▶️":
if (evaled.length === 1) return;
if (page === evaled.length - 1) {
page = 0;
} else {
page += 1;
}
break;
case "⏩":
if (evaled.length === 1 || page === evaled.length - 1) return;
page = evaled.length - 1;
break;
}
evaledEmbed = new Discord.MessageEmbed()
.setColor(message.guild.me.displayColor)
.setDescription(`\`\`\`js\n${evaled[page]}\n\`\`\``)
.addField(`Type of`, `\`\`\`js\n${typeof evaled[page]}\n\`\`\``);

await mainMessage.edit({
embed: evaledEmbed,
});
});
},
};
19 changes: 19 additions & 0 deletions commands/Utilities/docs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const fetch = require("node-fetch");
module.exports = {
name: "docs",
usage: "(Query)",
description: "Search the discord.js docs for something!",
run: async (client, message, args) => {
const query = args.join(" ");
if (!query) return client.err(message, "Utilities", "docs", 51);
fetch(
`https://djsdocs.sorta.moe/v2/embed?src=stable&q=${encodeURIComponent(
query
)}`
)
.then(res => res.json())
.then(data => {
message.inlineReply({ embed: data });
});
},
};
16 changes: 9 additions & 7 deletions events/guildDelete.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const client = require("../index");
const db = require("../models/guilds");
const { prefix, Log } = require("../config.json");
const { prefix } = require("../config.json");
const { MessageEmbed } = require("discord.js");

client.on("guildDelete", async guild => {
Expand All @@ -9,15 +9,17 @@ client.on("guildDelete", async guild => {
new MessageEmbed()
.setTitle("Deleted from server")
.addField("Server Info", [
`**>**Server Name: ${guild.name}`,
`**>**Server ID: ${guild.id}`,
`**>**Server Member Count: ${guild.memberCount}`,
`**>Server Name**: \n${guild.name}`,
`**>Server ID**: \n${guild.id}`,
`**>Server Member Count**: \n${guild.memberCount}`,
])
.addField("Owner Info", [
`Owner Tag: ${guild.owner.user.tag}`,
`Owner ID: ${guild.owner.id}`,
`**>Owner Tag**: \n${guild.owner.user.tag}`,
`**>Owner ID**: \n${guild.owner.id}`,
])
.setFooter(`Currently in ${client.guilds.cache.size} servers`)
.setFooter(
`${client.user.username} Currently in ${client.guilds.cache.size} servers`
)
.setTimestamp()
.setThumbnail(guild.iconURL({ dynamic: true }))
.setColor("RED")
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "cath.exe",
"version": "2.0.0",
"version": "2.0.1",
"description": "cath.exe bot created by Night",
"engines": {
"node": "14.17",
"node": "*",
"npm": "*"
},
"main": "index.js",
Expand Down Expand Up @@ -72,6 +72,7 @@
"quickchart-js": "^1.0.7",
"reconlx": "^1.2.41",
"soundcloud-downloader": "^0.2.4",
"string-toolkit": "^1.4.0",
"weky": "^1.4.2",
"yt-search": "^2.8.0",
"ytdl-core": "^4.8.0",
Expand Down
9 changes: 9 additions & 0 deletions util/err.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,15 @@ module.exports = async (message, dir, file, err) => {
err =
"The error maybe the link isn't a image, or the image size is too big";
break;
case 51:
err = "Missing 'Query' argument";
break;
case 52:
err = "This message doesn't exist in this channel";
break;
case 53:
err = "Missing 'Code' argument";
break;
case 404:
err = "Error 404 - Not Found";
break;
Expand Down
Loading

0 comments on commit 940fe83

Please sign in to comment.