Skip to content

Commit

Permalink
Updated configs and added api
Browse files Browse the repository at this point in the history
  • Loading branch information
night0721 committed Jun 24, 2021
1 parent 3b46b57 commit 4b80768
Show file tree
Hide file tree
Showing 157 changed files with 581 additions and 1,161 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
20 changes: 20 additions & 0 deletions api/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const express = require("express");
const app = express();
const port = process.env.PORT || 3001;
const routes = require("./routes/routes");
const client = require("../bot");
client.on("ready", async () => {
var users = client.guilds.cache.reduce((a, b) => a + b.memberCount, 0);
var guilds = client.guilds.cache.size;
const caches = {
users: users,
guilds: guilds,
};
app.use("/api", routes);
app.use("/client", async (req, res) => {
res.status(200).send(caches);
});
app.listen(port, () => {
console.log(`Listen on PORT ${port}`);
});
});
8 changes: 8 additions & 0 deletions api/routes/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const { cmds } = require("../../util/dist/cmds");
const commands = cmds();
const router = require("express").Router();

router.get("/", async (req, res) => {
res.status(200).send(commands);
});
module.exports = router;
4 changes: 4 additions & 0 deletions api/routes/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const router = require("express").Router();
const cmds = require("./commands");
router.use("/commands", cmds);
module.exports = router;
6 changes: 1 addition & 5 deletions cat/Path/fantastic.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ const { Client, Message, MessageEmbed } = require("discord.js");
module.exports = {
name: "fantastic",
timeout: 60000,
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/

run: async (client, message, args) => {
message.delete();
const player = args.join(" ");
Expand Down
11 changes: 5 additions & 6 deletions cat/Path/fight.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ module.exports = {
name: "fight",
description: "Goooooooooooooooolag!",
timeout: 15000,
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/

run: async (client, message, args) => {
const gaes = [
"Gae",
Expand Down Expand Up @@ -60,12 +56,15 @@ module.exports = {
"a Bot",
"locknload with 200 round RPD gae",
"ros gae",
"Cath Gae",
"Cat drinking a cat gae",
"Night Gae",
];
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||**`
`**${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);
Expand Down
6 changes: 1 addition & 5 deletions cat/Path/gae.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ const { Client, Message, MessageEmbed } = require("discord.js");
module.exports = {
name: "gae",
timeout: 15000,
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/

run: async (client, message, args) => {
const MEE6 = [
"u = gae",
Expand Down
6 changes: 1 addition & 5 deletions cat/Path/gg.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ const { Client, Message, MessageEmbed } = require("discord.js");
module.exports = {
name: "gg",
timeout: 15000,
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/

run: async (client, message, args) => {
const GG = [
"**GIT GUD**",
Expand Down
6 changes: 1 addition & 5 deletions cat/Path/how.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ module.exports = {
description: "Check how gae is the user",
usage: "(User)",
Path: true,
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/

run: async (client, message, args) => {
const target = message.mentions.users.first() || message.author;
if (target.id === "366562874039992331") {
Expand Down
6 changes: 1 addition & 5 deletions cat/Path/nab.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ const { Client, Message, MessageEmbed } = require("discord.js");
module.exports = {
name: "nab",
timeout: 15000,
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/

run: async (client, message, args) => {
const NAB = [
"stop being a nab, nab",
Expand Down
8 changes: 2 additions & 6 deletions cat/Path/pp.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ module.exports = {
name: "pp",
description: "Check how long is the user",
usage: "(User)",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/

run: async (client, message, args) => {
let user = message.mentions.users.first() || message.author;
let embed = new MessageEmbed()
Expand All @@ -18,7 +14,7 @@ module.exports = {
.setColor(client.color)
.setTitle("Peepee size machine")
.setTimestamp()
.setFooter(`Made by Cath Team`);
.setFooter(`Made by ${client.author}`);
message.inlineReply(embed);
},
};
5 changes: 0 additions & 5 deletions commands/Config/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ module.exports = {
usage: "(goodbye/welcome/log) (Channel)",
UserPerm: "ADMINISTRATOR",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const data = await client.data.getGuild(message.guild.id);
if (!args[0]) return client.err(messgae, "Config", "check", 45);
Expand Down
5 changes: 0 additions & 5 deletions commands/Config/choices.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ module.exports = {
description: "Add choices for modmail in a server",
usage: "(add/list/rmv) (Emoji) {Text}",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
schema.findOne({ Guild: message.guild.id }, async (err, data) => {
if (data) return;
Expand Down
5 changes: 0 additions & 5 deletions commands/Config/cmd-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ module.exports = {
UserPerm: "ADMINISTRATOR",
description: "Check the custom commands in a server",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const data = await schema.find({ Guild: message.guild.id });
if (!!data === false) return client.err(messgae, "Config", "cmd-list", 10);
Expand Down
5 changes: 0 additions & 5 deletions commands/Config/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ module.exports = {
UserPerm: "ADMINISTRATOR",
description: "Crate custom commands for a server",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
message.delete();
message.channel.send(
Expand Down
5 changes: 0 additions & 5 deletions commands/Config/delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ module.exports = {
usage: "(command)",
description: "Delete a custom command for a server",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const name = args[0];
if (!name) return client.err(message, "Config", "cc-delete", 47);
Expand Down
5 changes: 0 additions & 5 deletions commands/Config/disable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ module.exports = {
usage: "(Command/Category) (Name)",
description: "Disable a command in a server",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const type = args[0].toLowerCase();
if (!type) return client.err(message, "Config", "disable", 17);
Expand Down
5 changes: 0 additions & 5 deletions commands/Config/enable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ module.exports = {
usage: "(Command) {Channel}",
description: "Enable a command in a server",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const type = args[0].toLowerCase();
const name = args[1].toLowerCase();
Expand Down
5 changes: 0 additions & 5 deletions commands/Config/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ module.exports = {
usage: "(Server ID)",
description: "Migrate all emojis from a server",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
try {
const oldGuild = args[0];
Expand Down
5 changes: 0 additions & 5 deletions commands/Config/modmail-category.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ module.exports = {
description: "Setup modmail category in a server",
usage: "(Category ID)",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
if (!args.length)
return client.err(message, "Config", "modmail-category", 0);
Expand Down
5 changes: 0 additions & 5 deletions commands/Config/modmail-role.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ module.exports = {
description: "Add role for modmail in a server",
usage: "(Role)",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
if (!args.length) return client.err(message, "Config", "modmail-role", 0);
const role =
Expand Down
5 changes: 0 additions & 5 deletions commands/Config/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ module.exports = {
description: "Reaction-Role Panel",
UserPerm: "ADMINISTRATOR",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const channel = message.mentions.channels.first() || message.channel;
Schema.findOne({ Guild: message.guild.id }, async (err, data) => {
Expand Down
5 changes: 0 additions & 5 deletions commands/Config/prefix-reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ module.exports = {
description: 'Reset the prefix to "C." at the server',
UserPerm: "ADMINISTRATOR",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message) => {
message.channel
.send("**Do you want to reset your prefix?**")
Expand Down
5 changes: 0 additions & 5 deletions commands/Config/prefix.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ module.exports = {
description: "Set the prefix at the server",
UserPerm: "ADMINISTRATOR",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const res = args.join(" ");
if (!res) return client.err(message, "Config", "prefix", 46);
Expand Down
5 changes: 0 additions & 5 deletions commands/Config/premium.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ module.exports = {
aliases: ["psadd", "psa", "premiumserver"],
description: "Add premium to a server",
Premium: true,
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
try {
const user = await client.data.getUser(message.author.id);
Expand Down
5 changes: 0 additions & 5 deletions commands/Config/rr-add.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ module.exports = {
description: "Create reaction role for server",
usage: "(Role) (emoji(Must be in server)",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const role =
message.mentions.roles.first() ||
Expand Down
5 changes: 0 additions & 5 deletions commands/Config/rr-rmv.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ module.exports = {
UserPerm: "ADMINISTRATOR",
description: "Remove reaction role for server",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
message.channel
.send("**Do you want to remove the reaction roles?**")
Expand Down
22 changes: 16 additions & 6 deletions commands/Config/set.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ module.exports = {
usage: "(goodbye/welcome/log) (#Channel)",
UserPerm: "ADMINISTRATOR",
category: "Config",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
if (!args[0]) return client.err(message, "Config", "set", 45);
if (args[0].toLowerCase() === "goodbye") {
Expand All @@ -20,7 +15,22 @@ module.exports = {
} else if (args[0].toLowerCase() === "log") {
const channel = message.mentions.channels.first();
if (!channel) return client.err(message, "Config", "set", 28);
await client.data.setLog(message.guild.id, channel.id);
let webhookid;
let webhooktoken;
await channel
.createWebhook(message.guild.name, {
avatar: message.guild.iconURL({ format: "png" }),
})
.then(webhook => {
webhookid = webhook.id;
webhooktoken = webhook.token;
});
await client.data.setLog(
message.guild.id,
channel.id,
webhookid,
webhooktoken
);
message.channel.send(`Saved ${channel} as the log channel.`);
} else if (args[0].toLowerCase() === "welcome") {
const channel = message.mentions.channels.first();
Expand Down
5 changes: 0 additions & 5 deletions commands/Economy/bal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ module.exports = {
aliases: ["bal"],
usage: "(User)",
category: "Economy",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const user =
message.mentions.members.first() ||
Expand Down
Loading

0 comments on commit 4b80768

Please sign in to comment.