Updated configs and added api

This commit is contained in:
night0721 2021-06-24 15:53:19 +08:00
parent 3b46b57862
commit 4b80768a8f
157 changed files with 579 additions and 1159 deletions

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

20
api/app.js Normal file
View file

@ -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
api/routes/commands.js Normal file
View file

@ -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
api/routes/routes.js Normal file
View file

@ -0,0 +1,4 @@
const router = require("express").Router();
const cmds = require("./commands");
router.use("/commands", cmds);
module.exports = router;

View file

@ -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(" ");

View file

@ -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",
@ -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);

View file

@ -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",

View file

@ -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**",

View file

@ -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") {

View file

@ -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",

View file

@ -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()
@ -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);
},
};

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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(

View file

@ -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);

View file

@ -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);

View file

@ -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();

View file

@ -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];

View file

@ -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);

View file

@ -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 =

View file

@ -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) => {

View file

@ -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?**")

View file

@ -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);

View file

@ -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);

View file

@ -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() ||

View file

@ -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?**")

View file

@ -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") {
@ -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();

View file

@ -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() ||

View file

@ -6,25 +6,20 @@ module.exports = {
timeout: 5000,
description: "Win double amount of coins or lose all coins",
category: "Economy",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const max = 1000000;
if (!args[0]) {
return client.err(message, "Economy", "gamble", 5);
return client.err(message, "Economy", "bet", 5);
}
if (isNaN(args[0])) {
return client.err(message, "Economy", "gamble", 7);
return client.err(message, "Economy", "bet", 7);
}
const amt = parseInt(args[0]);
if ((await client.data.bal(message.author.id)) < amt) {
return client.err(message, "Economy", "gamble", 20);
return client.err(message, "Economy", "bet", 20);
}
if (amt > max) {
return client.err(message, "Economy", "gamble", 101);
return client.err(message, "Economy", "bet", 101);
}
if (client.function.random() === true) {
const winamt = amt * 1;
@ -33,7 +28,11 @@ module.exports = {
.setColor("GREEN")
.setTimestamp()
.setTitle(`${message.author.username} wins a gamble game`)
.setDescription(`You win\n**${winamt}**${client.currency}`);
.setDescription(
`You win\n**${winamt}**${client.currency}\nYou now have **${
parseInt(await client.data.bal(message.author.id)) - amt
}**${client.currency}`
);
message.inlineReply(abc);
} else {
await client.data.rmv(message.author.id, amt);
@ -41,7 +40,11 @@ module.exports = {
.setColor("RED")
.setTimestamp()
.setTitle(`${message.author.username} loses a gamble game`)
.setDescription(`You lost\n**${amt}**${client.currency}`);
.setDescription(
`You lost\n**${winamt}**${client.currency}\nYou now have **${
parseInt(await client.data.bal(message.author.id)) - amt
}**${client.currency}`
);
message.inlineReply(cba);
}
},

View file

@ -1,17 +1,12 @@
const { Client, Message, MessageEmbed } = require("discord.js");
const inventory = require("../../models/econ");
const items = require("../../util/item");
const items = require("../../util/dist/item");
module.exports = {
name: "purchase",
aliases: ["buy"],
usage: "(Item)",
description: "Buy something from the shop",
category: "Economy",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
if (!args[0]) {
return client.err(message, "Economy", "buy", 21);

View file

@ -4,11 +4,6 @@ module.exports = {
description: "Earns daily money",
category: "Economy",
timeout: 1000 * 60 * 60 * 24,
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
var money;
const user = await client.data.getUser(message.author.id);
@ -25,7 +20,7 @@ module.exports = {
)
.setURL(client.web)
.setColor(client.color)
.setFooter(`Made by Cath Team`)
.setFooter(`Made by ${client.author}`)
.setTimestamp();
await client.data.add(message.author.id, money);
return message.inlineReply(pre_embed);
@ -41,7 +36,7 @@ module.exports = {
)
.setURL(client.web)
.setColor(client.color)
.setFooter(`Made by Cath Team`)
.setFooter(`Made by ${client.author}`)
.setTimestamp();
await client.data.add(message.author.id, money);
return message.inlineReply(norm_embed);

View file

@ -5,11 +5,6 @@ module.exports = {
usage: "{Channel} (Number)",
description: "Drops money to a channel",
category: "Economy",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const p = await client.prefix(message);
const channel = message.mentions.channels.first() || message.channel;

View file

@ -1,17 +1,12 @@
const { Client, Message, MessageEmbed } = require("discord.js");
const inventory = require("../../models/econ");
const items = require("../../util/item");
const items = require("../../util/dist/item");
module.exports = {
name: "gift",
timeout: 5000,
usage: "(User) (Item)",
description: "Gift item to an user",
category: "Economy",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const user =
message.mentions.users.first() ||

View file

@ -6,11 +6,6 @@ module.exports = {
usage: "(User) (Number)",
description: "Give money to an user",
category: "Economy",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const user =
message.mentions.users.first() ||

View file

@ -1,6 +1,6 @@
const { Client, Message, MessageEmbed } = require("discord.js");
const inv = require("../../models/econ");
const util = require("../../util/pagination");
const util = require("../../util/pagination/pagination");
module.exports = {
name: "inventory",
aliases: ["inv"],
@ -8,11 +8,6 @@ module.exports = {
usage: "{User}",
category: "Economy",
timeout: 5000,
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const p = await client.prefix(message);
const user =

View file

@ -6,11 +6,6 @@ module.exports = {
timeout: 5000,
usage: "Check the leaderboard of a server",
category: "Economy",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const rawLeaderboard = await Levels.fetchLeaderboard(message.guild.id, 10);
if (rawLeaderboard.length < 1)

View file

@ -1,15 +1,10 @@
const { Client, Message, MessageEmbed } = require("discord.js");
const util = require("../../util/pagination");
const items = require("../../util/item");
const util = require("../../util/pagination/pagination");
const items = require("../../util/dist/item");
module.exports = {
name: "shop",
description: "Check the items from the shop",
category: "Economy",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const list = items.map((value, index) => {
return `**${value.item}** — ${value.price.toLocaleString()}${

View file

@ -5,11 +5,6 @@ module.exports = {
timeout: 5000,
description: "Win more coins by slots",
category: "Economy",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const max = 1000000;
const slots = [
@ -81,12 +76,11 @@ module.exports = {
)
.setTitle(`${message.author.username} loses a slots game`)
.setDescription(
`You lose\n**${amt}**${client.currency}\nYou now have **${
`You lost\n**${amt}**${client.currency}\nYou now have **${
parseInt(await client.data.bal(message.author.id)) - amt
}**${client.currency}`
);
message.inlineReply(lost);
console.log(`Coins: ${await client.data.bal(message.author.id)}`);
}
},
};

View file

@ -7,11 +7,6 @@ module.exports = {
aliases: ["rob"],
category: "Economy",
timeout: 120000,
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
var tryrob =
message.mentions.users.first() ||

View file

@ -5,11 +5,6 @@ module.exports = {
description: "Work to earn money",
category: "Economy",
timeout: 1000 * 60 * 10,
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const job = [
"Software engineer",

View file

@ -31,15 +31,10 @@ module.exports = {
name: "8ball",
usage: "(Question)",
description: "8ball an answer",
category: "Utilities",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
category: "Fun",
run: async (client, message, args) => {
if (!args.join(" ").endsWith("?"))
return client.err(message, "Utilities", "8ball", 101);
return client.err(message, "Fun", "8ball", 101);
else {
const embed = new MessageEmbed()
.setAuthor(
@ -54,7 +49,7 @@ module.exports = {
.setColor(client.color)
.setTimestamp()
.setURL(client.web)
.setFooter("Made by Cath Team");
.setFooter(`Made by ${client.author}`);
message.inlineReply(embed);
}
},

View file

@ -5,11 +5,6 @@ module.exports = {
aliases: ["cats"],
category: "Fun",
description: "A cat command",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const wait = await message.inlineReply("Getting cat picture...");
let subreddits = ["cat", "cats"];

View file

@ -3,11 +3,7 @@ module.exports = {
name: "coinflip",
aliases: ["cf"],
description: "Flip a coin",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
category: "Fun",
run: async (client, message, args) => {
let HT = ["Heads!", "Tails!"];
let pick = HT[Math.floor(Math.random() * HT.length)];
@ -15,7 +11,7 @@ module.exports = {
.setColor(client.color)
.setTitle("CoinFilp Game")
.setTimestamp()
.setFooter(`Made by Cath Team`)
.setFooter(`Made by ${client.author}`)
.setDescription(pick);
message.inlineReply(embed);
},

View file

@ -5,11 +5,6 @@ module.exports = {
usage: "(User)",
description: "Play a connect 4 game with a user",
category: "Fun",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const challenger = message.member;
const oppenent = message.mentions.members.first();

View file

@ -5,11 +5,6 @@ module.exports = {
aliases: ["dogs"],
category: "Fun",
description: "A dog command",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const wait = await message.inlineReply("Getting dog picture...");
let subreddits = ["dog", "dogs"];

View file

@ -9,11 +9,7 @@ module.exports = {
name: "drake",
description: "Drake meme",
usage: "(Text) (Text)",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
category: "Fun",
run: async (client, message, args) => {
const t1 = args[0];
const t2 = args.slice(1).join(" ");

18
commands/Fun/ds.js Normal file
View file

@ -0,0 +1,18 @@
const fetch = require("node-fetch");
const { Client, Message, MessageEmbed } = require("discord.js");
module.exports = {
name: "ds",
aliases: ["doublestruck"],
description: "Doublestruck your text",
usage: "(text)",
category: "Fun",
run: async (client, message, args) => {
let text = args.join("+");
if (!text) return client.err(message, "Fun", "ds", 12);
let res = await fetch(
"https://api.popcatdev.repl.co/doublestruck?text=" + text
);
let json = await res.json();
message.inlineReply(json.text);
},
};

View file

@ -6,11 +6,6 @@ module.exports = {
name: "hangman",
description: "Play a hangman game",
category: "Fun",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
if (playing.has(message.channel.id))
return message.reply("Only one game may be occurring per channel.");

View file

@ -12,14 +12,14 @@ module.exports = {
usage: "(Hex Color Code)",
description: "Get Hex and RGB info of a color",
aliases: ["hex"],
category: "Utilities",
category: "Fun",
run: async (client, message, args) => {
let color;
if (args[0]) {
if (/(#|0x)([0-9A-F]{6})/i.test(args[0])) {
color = args[0].match(/(#|0x)([0-9A-F]{6})/i)[2];
} else {
return client.err(message, "Utilities", "hexcolor", 101);
return client.err(message, "Fun", "hexcolor", 101);
}
} else {
color = message.member.displayHexColor;

View file

@ -4,11 +4,6 @@ module.exports = {
usage: "(User)",
description: "Hug someone",
category: "Fun",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const words = args.slice(1).join(" ");
const user =

View file

@ -4,11 +4,6 @@ module.exports = {
usage: "(User)",
description: "Kiss someone",
category: "Fun",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const words = args.slice(1).join(" ");
const user =

View file

@ -5,11 +5,6 @@ module.exports = {
aliases: ["memes"],
category: "Fun",
description: "A meme command",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const wait = await message.inlineReply("Getting meme...");
let subreddits = ["comedyheaven", "dank", "meme", "memes"];

41
commands/Fun/quote.js Normal file
View file

@ -0,0 +1,41 @@
const {
Client,
Message,
MessageEmbed,
MessageAttachment,
} = require("discord.js");
const { Canvas } = require("canvacord");
module.exports = {
name: "quote",
description: "Quote a message",
usage: "{User} (Message)",
category: "Fun",
run: async (client, message, args) => {
const member = message.mentions.users.first() || message.author;
if (message.mentions.users.first()) {
const imgae = await Canvas.quote({
image: member.displayAvatarURL({
format: "png",
}),
message: args.slice(1).join(" "),
username: member.displayName ? member.displayName : member.username,
color: "ffffff",
});
const attach = new MessageAttachment(imgae, "quote.png");
message.inlineReply(attach);
} else {
const imgae = await Canvas.quote({
image: message.author.displayAvatarURL({
format: "png",
}),
message: args.join(" "),
username: message.member.nickname
? message.member.nickname
: member.username,
color: "ffffff",
});
const attach = new MessageAttachment(imgae, "quote.png");
message.inlineReply(attach);
}
},
};

30
commands/Fun/rickroll.js Normal file
View file

@ -0,0 +1,30 @@
const {
Client,
Message,
MessageEmbed,
MessageAttachment,
} = require("discord.js");
module.exports = {
name: "rickroll",
aliases: ["rick", "nevergonnagiveyouup", "never"],
description: "Rickroll?",
category: "Fun",
run: async (client, message, args) => {
const roll = [
"Never gonna give you up",
"Never gonna let you down",
"Never gonna run around and desert you",
"Never gonna make you cry",
"Never gonna say goodbye",
"Never gonna tell a lie and hurt you",
];
const rick = roll[Math.floor(Math.random() * roll.length)];
const rickroll = new MessageAttachment(
"https://i.pinimg.com/originals/88/82/bc/8882bcf327896ab79fb97e85ae63a002.gif"
);
message.inlineReply(`**${rick}**`, {
files: [rickroll],
});
},
};

View file

@ -4,11 +4,6 @@ module.exports = {
description: "Pretend a bot to say",
usage: "(Words)",
category: "Fun",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
if (!args.length) return;
message.delete();

View file

@ -5,11 +5,6 @@ module.exports = {
description: "Check how simp is the user",
usage: "(@User)",
category: "Fun",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
let simp = Math.floor(Math.random() * 100);
if (message.mentions.users.first()) {

15
commands/Fun/sr.js Normal file
View file

@ -0,0 +1,15 @@
const { Client, Message, MessageEmbed } = require("discord.js");
const supr = require("superscript-text");
module.exports = {
name: "superscript",
aliases: ["sr"],
description: "Superscript your text",
usage: "(text)",
category: "Fun",
run: async (client, message, args) => {
const text = args.join(" ");
if (!text) return client.err(message, "Fun", "sr", 12);
if (text.includes("@")) return client.err(message, "Fun", "sr", 101);
message.inlineReply(supr(text));
},
};

18
commands/Fun/triggered.js Normal file
View file

@ -0,0 +1,18 @@
const { Canvas } = require("canvacord");
const { Client, Message, MessageAttachment } = require("discord.js");
module.exports = {
name: "trigger",
aliases: ["triggered"],
usage: "{User}",
description: "Have a trigger effect on a user's avatar",
category: "Fun",
run: async (client, message, args) => {
const user =
message.mentions.users.first() ||
message.guild.members.cache.get(args[0]) ||
message.author;
const ava = user.displayAvatarURL({ format: "png" });
const imga = await Canvas.trigger(ava);
message.inlineReply(new MessageAttachment(imga, "imgae.gif"));
},
};

View file

@ -4,11 +4,6 @@ module.exports = {
UserPerm: "MANAGE_MESSAGES",
usage: "(Message ID)",
description: "End a giveaway",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
if (!args[0]) return client.err(message, "Giveaway", "end", 27);
const giveaway = client.giveaways.giveaways.find(

View file

@ -6,11 +6,6 @@ module.exports = {
description: "Start a giveaway",
usage: "(Channel) (Time) (Winners(Number)) (Prize)",
UserPerm: "MANAGE_MESSAGES",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const channel = message.mentions.channels.first();
if (!channel) return client.err(message, "Giveaway", "giveaway", 28);
@ -33,7 +28,7 @@ module.exports = {
inviteToParticipate: "React with 🎉 to enter!",
winMessage: `Congratulations {winners}! You won the **${prize}**!`,
noWinner: "Could not determine a winner!",
embedFooter: "Made by Ń1ght",
embedFooter: `Made by ${client.author}`,
hostedBy: "Hosted by: {user}",
winners: "Winner(s)",
messageURL: "",

View file

@ -5,11 +5,6 @@ module.exports = {
usage: "(Message ID)",
description: "Reroll a giveaway",
UserPerm: "MANAGE_MESSAGES",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
if (!args[0]) return client.err(message, "Giveaway", "reroll", 27);
const giveaway = client.giveaways.giveaways.find(

View file

@ -6,11 +6,6 @@ module.exports = {
usage: "{Channel} (Message)",
description: "Announce a message to a channel.",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const channel = message.mentions.channels.first() || message.channel;
if (!args[0]) return client.err(message, "Moderation", "announce", 4);

View file

@ -6,11 +6,6 @@ module.exports = {
UserPerm: "BAN_MEMBERS",
usage: "(User) {Reason}",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
let target =
message.mentions.members.first() ||

View file

@ -8,11 +8,6 @@ module.exports = {
description: "Clear/Purge 1-100 messages in the channel",
usage: "(Number)",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
if (
!args[0] ||

View file

@ -6,11 +6,6 @@ module.exports = {
description: "Clear an user's warns",
UserPerm: "MANAGE_MESSAGES",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const user =
message.mentions.members.first() ||

View file

@ -6,11 +6,6 @@ module.exports = {
BotPem: "KICK_MEMBERS",
usage: "(User) {Reason}",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
let target =
message.mentions.members.first() ||

View file

@ -7,11 +7,6 @@ module.exports = {
UserPerm: "MANAGE_CHANNELS",
BotPerm: "MANAGE_CHANNELS",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
message.channel
.createOverwrite(message.guild.id, { SEND_MESSAGES: false })

View file

@ -7,11 +7,6 @@ module.exports = {
UserPerm: "MANAGE_MESSAGES",
BotPerm: "MANAGE_ROLES",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
let Member = message.mentions.members.first();
const time = args[1];

View file

@ -6,11 +6,6 @@ module.exports = {
UserPerm: "MANAGE_CHANNELS",
BotPerm: "MANAGE_CHANNELS",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
try {
let filter = m => m.author.id === message.author.id;

View file

@ -6,11 +6,6 @@ module.exports = {
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 {

View file

@ -6,11 +6,6 @@ module.exports = {
description: "Remove a latest warn for an user",
usage: "(User)",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
try {
const user =

View file

@ -6,11 +6,6 @@ module.exports = {
usage: "(Role) (User)",
description: "Add/Remove a role for an user",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
try {
const target =

View file

@ -7,11 +7,6 @@ module.exports = {
BotPerm: "MANAGE_CHANNELS",
usage: "(Time)",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
try {
if (!args[0]) {

View file

@ -6,11 +6,6 @@ module.exports = {
BotPerm: "BAN_MEMBERS",
usage: "(User)",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
try {
if (!args[0]) return client.err(message, "Moderation", "unban", 1);

View file

@ -6,11 +6,6 @@ module.exports = {
UserPerm: "MANAGE_CHANNELS",
BotPerm: "MANAGE_CHANNELS",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
message.channel
.createOverwrite(message.guild.id, { SEND_MESSAGES: true })

View file

@ -6,11 +6,6 @@ module.exports = {
usage: "(User)",
description: "Unmute an user",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
try {
const user =

View file

@ -6,11 +6,6 @@ module.exports = {
usage: "(User) {Reason}",
description: "Warn a user",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
try {
const user =

View file

@ -6,11 +6,6 @@ module.exports = {
description: "Check the warns of an user",
usage: "{User}",
category: "Moderation",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
try {
const user =

View file

@ -4,16 +4,11 @@ module.exports = {
aliases: ["dc"],
description: "Leave The Voice Channel",
category: "Music",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
let channel = message.member.voice.channel;
if (!channel) return client.err(message, "Music", "disconnect", 35);
if (!channel) return client.err(message, "Music", "leave", 35);
if (!message.guild.me.voice.channel)
return client.err(message, "Music", "disconnect", 41);
return client.err(message, "Music", "leave", 41);
try {
await message.guild.me.voice.channel.leave();
} catch (error) {

View file

@ -3,11 +3,6 @@ module.exports = {
name: "loop",
description: "Music loop",
category: "Music",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const serverQueue = message.client.queue.get(message.guild.id);
if (serverQueue) {

View file

@ -1,16 +1,11 @@
const { Client, Message, MessageEmbed } = require("discord.js");
const lyricsFinder = require("lyrics-finder");
const splitlyrics = require("../../util/pagination");
const splitlyrics = require("../../util/pagination/pagination");
module.exports = {
name: "lyrics",
description: "Get lyrics for the currently playing song",
category: "Music",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const queue = message.client.queue.get(message.guild.id);
if (!queue) return client.err(message, "Music", "lyrics", 34);

View file

@ -3,11 +3,6 @@ module.exports = {
name: "nowplaying",
description: "To show the music which is currently playing in this server",
category: "Music",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const serverQueue = message.client.queue.get(message.guild.id);
if (!serverQueue) return client.err(message, "Music", "nowplaying", 34);

View file

@ -3,11 +3,6 @@ module.exports = {
name: "pause",
description: "To pause the current music in the server",
category: "Music",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const serverQueue = message.client.queue.get(message.guild.id);
if (serverQueue && serverQueue.playing) {

View file

@ -11,11 +11,6 @@ module.exports = {
aliases: ["p"],
category: "Music",
BotPerm: ["CONNECT", "SPEAK"],
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
let channel = message.member.voice.channel;
if (!channel) return client.err(message, "Music", "play", 35);

View file

@ -10,11 +10,6 @@ module.exports = {
usage: "(YouTube Playlist URL)/(Playlist Name)",
category: "Music",
BotPerm: ["CONNECT", "SPEAK"],
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const channel = message.member.voice.channel;
if (!channel) return client.err(message, "Music", "playlist", 35);

View file

@ -1,16 +1,11 @@
const { Client, Message, MessageEmbed } = require("discord.js");
const util = require("../../util/pagination");
const util = require("../../util/pagination/pagination");
module.exports = {
name: "queue",
description: "To show the songs queue",
aliases: ["q"],
category: "Music",
BotPerm: ["MANAGE_MESSAGES", "ADD_REACTIONS"],
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const queue = message.client.queue.get(message.guild.id);
if (!queue) return client.err(message, "Music", "queue", 34);

View file

@ -5,11 +5,6 @@ module.exports = {
usage: "(Number)",
aliases: ["rm"],
category: "Music",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const queue = message.client.queue.get(message.guild.id);
if (!queue) return client.err(message, "Music", "remove", 37);
@ -23,7 +18,7 @@ module.exports = {
const embed = new MessageEmbed()
.setColor(client.color)
.setDescription(`❌ **|** Removed: **${song[0].title}** from the queue`)
.setTimestamp("Made by Cath Team");
.setTimestamp(`Made by ${client.author}`);
const song = queue.songs.splice(args[0] - 1, 1);
message.inlineReply(embed);
message.react("✅");

View file

@ -4,11 +4,7 @@ module.exports = {
description: "To resume the paused music",
aliases: ["continue"],
category: "Music",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const serverQueue = message.client.queue.get(message.guild.id);
if (serverQueue && !serverQueue.playing) {

View file

@ -3,11 +3,6 @@ module.exports = {
name: "shuffle",
description: "Shuffle queue",
category: "Music",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const serverQueue = message.client.queue.get(message.guild.id);
if (!serverQueue) return client.err(message, "Music", "shuffle", 37);

View file

@ -3,11 +3,6 @@ module.exports = {
name: "skip",
description: "To skip the current music",
category: "Music",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const channel = message.member.voice.channel;
if (!channel) return client.err(message, "Music", "skip", 35);

View file

@ -4,11 +4,6 @@ module.exports = {
description: "Skip to the selected queue number",
usage: "(Number)",
category: "Music",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
if (!args.length || isNaN(args[0]))
return client.err(message, "Music", "skipto", 101);

View file

@ -3,11 +3,6 @@ module.exports = {
name: "stop",
description: "To stop the music and clear the queue",
category: "Music",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const channel = message.member.voice.channel;
if (!channel) return client.err(message, "Music", "stop", 35);

View file

@ -5,11 +5,6 @@ module.exports = {
usage: "(Number)",
aliases: ["vol"],
category: "Music",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const channel = message.member.voice.channel;
if (!channel) return client.err(message, "Music", "volume", 35);

View file

@ -5,11 +5,6 @@ module.exports = {
usage: "(Message)",
description: "Accept a suggestion",
Owner: true,
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const MessageID = args[0];
const acceptQuery =
@ -21,7 +16,6 @@ module.exports = {
client.SuggestionLog
);
const suggestEmbed = await suggestionChannel.messages.fetch(MessageID);
console.log(suggestEmbed);
const data = suggestEmbed.embeds[0];
const acceptEmbed = new MessageEmbed()
.setAuthor(data.author.name, data.author.iconURL)

View file

@ -5,11 +5,6 @@ module.exports = {
usage: "(Number)",
description: "Add coins from someone",
Owner: true,
/**
* @param {Client}client
* @param {Message}message
* @param {String[]} args
*/
run: async (client, message, args) => {
if (!args[0] || isNaN(args[0]))
return message.channel.send("Number of coins?");

View file

@ -5,11 +5,6 @@ module.exports = {
usage: "(User) (Toggle) (Reason)",
description: "Blacklist someone from the bot",
Owner: true,
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
let user = args[0];
toggle = args[1];

10
commands/Owner/cls.js Normal file
View file

@ -0,0 +1,10 @@
const { Client, Message, MessageEmbed } = require("discord.js");
module.exports = {
name: "cls",
run: async (client, message, args) => {
message.channel.send(
"**\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n**"
);
},
};

View file

@ -5,11 +5,6 @@ module.exports = {
usage: "(Message)",
description: "Deny a suggestion",
Owner: true,
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const MessageID = args[0];
const denyQuery =
@ -21,7 +16,6 @@ module.exports = {
client.SuggestionLog
);
const suggestEmbed = await suggestionChannel.messages.fetch(MessageID);
console.log(suggestEmbed);
const data = suggestEmbed.embeds[0];
const denyEmbed = new MessageEmbed()
.setAuthor(data.author.name, data.author.iconURL)

View file

@ -5,11 +5,6 @@ module.exports = {
usage: "(User) (Message)",
description: "DM a user",
Owner: true,
/**
* @param {Client}client
* @param {Message}message
* @param {String[]} args
*/
run: async (client, message, args) => {
const user = client.users.cache.get(args[0]);
if (!user) return message.inlineReply("User?");

Some files were not shown because too many files have changed in this diff Show more