v3.4.0 latest update with all slash cmds support

This commit is contained in:
night0721 2021-11-19 01:56:42 +08:00
parent ea494d7fae
commit 8927aae39d
290 changed files with 21293 additions and 7701 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
node_modules/

View file

@ -1,12 +1,10 @@
TOKEN =
MONGO = mongodb://127.0.0.1:27017/test
mongo =
testmongo =
cathmongo =
CLIENT_SECRET =
CLIENT_ID =
SPOTIFY_ID =
SPOTIFY_SECRET =
host = lavalink.darrennathanael.com
port = 2095
password = whatwasthelastingyousaid
api = http://api.cath.gq

View file

@ -1,15 +0,0 @@
module.exports = {
env: {
es6: true,
node: true,
},
extends: "eslint:recommended",
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
},
rules: {
indent: ["error", 2],
semi: ["error", "always"],
},
};

56
.github/README.md vendored
View file

@ -1,17 +1,17 @@
<h1 align="center"> CATH.EXE </h1>
<h1 align="center"> NYX </h1>
<!-- header -->
<p align="center">
<img src = "https://media.discordapp.net/attachments/842014909264953354/867806346593042483/Cath-temp-banner.png?width=1244&height=415">
<a href="https://rebrand.ly/cathSupport" target="_blank"><img alt="NYX_banner" src = "https://media.discordapp.net/attachments/896078559293104128/896091759157858394/nyx_banner_3d.png?width=1341&height=447"></a>
<br>
<a href="https://discord.com/oauth2/authorize?client_id=800966959268364288&permissions=4231314550&scope=bot%20applications.commands" target="_blank"><img alt='Invite' src="https://img.shields.io/badge/-Invite-5865f2?logo=discord&logoColor=white&style=for-the-badge"></a>
<a href="https://github.com/night0721/cath.exe/blob/main/LICENSE" target="_blank"><img alt='LICENSE' src="https://img.shields.io/static/v1?label=LICENSE&message=Apache%202.0&color=5865F2&style=for-the-badge&scale=1.4"></a>
<a href= "https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank"><img alt='Licence CC BY-NC-SA 4.0' src ="https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc-sa.svg" width="82">
<a href="https://trello.com/b/dIgR0QNm" target="_blank"><img alt='Trello' src="https://img.shields.io/badge/Trello-5865F2?style=for-the-badge&logo=trello&logoColor=white"></a>
<a href="https://github.com/night0721/cath"><img alt = 'NPM Package' src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white">
<a href="https://thunder75.gitbook.io/cath-bot" target="_blank"><img src="https://img.shields.io/static/v1?label=Docs&message=available&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://ko-fi.com/I2I35XISJ" target="_blank"><img alt='Kofi' src="https://img.shields.io/static/v1?label=Support%20Us&message=KO.FI&color=ff5e5b&logo=kofi&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://cath.statuspage.io/"target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=Cath.exe&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://cath.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=Cath%202&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://cath.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=API&message=Under%20Devlopment&color=FF5E5B&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://ko-fi.com/I2I35XISJ" target="_blank"><img alt='Kofi' src="https://img.shields.io/static/v1?label=Support%20Us&message=KO.FI&color=ff5e5b&logo=kofi&logoColor=white&style=for-the-badge&scale=1.4"></a> <br>
<a href="https://nyx-bot.statuspage.io/"target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=NYX&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://nyx-bot.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=NYX%202&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://nyx-bot.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=API&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
</p>
<p align = "center">
@ -21,31 +21,44 @@
<!-- description -->
**Cath.exe** is a Multipurpose Discord Bot with many features that include but are not limited to Moderation, Music and Economy. The Call of Duty Stats are courtesy of **Project Lighthouse** by [**Path.exe**](https://www.youtube.com/channel/UC0hvUWYhyx_DOEBzLWEJxsw).<br><br>
**NYX** *(previously known as Cath)* is a first and only **COD Mobile Statistics & Gunsmith** Bot which also doubles as a multipurpose discord bot with many features that include but are not limited to Moderation, Music and Economy. <br>
The Call of Duty Stats are courtesy of **Round Table** by Cygnoux Familia.<br><br>
If you like this bot, feel free to :star: **Star** this repository.<br>
> ⚠ The Verifed bot instance is current called Cath.exe, we are working on getting it changed
<br>
# Features
> *This is a Non-Exhaustive list for commands. To access the full list of commands, check out our [Documentation](https://thunder75.gitbook.io/cath-bot/core/commands).*
<a href="https://thunder75.gitbook.io/cath-bot/core/commands" ><img src="https://img.shields.io/static/v1?label=List %20OF&message=Commands&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
🚨 **Moderation** - Classic commands like kick, ban, warn, role and many more.. <br>
📈 **Economy** - A Robust economy system, inspired by **pepe bot.** <br>
🚨 **Moderation** - Classic commands like kick, ban, warn, role and many more. <br>
📈 **Economy** - A Robust economy system, inspired by **pepe bot** <br>
**Fun Commands** - A massive collection of fun commands `(35+ commands)` <br>
🎵 **Music** - Classic Music Commands that can play from various sources. <br>
🛠 **Utility** - A wide range of useful commands `(Around 20)` <br>
🕹 **Games** - Many fun games to spend your time ...
> To access the full list of commands, check out our [Documentation](https://thunder75.gitbook.io/cath-bot/core/commands).
🕹 **Games** - Many fun games to spend your time <br>
🎮 **Call of Duty** - Check the list of Call of Duty Mobile Commands
🎮 **Call of Duty** - Check Call od Duty Mobile Stats exclusivly using our bot
> ⚠ Only avaliable on the Live instance for now.
## <img height="18px" src="../util/assets/images/cod_logo.svg"> **Call of Duty Mobile**
- **Weapon Statistics** courtesy of **Round Table** by Cygnoux Familia.
- **Currated Gunsmith Builds** by various content creators like Jokesta, dHitman, Path.exe and more comming soon.
- **Perks** detailed info about the perks.
- **Randomly Generated Class** Wanna try something challenging? try our Randomly Generated Gunsmith builds.
> We also provide access to our database that includes In-depth Weapon statistics & Gunsmith Builds from various Content Creators, & other Call of duty related info, please [contact us](https://rebrand.ly/cathSupport) for more info.
## More Info
[![Top language](https://img.shields.io/github/languages/top/night0721/cath.exe?labelColor=F7DF1E&color=555555&style=for-the-badge&scale=1.4)](https://github.com/night0721/cath.exe)
[![CodeFactor](https://www.codefactor.io/repository/github/night0721/cath/badge?s=ffdc3c246a8b91a3d7064d128a1b81b9dbeca61f&style=for-the-badge)]((https://www.codefactor.io/repository/github/night0721/cath))
[![CodeFactor](https://www.codefactor.io/repository/github/night0721/cath.js/badge?s=57e6f566f73892f4303edbfeb2fe3ea0b849c876&style=for-the-badge)](https://www.codefactor.io/repository/github/night0721/cath.js)
<a href="https://thunder75.gitbook.io/cath-bot/deployment" target="_blank"><img src="https://img.shields.io/static/v1?label=Deployment&message=Guide&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
A detailed Deployment guide can be found [here](https://thunder75.gitbook.io/cath-bot/deployment).
<details>
<summary>Made With</summary>
@ -80,15 +93,13 @@ A detailed Deployment guide can be found [here](https://thunder75.gitbook.io/cat
## <img src = "https://cdn.discordapp.com/emojis/867093614403256350.png?v=1" width = 18> Support & Feature Request
Join the official [Support Server](https://discord.gg/SbQHChmGcp) on Discord & we will be happy to assist you. <br>
Join the official [Support Server](https://rebrand.ly/cathSupport) on Discord & we will be happy to assist you. <br>
To Request new features contact us on Discord using the support server.
## <img src = "https://cdn.discordapp.com/emojis/867093601962950666.png?v=1" width = "18"> Report Bugs
You can report bugs or issues by opening a issue in this repository. Alternatevely you can also contact us on Discord using the support server.
<!-- [![Support Server](https://img.shields.io/discord/718762019586572341?label=Support%20Server&logo=Discord&colorB=5865F2&style=for-the-badge&logoColor=white) ](https://discord.gg/SR7TeNJG67) -->
<p align = "center">
<a href="https://rebrand.ly/cathSupport" target="_blank"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner1"></a>
</p>
@ -99,5 +110,10 @@ Contributions are always welcomed, but make sure to read [Contributing.md](/CONT
![Contributors](https://badges.pufler.dev/contributors/night0721/cath.exe?bots=false)
<!-- ## Special Thanks to The Roound Table from Cygnoux Familia.
<p align = "center">
<a href="https://discord.gg/mjVwkCsWY7" target="_blank"><img src="https://discordapp.com/api/guilds/756525751594909797/widget.png?style=banner1"></a>
</p> -->
<!-- <img src="https://socialify.git.ci/night0721/cath.exe/image?description=1&descriptionEditable=A%20Discord.js%20v13%20Template%20based%20on%20cath.exe&font=Raleway&forks=1&issues=1&language=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Dark"> -->

30
.github/changelog.md vendored
View file

@ -1,5 +1,35 @@
<h1 align="center">Changelog</h1>
# Release v3.3.0 Name Change
We have changed the name of our bot from **Cath.exe** to **NYX**. We have not yet decided on changing the backend names that includes the api & package.
## Added
- Added guns to be bought using internal currency.
- Added more items in the shops.
- Updated names of contributers in the bot info.
## Changes / Modification
- Change the footers of embed as we transition from using the Statistics provided by **Project Lighthouse v2** into using Statistics provided by **Round table**.
# Release v3.2.6
## Added
- Tips
- Topics
## Fixes
- Added Bot avatar in the footer
- Added timestamps in embeds
# Release v3.2.0
In this version we made the starboard to be globalized, means that you can configure the settings for the starboard per server.
## Added
- drop
- announce
- emojiadd
snipe&editsnipe fix
To stay up-to-date with our progress, check out our discord server & the Trello page.
# Release v3.0.0
In this version we implement Discord.js v13, which introduces slash commands.
we have not implemented all of the commands yet, the moderation commands especially.

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
node_modules
package-lock.json
.env
.prettierignore
.vscode

View file

@ -1,3 +0,0 @@
{
"esversion": 10
}

110
CODM/builds.js Normal file
View file

@ -0,0 +1,110 @@
const builds = require("../util/Data/builds.json");
const guns = builds.Main;
const Discord = require("discord.js");
const nmDt = require("../util/Data/aliases.json");
const weaponActualName = nmDt.weaponActualName;
const weaponAlliasName = nmDt.weaponAlliasName;
module.exports = {
name: "build",
description: "Check gun builds",
usage: "(Gun)",
category: "CODM",
status: false,
Owner: true,
run: async (client, message, args) => {
const currGun = weaponIdentifier(args.join(" ").replace("\n", " "));
if (!currGun) message.reply({ content: "Please specify a gun" });
if (typeof currGun == "string") {
message.reply({ embeds: [currGun] });
} else {
const attachNames = currGun.Attachments.map(
x => `**${x.Name}** [${builds.AttachmentTypes[x.Type]}]`
);
const embed = new Discord.MessageEmbed()
.setTitle(
`Build for ${currGun.Name} (${builds.WeaponTypes[currGun.Type]})`
)
.setColor(16580400)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setURL(client.web)
.setDescription(
attachNames.reduce(
(t, x, i, a) => t + (i < a.length - 1 ? "\n" : " \n") + x
)
)
.setImage(currGun.URL);
return message.reply({ embeds: [embed] });
}
},
};
function weaponIdentifier(inpWeaponName) {
if (inpWeaponName.length < 2) {
return "The name `" + inpWeaponName + "` is too short.";
}
let probableWeapons = [];
for (let i = 0; i < guns.length; i++) {
if (inpWeaponName.Simplify() == guns[i].Name.Simplify()) {
return guns[i];
} else if (guns[i].Name.Simplify().includes(inpWeaponName.Simplify())) {
probableWeapons.push(i);
}
}
if (probableWeapons.length == 1) {
return guns[probableWeapons[0]];
}
for (let i = 0; i < weaponAlliasName.length; i++) {
for (let j = 0; j < weaponAlliasName[i].length; j++) {
if (weaponAlliasName[i][j].Simplify() == inpWeaponName.Simplify()) {
for (let i2 = 0; i2 < guns.length; i2++) {
if (weaponActualName[i].Simplify() == guns[i2].Name.Simplify()) {
return guns[i2];
}
}
}
}
}
probableWeapons = [...new Set(probableWeapons)];
if (probableWeapons.length == 1) {
return guns[probableWeapons[0]];
}
if (probableWeapons.length > 1) {
return (
"Did you mean `" +
probableWeapons
.map(x => guns[x].Name)
.reduce((out, x, i) =>
[out, x].join(i === probableWeapons.length - 1 ? "` or `" : "`, `")
) +
"`?"
);
}
return "Couldn't identify the weapon: `" + '"' + inpWeaponName + '"`';
}
// ENABLE AFTER Holloween
// run: async (client, interaction, args) => {
// const embed = new MessageEmbed()
// .setTitle(`Prefix commands are now disabled`)
// .setDescription(`Please enable **Application commands** in the channel settings to get access to slash commands, we have discontinued prefix commands.`)
// .setColor(client.color)
// .setThumbnail(interaction.guild.iconURL({ dynamic: true }))
// .addFields(
// {
// name: "Need help ?",
// value: `Join our **[Support Server](https://discord.gg/SR7TeNJG67)**`,
// inline: true,
// },
// {
// name: "Support us <a:donate:896985486260846614>",
// value: `[KoFi](https://ko-fi.com/cathteam)`,
// inline: true,
// }
// )
// .setThumbnail("https://github.com/night0721/cath.js/blob/master/util/assets/images/nyx_logo_transparent.webp")
// .setTimestamp();
// interaction.followUp({ embeds: [embed] });
// },
// };

55
CODM/class.js Normal file
View file

@ -0,0 +1,55 @@
const { MessageEmbed } = require("discord.js");
const model = require("../../models/weapons");
const Attachments = require("../../util/Data/attachments.json");
module.exports = {
name: "class",
description: "Generate random class in CODM",
category: "CODM",
run: async (client, message, args) => {
const data = async () => {
const d = await model.findOne({});
const types = d.Categories;
const names = d.Primary;
const category = types[Math.floor(Math.random() * types.length)];
const weapons = names[0][category];
return `${weapons[Math.floor(Math.random() * weapons.length)]}`;
};
const primary_weapon = await data();
const primary = primary_weapon.replace(/[ -]/g, "_").replace(/\./g, "");
const slots = shuffle(Object.keys(Attachments[primary][0]));
const slot_1 = slots.next().value,
slot_2 = slots.next().value,
slot_3 = slots.next().value,
slot_4 = slots.next().value,
slot_5 = slots.next().value;
const result = new MessageEmbed()
.setColor(client.color)
.setTitle(`🎲Random Class of ${primary_weapon}🎲`)
.setDescription(
`**Attachments**\n**${getAttachment(
primary,
slot_1,
)}**\n**${getAttachment(primary, slot_2)}**\n**${getAttachment(
primary,
slot_3,
)}**\n**${getAttachment(primary, slot_4)}**\n**${getAttachment(
primary,
slot_5,
)}**`,
)
.setURL(client.web)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
message.reply({ embeds: [result] });
function* shuffle(array) {
let i = array.length;
while (i--) {
yield array.splice(Math.floor(Math.random() * (i + 1)), 1)[0];
}
}
function getAttachment(gun, slot) {
const ca = Attachments[gun][0][slot];
return ca[Math.floor(Math.random() * ca.length)];
}
},
};

118
CODM/damage.js Normal file
View file

@ -0,0 +1,118 @@
const common = require("../../util/functions/common");
let currGun = {},
currStats = [],
currAttachments = {},
currDRM = {},
totalEffects = [],
interpretion = "",
hasError = false;
const errMsg = "*Generic placeholder error message*";
module.exports = {
name: "damage",
description: "Check gun damage",
usage: "(Gun)",
category: "CODM",
run: async (client, message, args) => {
const repEmb = dmg(args.join(" ").replace("\n", " "));
if (hasError) {
message.reply({ embeds: [repEmb] });
}
else {
message.channel.send({ embeds: [repEmb] });
}
},
};
function dmg(inpmsg) {
currGun = common.weaponIdentifier(inpmsg);
if (typeof currGun == "string") {
hasError = true;
return currGun;
}
currDRM = currGun.drm[0];
currStats = currGun.stats;
currAttachments = common.attachmentsIdentifier(
inpmsg,
currGun.aments,
currStats,
);
if (typeof currAttachments == "string") {
hasError = true;
return currAttachments;
}
if (currAttachments.length) {
totalEffects = common.totaler(currAttachments);
currDRM = currGun.drm[totalEffects[37]];
currDRM.range = currDRM.range.map(
x => (x * (totalEffects[13] + 100)) / 100,
);
currStats = common.updateStatswithEffects(totalEffects, currStats);
}
const mn = [
"Head",
"Neck",
"Upper Chest",
"Lower Chest",
"Shoulders",
"Upper Arms",
"Lower Arms",
"Stomach",
"Belly Button",
"Crotch",
"Thighs",
"Calf Muscles",
"Feet",
],
m1 = currDRM.bodymultiplier,
m2 = [...new Set(m1)], // [1.2, 1, 0.9]
m3 = m1.map(x => m2.indexOf(x)), // [0, 1, 1, 1, 1, 1, 2, 2, 2]
m4 = m2
.map(x =>
m3
.map((y, i) => {
if (x === m2[y]) {
return mn[i];
}
})
.filter(y => y),
)
.map(x =>
x.length === m1.length
? ["All"]
: x.length === m1.length - 1
? ["Others"]
: x,
);
interpretion = currGun.gunname + common.interpretioner(currAttachments);
return {
title: "**" + interpretion + "**",
color: 4849497,
fields: m4.map((x, i) => {
return {
name: x.join(", ") + ":",
value: common.damageHandler(
currDRM.damage,
currDRM.range,
m2[i],
100,
60000 / currStats[5],
currStats[7],
currStats[6],
currStats[0],
),
};
}),
footer: {
text: "All the stats courtesy of Project Lighthouse",
icon_url:
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
},
};
}
// console.log(dmg("47 + mono"));
/* console.log(dmg("47"));
console.log(dmg("striker + choke"));
console.log(dmg("striker + choke"));
console.log(dmg("striker"));
common.makeError();*/

168
CODM/effects.js vendored Normal file
View file

@ -0,0 +1,168 @@
const common = require("../util/functions/common");
const data = require("../util/Data/data.json");
let currGun, currAttachments, interpretion, hasError;
const errMsg = "*Generic placeholder error message*";
module.exports = {
name: "effects",
description: "Check gun effects",
usage: "(Gun)",
category: "CODM",
aliases: ["attachements"],
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
const repEmb = attachments(args.join(" ").replace("\n", " "));
if (hasError) {
message.reply({ embeds: [repEmb] });
} else {
message.channel.send({ embeds: [repEmb] });
}
},
};
function attachments(inpmsg) {
const out = "",
at = data.attachmentTypes.map(x => (x.slice(-1) === "s" ? x : x + "s"));
if (inpmsg.includes("+") && inpmsg.includes(":")) {
hasError = true;
return "Bro, can u liek, not do that?";
}
if (inpmsg.includes(":")) {
const inpAll = inpmsg
.split(":")
.map(x => x.trim())
.filter(x => x),
inpType = inpAll.length === 2 ? inpAll[1] : null;
if (!inpType) {
hasError = true;
return inpAll.length < 2
? "Empty " + (inpAll[0] ? "" : "weapon name and ") + "attachment type"
: "Multiple `:`s detected";
}
currGun = common.weaponIdentifier(inpAll[0]);
if (typeof currGun == "string") {
hasError = true;
return currGun;
}
let currAttachmentsType = at.filter(x => simplify(x) == simplify(inpType));
currAttachmentsType = currAttachmentsType.length
? currAttachmentsType
: at.filter(
x => simplify(x.substring(0, x.length - 1)) == simplify(inpType)
);
currAttachmentsType = currAttachmentsType.length
? currAttachmentsType
: at.filter(x => simplify(x).includes(simplify(inpType)));
if (currAttachmentsType.length === 0) {
hasError = true;
return "Couldn't identify `" + inpType + "`";
} else if (currAttachmentsType.length === 1) {
currAttachmentsType = at.indexOf(currAttachmentsType[0]);
} else {
hasError = true;
return (
"Did you mean `" +
currAttachmentsType.reduce((out, x, i) =>
[out, x].join(
i === currAttachmentsType.length - 1 ? "` or `" : "`, `"
)
) +
"`"
);
}
return {
title: currGun.gunname,
color: 11348938,
fields: [
{
name:
"**" +
currGun.gunname +
"** has the following " +
at[currAttachmentsType],
value:
"```\n" +
currGun.aments
.filter(x => x.type - 1 === currAttachmentsType)
.map(x => x.name)
.join("\n") +
"```",
},
],
footer: {
text: "All the stats courtesy of Project Lighthouse",
icon_url:
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
},
};
function simplify(v) {
return v.toLowerCase().replace(/[^0-9a-z]/g, "");
}
}
currGun = common.weaponIdentifier(inpmsg);
if (typeof currGun == "string") {
hasError = true;
return currGun;
}
hasAttachments = common.hasAttachments(inpmsg);
currAttachments = [];
if (hasAttachments) {
currAttachments = common.attachmentsIdentifier(
inpmsg,
currGun.aments,
currGun.stats
);
if (typeof currAttachments == "string") {
hasError = true;
return currAttachments;
}
return {
title: currGun.gunname + common.interpretioner(currAttachments),
color: 11348938,
fields: common.attachmentHandler(
common.totaler(currAttachments),
currGun.stats
),
footer: {
text: "All the stats courtesy of Project Lighthouse",
icon_url:
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
},
};
} else {
const availableAttachmentTypes = [
...new Set(currGun.aments.map(x => x.type)),
];
return {
title: currGun.gunname,
color: 11348938,
fields: [
{
name:
"**" + currGun.gunname + "** has the following attachment types:",
value:
"```\n" +
availableAttachmentTypes.map(x => at[x - 1]).join(",\n") +
"```",
},
],
footer: {
text: "All the stats courtesy of Project Lighthouse",
icon_url:
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
},
};
}
}
// console.log(attachments("Peacekeeper:muzzle")); //common.makeError();
/* console.log(attachments(":")); //common.makeError();
console.log(attachments("47:optics")); //common.makeError();
console.log(attachments("47")); //common.makeError();
console.log(attachments("47 + ")); //common.makeError();
console.log(attachments("47 + :")); //common.makeError();
console.log(attachments("47 + red dot")); common.makeError();*/

111
CODM/sgrelo.js Normal file
View file

@ -0,0 +1,111 @@
module.exports = {
name: "sgrelo",
descriptiom: "Calculate reload time for shotgun",
run: async (client, message, args) => {
let err = "",
wrn = "",
interpretedAs = [];
function mather(inp) {
const inpArr = interpreter(inp),
outArr = [];
inpArr.map((x, i, a) => {
for (let j = i + 1; j < a.length; j++) {
outArr.push(worker(x, a[j]));
}
});
const aArr = outArr.map(x => x.a),
iArr = outArr.map(x => x.i);
return (
"Input: `" +
interpretedAs.join("`, `") +
"`" +
(aArr.length == 1
? "\nOpening and Closing Animation Time: " +
beautifier(aArr[0]) +
"\nReload Time: " +
beautifier(iArr[0])
: "\nAll Opening and Closing Animation Time: " +
aArr.map(x => beautifier(x)).join(", ") +
"\nAll Reload Time: " +
iArr.map(x => beautifier(x)).join(", ") +
"\nAverage Opening and Closing Animation Time: " +
beautifier(aArr.reduce((t, x) => t + x, 0) / aArr.length) +
"\nAverage Reload Time: " +
beautifier(iArr.reduce((t, x) => t + x, 0) / iArr.length))
);
}
function interpreter(inp) {
let out = [
...new Set(
inp
.split(/\n|, |,/g)
.filter(x => x)
.map(x => x.toLowerCase().replace(/[^0-9a-z]/g, ""))
),
];
out = out
.map(x => {
interpretedAs.push(x);
const obj = {
b: 0,
f: 0,
};
if (
x.split(/b/g).length > 2 ||
x.split(/f/g).length > 2 ||
x.split(/[a-z]/g).length > 3
) {
err += "Unknown identifier `" + x + "`\n";
} else if (x.indexOf("b") === -1 || x.indexOf("f") === -1) {
err += "Missing identifier `" + x + "`\n";
} else if (x.indexOf("b") === x.length - 1) {
obj.b = parseFloat(x.split("f")[1].trim());
obj.f = parseFloat(x.split("f")[0].trim());
} else if (x.indexOf("f") === x.length - 1) {
obj.b = parseFloat(x.split("b")[0].trim());
obj.f = parseFloat(x.split("b")[1].trim());
} else {
err += "Unknown identifier `" + x + "`\n";
}
if (!obj.b && obj.f) {
err += "Couldn't interpret `" + x + "`\n";
} else if (!Number.isInteger(obj.b)) {
err += "Decimal bullet count found `" + x + "`\n";
} else if (!Number.isInteger(obj.f)) {
wrn += "Decimal value found `" + x + "`\n";
}
return obj;
})
.filter(x => JSON.stringify(x).length && x);
if (out.length === 1) {
err += "Single equation found\n";
}
return err || !out.length ? [] : out;
}
function worker(o1, o2) {
const out = {
i: 0,
a: 0,
};
out.i = (o1.f - o2.f) / (o1.b - o2.b);
out.a = o1.f - out.i * o1.b;
return out;
}
function beautifier(num) {
return parseFloat(num.toFixed(2)).toString() + "s";
}
const msg = mather(args.join(" "));
if (err !== "") {
message.reply(err);
} else if (wrn !== "") {
message.reply({ content: wrn + "\n" + msg });
} else {
message.channel.send({ content: msg });
}
},
};

274
CODM/stats.js Normal file
View file

@ -0,0 +1,274 @@
const common = require("../util/functions/common");
const data = require("../util/Data/data.json");
const Discord = require("discord.js");
let currGun,
currStats,
currAttachments,
currRecoilArr,
currDRM,
interpretion,
recoilAvailable,
chart,
hasError;
const errMsg = "*Generic placeholder error message*";
module.exports = {
name: "stats",
description: "Check gun stats",
usage: "(Gun)",
category: "CODM",
/**
* @param {Client} client
* @param {Message} message
* @param {String[]} args
*/
run: async (client, message, args) => {
recoilAvailable = false;
hasError = false;
const repEmb = statsHandler(args.join(" ").replace("\n", " "));
if (hasError) {
message.reply({ embeds: [repEmb] });
}
if (recoilAvailable) {
repEmb.fields.push({
name: "**Recoil Graph**",
value:
"```\nThe Recoil graph below is dynamic (change based on attachment equipped)```",
});
const recoilImageLink = await chart.getShortUrl();
repEmb.image = { url: recoilImageLink };
}
message.reply({ embeds: [repEmb] });
},
};
function inpHandler(inpmsg) {
statsHandler(inpmsg.split("+")[0]);
}
function statsHandler(inpmsg) {
let statsNames = [
"Pellets",
"Detonation Range",
"Explosion Radius",
"Explosion Damage",
"Firing Mode",
"Rate of Fire",
"Bullet in Burst",
"Time Between Burst",
"Bullet Speed",
"Penetration Level",
"Bullet Spread",
"Idle Sway",
"Hipfire Pellet Spread",
"ADS Pellet Spread",
"ADS Time",
"Sprint-to-Fire Time",
"ADS Zoom",
"Magazine",
"Reserve",
"Reload Type",
"Cancel Reload Time",
"Reload Time",
"Full Reload Time",
"Drop Time",
"Raise Time",
"Sprinting Speed",
"Walking Speed",
"Straifing Speed",
"Damage per Tick",
"Number of Ticks",
"Time Between Ticks",
"Breath Hold Time",
"shouldNeverHappen0",
"shouldNeverHappen1",
"shouldNeverHappen2",
"shouldNeverHappen3",
"shouldNeverHappen4",
],
out = [];
currGun = common.weaponIdentifier(inpmsg);
if (typeof currGun == "string") {
hasError = true;
return currGun;
}
currStats = currGun.stats;
currDRM = currGun.drm[0];
currAttachments = [];
currAttachments = common.attachmentsIdentifier(
inpmsg,
currGun.aments,
currStats
);
if (typeof currAttachments == "string") {
hasError = true;
return currAttachments;
}
currRecoilArr = [1, 1, currGun.stats[17]];
if (currAttachments.length != 0) {
const totalEffects = common.totaler(currAttachments);
currStats = common.updateStatswithEffects(totalEffects, currStats);
currRecoilArr = [totalEffects[2], totalEffects[3], currGun.stats[17]]; // must happen after currStats update
currDRM = currGun.drm[totalEffects[37]];
currDRM.range = currDRM.range.map(x =>
Math.round(x * (1 + totalEffects[13] / 100))
);
out = common.attachmentHandler(totalEffects, currStats);
}
function statsWorker() {
if (currStats[19] === 2) {
currStats[21] =
currStats[20] + currStats[21] * currStats[17] + currStats[22];
currStats[20] = 0;
currStats[22] = 0;
}
currStats[25] = (currStats[25] * currStats[26]) / 100;
const outReady = currStats.map((x, i) =>
x ? statsNames[i].padEnd(24) + ":".padEnd(3) + beautifier(i) : ""
);
out = [
...[
"Basic Stats",
"ADS Stats",
"Bullet Stats",
"Magazine",
"Handling Stats",
"Mobility Stats",
"Miscellaneous Stats",
].map((x, i) =>
fieldMaker(
x,
[
[04, 05, 09],
[14, 16, 11, 31],
[00, 06, 07, 08, 10, 12, 13],
[17, 18, 19, 20, 21, 22],
[23, 24],
[25, 26, 27, 15],
[28, 29, 30, 01, 02, 03],
][i]
)
),
...out,
];
function fieldMaker(inpName, inpIndx) {
inpIndx = inpIndx.filter(x => outReady[x]);
return inpIndx.length
? {
name: "**" + inpName + "**",
value: "```\n" + inpIndx.map(x => outReady[x]).join("\n") + "```",
}
: "";
}
}
statsWorker();
function beautifier(j) {
switch (j) {
case 04:
return data.firingModes[currStats[j] - 1];
case 09:
return data.penetrationLevels[currStats[j] - 1];
case 19:
return data.reloadTypes[currStats[j] - 1];
case 08:
if (currStats[j] == -1) {
return "Infinity";
} else {
return parseFloat(currStats[j].toFixed(2)).toString() + " m/s";
}
case 03:
return parseFloat(currStats[j].toFixed(2))
.toString()
.replace(".", " ~ ");
default:
return parseFloat(currStats[j].toFixed(2)).toString() + addUnit(j);
}
function addUnit(j) {
switch (j) {
case 07:
case 14:
case 15:
case 23:
case 24:
case 31:
return " ms";
case 27:
case 28:
case 25:
case 26:
return " m/s";
case 20:
case 21:
case 22:
return " s";
case 16:
return "%";
case 06:
return " Rounds";
case 05:
return " RPM";
default:
return "";
}
}
}
interpretion = currGun.gunname + common.interpretioner(currAttachments);
if (currGun.recoil.hr.length > 2) {
chart = common.recoilHandler(
currGun.recoil.hr,
currGun.recoil.vr,
currRecoilArr[0],
currRecoilArr[1],
currRecoilArr[2]
);
recoilAvailable = true;
} else {
recoilAvailable = false;
}
if (chart == "none") {
recoilAvailable = false;
}
if (chart == "err" || currAttachments == "err") {
hasError = true;
return "Cocaineeee";
}
const dmg =
common.damageHandler(
currDRM.damage,
currDRM.range,
1,
100,
60000 / currStats[5],
currStats[7],
currStats[6],
currStats[0]
) || "```This should never happen```";
out = [
currGun.description
? {
name: "**Description:**",
value: "```\n" + currGun.description + "```",
}
: {},
{ name: "**Damage Profile:**", value: dmg },
...out,
];
out = out.filter(x => x.value);
return {
title: interpretion,
color: 5814783,
fields: out,
footer: {
text: "All data courtesy of Project Lighthouse and CoDM Research Crew",
icon_url:
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
},
};
}
// console.log(statsHandler("Holger").fields);

23
Dockerfile Normal file
View file

@ -0,0 +1,23 @@
FROM node:alpine
# Create app directory
WORKDIR /usr/bot/nyx
# Copy package.json and package-lock.json
COPY package*.json ./
# Install packages
RUN npm install
# Copy the app code
COPY . .
# Build the project
RUN npm run all
# Expose ports
# EXPOSE 8080
# Run the application
CMD [ "node", "index.js" ]
# not sure what to run index.js or bot.js

574
LICENSE
View file

@ -1,201 +1,437 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Attribution-NonCommercial-ShareAlike 4.0 International
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
=======================================================================
1. Definitions.
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
Using Creative Commons Public Licenses
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More_considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
=======================================================================
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
Public License
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-NonCommercial-ShareAlike 4.0 International Public License
("Public License"). To the extent this Public License may be
interpreted as a contract, You are granted the Licensed Rights in
consideration of Your acceptance of these terms and conditions, and the
Licensor grants You such rights in consideration of benefits the
Licensor receives from making the Licensed Material available under
these terms and conditions.
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
Section 1 -- Definitions.
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
c. BY-NC-SA Compatible License means a license listed at
creativecommons.org/compatiblelicenses, approved by Creative
Commons as essentially the equivalent of this Public License.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
d. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
e. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
f. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
g. License Elements means the license attributes listed in the name
of a Creative Commons Public License. The License Elements of this
Public License are Attribution, NonCommercial, and ShareAlike.
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
h. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
i. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
j. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
k. NonCommercial means not primarily intended for or directed towards
commercial advantage or monetary compensation. For purposes of
this Public License, the exchange of the Licensed Material for
other material subject to Copyright and Similar Rights by digital
file-sharing or similar means is NonCommercial provided there is
no payment of monetary compensation in connection with the
exchange.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
l. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
m. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
n. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
Section 2 -- Scope.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
a. License grant.
Copyright 2021 Night Kaly
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
a. reproduce and Share the Licensed Material, in whole or
in part, for NonCommercial purposes only; and
http://www.apache.org/licenses/LICENSE-2.0
b. produce, reproduce, and Share Adapted Material for
NonCommercial purposes only.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. Additional offer from the Licensor -- Adapted Material.
Every recipient of Adapted Material from You
automatically receives an offer from the Licensor to
exercise the Licensed Rights in the Adapted Material
under the conditions of the Adapter's License You apply.
c. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties, including when
the Licensed Material is used other than for NonCommercial
purposes.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
b. ShareAlike.
In addition to the conditions in Section 3(a), if You Share
Adapted Material You produce, the following conditions also apply.
1. The Adapter's License You apply must be a Creative Commons
license with the same License Elements, this version or
later, or a BY-NC-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the
Adapter's License You apply. You may satisfy this condition
in any reasonable manner based on the medium, means, and
context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms
or conditions on, or apply any Effective Technological
Measures to, Adapted Material that restrict exercise of the
rights granted under the Adapter's License You apply.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database for NonCommercial purposes
only;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material,
including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.

View file

@ -1,94 +0,0 @@
<h1 align="center"> CATH.EXE </h1>
<p align="center">
<img src = "https://media.discordapp.net/attachments/842014909264953354/867806346593042483/Cath-temp-banner.png?width=1244&height=415">
<br>
<a href="https://trello.com/b/dIgR0QNm"><img alt='Trello' src="https://img.shields.io/badge/-Invite-5865f2?logo=discord&logoColor=white&style=for-the-badge"></a>
<a href="https://rebrand.ly/cathGithubInvite"><img alt='Support Server' src="https://img.shields.io/discord/718762019586572341?label=Support%20Server&logo=Discord&colorB=5865F2&style=for-the-badge&logoColor=white"></a>
<a href="https://trello.com/b/dIgR0QNm"><img alt='Trello' src="https://img.shields.io/badge/Trello-5865F2?style=for-the-badge&logo=trello&logoColor=white"></a>
<a href="https://thunder75.gitbook.io/cath-bot" target="_blank"><img src="https://img.shields.io/static/v1?label=Docs&message=available&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://ko-fi.com/I2I35XISJ"><img alt='Kofi' src="https://img.shields.io/static/v1?label=Support%20Us&message=KO.FI&color=ff5e5b&logo=kofi&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://cath.statuspage.io/"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=Cath.exe&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://cath.statuspage.io/"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=Cath%202&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://cath.statuspage.io/"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=API&message=Under%20Devlopment&color=FF5E5B&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
</p>
<!-- description -->
**Cath.exe** is a Multipurpose Discord Bot with many features that include but are not limited to Moderation, Music and Economy. The Call of Duty Stats are courtesy of **Project Lighthouse** by [**Path.exe**](https://www.youtube.com/channel/UC0hvUWYhyx_DOEBzLWEJxsw).<br><br>
If you like this bot, feel free to <img src = "https://discord.com/assets/141d49436743034a59dec6bd5618675d.svg" width = "16"> **Star** and **fork** this repository.<br>
# Features
<a href="https://thunder75.gitbook.io/cath-bot/core/commands" ><img src="https://img.shields.io/static/v1?label=List %20OF&message=Commands&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
🚨 **Moderation** - Classic commands like kick, ban, warn, role and many more.. <br>
📈 **Economy** - A Robust economy system, inspired by **pepe bot.** <br>
**Fun Commands** - A massive collection of fun commands `(35+ commands)` <br>
🎵 **Music** - Classic Music Commands that can play from various sources. <br>
🛠 **Utility** - A wide range of useful commands `(Around 20)` <br>
🕹 **Games** - Many fun games to spend your time ...
> To access the full list of commands, check out our [Documentation](https://thunder75.gitbook.io/cath-bot/core/commands).
🎮 **Call of Duty** - Check Call od Duty Mobile Stats exclusivly using our bot
> ⚠ Only avaliable on the Live instance for now.
## More Info
[![Top language](https://img.shields.io/github/languages/top/night0721/cath.exe?labelColor=F7DF1E&color=555555&style=for-the-badge&scale=1.4)](https://github.com/night0721/cath.exe)
[![CodeFactor](https://www.codefactor.io/repository/github/night0721/cath/badge?s=ffdc3c246a8b91a3d7064d128a1b81b9dbeca61f&style=for-the-badge)]((https://www.codefactor.io/repository/github/night0721/cath))
<a href="https://thunder75.gitbook.io/cath-bot/deployment" target="_blank"><img src="https://img.shields.io/static/v1?label=Deployment&message=Guide&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
A detailed Deployment guide can be found [here](https://thunder75.gitbook.io/cath-bot/deployment).
<details>
<summary>Made With</summary>
[![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
[![node](https://img.shields.io/badge/Node.js-43853D?style=for-the-badge&logo=node.js&logoColor=white)](https://nodejs.org/en/)
[![npm](https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/)
[![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white)](https://mongodb.com/)
<img src ="https://forthebadge.com/images/badges/built-with-love.svg" width = "122"><br>
</details>
<details>
<summary>Issues & PRs</summary>
[![Open issues](https://img.shields.io/github/issues-raw/night0721/cath.exe?style=for-the-badge)](https://github.com/night0721/cath.exe/issues)
[![Closed issues](https://img.shields.io/github/issues-closed-raw/night0721/cath.exe?style=for-the-badge)](https://github.com/night0721/cath.exe/issues)
[![Open PRs](https://img.shields.io/github/issues-pr-raw/night0721/cath.exe?style=for-the-badge)](https://github.com/night0721/cath.exe/pulls)
[![Closed PRs](https://img.shields.io/github/issues-pr-closed-raw/night0721/cath.exe?style=for-the-badge)](https://github.com/night0721/cath.exe/pulls)
</details>
<details>
<summary>Github Stats</summary>
![Lines of code](https://img.shields.io/tokei/lines/github/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge)
![GitHub Discussions](https://img.shields.io/github/discussions/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge)
[![Last commit](https://img.shields.io/github/last-commit/night0721/cath.exe?icon=discord&color=5865F2&style=for-the-badge&scale=1.4)](https://github.com/night0721/cath.exe)
<!-- [![Files](https://tokei.rs/b1/github/night0721/cath.exe?category=files&style=for-the-badge)](https://github.com/night0721/cath.exe) -->
</details>
# Support, Feature Request & Bug Reports
## <img src = "https://cdn.discordapp.com/emojis/867093614403256350.png?v=1" width = 18> Support & Feature Request
Join the official [Support Server](https://discord.gg/SbQHChmGcp) on Discord & we will be happy to assist you. <br>
To Request new features contact us on Discord using the support server.
## <img src = "https://cdn.discordapp.com/emojis/867093601962950666.png?v=1" width = "18"> Report Bugs
You can report bugs or issues by opening a issue in this repository. Alternatevely you can also contact us on Discord using the support server.
[![Support Server](https://img.shields.io/discord/718762019586572341?label=Support%20Server&logo=Discord&colorB=5865F2&style=for-the-badge&logoColor=white) ](https://discord.gg/SR7TeNJG67)
<h1 align="center"> Contributors </h1>
Contributions are always welcomed, but make sure to read [Contributing.md](/CONTRIBUTING.md) first.
![Contributors](https://badges.pufler.dev/contributors/night0721/cath.exe?bots=false)
<!-- <img src="https://socialify.git.ci/night0721/cath.exe/image?description=1&descriptionEditable=A%20Discord.js%20v13%20Template%20based%20on%20cath.exe&font=Raleway&forks=1&issues=1&language=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Dark"> -->

View file

@ -1,7 +1,7 @@
{
"name": "cath.exe - CODM Bot",
"name": "NYX - CODM Bot",
"description": "Host cath.exe through Heroku",
"keywords": ["cat", "cath", "codm", "discord", "discord bot"],
"keywords": ["bot", "nyx", "codm", "discord", "gunsmith"],
"repository": "https://github.com/night0721/cath.exe",
"env": {
"TOKEN": {
@ -11,64 +11,6 @@
"MONGO": {
"description": "MongoDB URI from https://mongodb.com/",
"value": ""
},
"CLIENT_ID": {
"description": "Bot ID from https://discord.com/developers/applications",
"value": ""
},
"CLIENT_SECRET": {
"description": "Client Secret from https://discord.com/developers/applications",
"value": ""
},
"DMLogID": {
"description": "DM Log Webhook ID",
"value": ""
},
"DMLogToken": {
"description": "DM Log Webhook Token",
"value": ""
},
"CMDLogID": {
"description": "Command Log Webhook ID",
"value": ""
},
"CMDLogToken": {
"description": "Command Log Webhook Token",
"value": ""
},
"ReadyLogID": {
"description": "Ready Log Webhook ID",
"value": ""
},
"ReadyLogToken": {
"description": "Ready Log Webhook Token",
"value": ""
},
"ErrorLogID": {
"description": "Error Log Webhook ID",
"value": ""
},
"ErrorLogToken": {
"description": "Error Log Webhook Token",
"value": ""
},
"ServerLogID": {
"description": "Server Log Webhook ID",
"value": ""
},
"ServerLogToken": {
"description": "Server Log Webhook Token",
"value": ""
},
"PORT": {
"description": "Port for Heroku to use",
"value": "3000",
"required": false
},
"REDIRECT": {
"description": "REDIRECT URL",
"value": "",
"required": false
}
},
"buildpacks": [

50
bot.js
View file

@ -1,50 +0,0 @@
const { MessageEmbed, Intents } = require("discord.js");
const Cath = require("./client/Cath");
const version = require("./package.json").version;
const config = require("./config.json");
const client = new Cath({
allowedMentions: { parse: ["users", "roles"], repliedUser: true },
presence: {
activities: [
{
name: `v${version} | ${config.prefix}help`,
type: "STREAMING",
url: "https://www.youtube.com/watch?v=_D5xG7XoF88",
},
],
},
restTimeOffset: 0,
partials: ["MESSAGE", "CHANNEL", "REACTION", "GUILD_MEMBER"],
intents: [
//Intents.FLAGS.GUILD_MEMBERS,
//Intents.FLAGS.GUILD_PRESENCES,
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_BANS,
Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,
Intents.FLAGS.GUILD_INVITES,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Intents.FLAGS.DIRECT_MESSAGES,
Intents.FLAGS.DIRECT_MESSAGE_TYPING,
],
});
module.exports = client;
require("./util/functions/economy")(client);
require("./util/dist/manager")(client);
require("./util/dist/handler")(client);
process.on("unhandledRejection", async err => {
if (client.user) {
if (client.user.id === client.user.id) {
const embed = new MessageEmbed()
.setTitle("UnhandledRejection Error")
.setDescription(`\`\`\`ini\n${err.stack}\`\`\``)
.setTimestamp()
.setColor(client.color)
.setFooter(client.user.username);
client.channels.cache.get(client.ErrorLog).send({ embeds: [embed] });
}
}
return console.error(err);
});
client.start();

2
client/CODMClient.js Normal file
View file

@ -0,0 +1,2 @@
const { CODMClient } = require("cath");
module.exports = new CODMClient("Gae");

View file

@ -1,72 +0,0 @@
const { Client, Collection } = require("discord.js");
const config = require("../config.json");
const { GiveawaysManager } = require("discord-giveaways");
require("dotenv").config();
class Cath extends Client {
/**
* @param {Client.options} options
*/
constructor(options = {}) {
super(options);
this.commands = new Collection();
this.slashCommands = new Collection();
this.aliases = new Collection();
this.esnipes = new Collection();
this.hide = new Collection();
this.snipes = new Collection();
this.queue = new Map();
this.Timers = new Map();
this.config = config;
this.function = require("../util/functions/function");
this.data = require("../util/functions/mongoose");
this.err = require("../util/dist/err");
this.serr = require("../util/dist/slash");
this.cat = this.config.ca;
this.SuggestionLog = this.config.Suggestion;
this.ReportLog = this.config.Report;
this.DMLog = this.config.DMLog;
this.CMDLog = this.config.CMDLog;
this.ServerLog = this.config.ServerLog;
this.ErrorLog = this.config.ErrorLog;
this.color = this.config.color;
this.author = "Cath Team";
this.invite = "https://discord.gg/SbQHChmGcp";
this.web = this.config.URL;
this.owners = [
"452076196419600394", //Night
"766645910087139338", //chekseaa
"755476040029306952", //Kałÿ
"534027706325532694", //Cat drinking a cat
"381442059111759883", //Thunder
"556808365574193194", //chunchunmaru
];
this.currency = "<:cp:840231933933387797>";
this.path = [
"614423108388126731",
"767173194943168542",
"783633408738721834",
"718762019586572341",
"784052348561522730",
"840225563193114624",
"800396461229080619",
];
this.giveaways = new GiveawaysManager(this, {
storage: "./util/Data/giveaways.json",
updateCountdownEvery: 1000,
default: {
botsCanWin: false,
embedColor: this.color,
reaction: "🎉",
},
});
}
start() {
this.data
.connect(process.env.MONGO)
.then(() => console.log("Connected to MongoDB!"))
.catch(e => console.log(e));
this.login(process.env.TOKEN);
}
}
module.exports = Cath;

2
client/CodeClient.js Normal file
View file

@ -0,0 +1,2 @@
const { CodeClient } = require("cath");
module.exports = new CodeClient();

38
client/GiveawaysClient.js Normal file
View file

@ -0,0 +1,38 @@
const { GiveawaysClient } = require("cath");
const client = require("..");
require("dotenv").config();
module.exports = new GiveawaysClient({
client,
MongooseConnectionURI: process.env.MONGO,
GiveawayMessages: {
dmWinner: true,
giveaway: "🎉 **GIVEAWAY** 🎉",
giveawayDescription:
"🎁 Prize: **{award}**\n🎊 Hosted by: {hostedBy}\n⏲ Winner(s): `{winners}` \n🙏 Entrants: {totalParticipants} \n\n**Requirements:** {requirements}",
endedGiveawayDescription:
"🎁 Prize: **{award}**\n🎊 Hosted by: {hostedBy}\n⏲ Winner(s): {winners} \n🙏 Entrants: {totalParticipants}",
giveawayFooterImage: "https://emoji.gg/assets/emoji/3461-giveaway.gif",
winMessage:
"Congratulations {winners}! You have won **{award}** from total `{totalParticipants}` entrants!",
rerolledMessage: "Rerolled! {winner} is the new winner of the giveaway!",
toParticipate: "**Click the `Enter` button to enter the giveaway!**",
newParticipant:
"You have successfully entered for this giveaway! There are total `{totalParticipants}` entrants",
alreadyParticipated: "**You have already participated in this giveaway!**",
noParticipants: "There isn't enough entrant in this giveaway!",
noRole:
"You don't have the required role(s)\n{requiredRoles}\n for the giveaway!",
dmMessage:
"You have won a giveaway in **{guildName}**!\nPrize: [{award}]({giveawayURL})",
noWinner:
"There isn't any winner in this giveaway due to not enough entrants",
alreadyEnded: "The giveaway had already ended!",
dropWin: "{winner} Won The Drop!!",
noWeeklyExp:
"you dont have the required minimum weekly xp to join this giveaway",
noLevel: "You dont have the minimum required level to join this giveaway",
nonoRole:
"You do not have the {requiredRoles} role(s) which is required to join this giveaway",
editParticipants: true,
},
});

149
client/NYX.js Normal file
View file

@ -0,0 +1,149 @@
const { Client, Collection, MessageEmbed } = require("discord.js");
const { Manager } = require("erela.js");
const config = require("../config");
const Spotify = require("erela.js-spotify");
const utils = require("../util/functions/function");
require("dotenv").config();
class NYX extends Client {
/**
* @param {Client.options} options
*/
constructor(
options = {
presence: {
activities: [
{
name: `v${require("../package.json").version} | /help`,
type: "STREAMING",
url: "https://www.youtube.com/watch?v=YSKDu1gKntY",
},
],
},
shard: "auto",
restTimeOffset: 0,
partials: ["MESSAGE", "CHANNEL", "REACTION", "GUILD_MEMBER"],
intents: 24207,
}
) {
super(options);
this.slashCommands = new Collection();
this.hide = new Collection();
this.esnipes = new Collection();
this.snipes = new Collection();
this.config = config;
this.data = require("../util/functions/mongoose");
this.color = config.color;
this.author = "Team NYX";
this.invite = "https://discord.gg/SbQHChmGcp";
this.docs = "https://thunder75.gitbook.io/nyx/";
this.web = config.URL;
this.owners = [
"452076196419600394", // Night
"534027706325532694", // Cat drinking a cat
"381442059111759883", // Thunder
"556808365574193194", // chunchunmaru
"746753527338238115", // mightyful
];
this.currency = "<:cp:840231933933387797>"; // <a:pumpkin:898975476863877170>
this.xp = "<:nyx_xp:900309007472926720>";
this.path = [
"614423108388126731", // Camper on Duty
"767173194943168542", // Dark Bonker
"718762019586572341", // NYX Nation
"869583978108157972", // Lighthouse Community
"840225563193114624", // Command Test
];
const client = this;
require("../util/functions/economy")(client);
this.manager = new Manager({
plugins: [
new Spotify({
clientID: process.env.SPOTIFY_ID,
clientSecret: process.env.SPOTIFY_SECRET,
}),
],
nodes: [
{
host: config.Lavalink.Host,
port: config.Lavalink.Port,
password: config.Lavalink.Password,
retryDelay: 5000,
},
],
autoPlay: true,
send: (id, payload) => {
const guild = client.guilds.cache.get(id);
if (guild) guild.shard.send(payload);
},
})
.on("nodeConnect", node =>
console.log(`Node "${node.options.identifier}" has connected`)
)
.on("nodeError", (node, error) =>
console.log(
`Node "${node.options.identifier}" encountered an error: ${error.message}`
)
)
.on("trackStart", (player, track) => {
const channel = client.channels.cache.get(player.textChannel);
const embed = new MessageEmbed()
.setColor(config.color)
.setAuthor(
`Now Playing`,
"https://cdn.discordapp.com/emojis/897017864085712936.gif"
)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setThumbnail(player.queue.current.displayThumbnail())
.setDescription(`[${track.title}](${track.uri})`)
.addField(
"Duration",
`\`${utils.prettyMs(track.duration, {
colonNotation: true,
})}\``,
true
);
channel.send({ embeds: [embed] });
})
.on("queueEnd", player => {
const channel = client.channels.cache.get(player.textChannel);
const embed2 = new MessageEmbed()
.setColor(config.color)
.setAuthor(
`Queue has ended`,
"https://cdn.discordapp.com/emojis/897017864085712936.gif"
)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
channel.send({ embeds: [embed2] });
// player.destroy(); Remove if 24/7
});
}
start() {
require("../util/dist/handler")(this);
this.data
.connect(process.env.MONGO)
.then(() => console.log("Connected to MongoDB ✅"))
.catch(e => console.log(e));
this.login(process.env.TOKEN);
}
err(c, e) {
const embed = new MessageEmbed()
.setTitle("An Error Occured")
.setColor("RED")
.setDescription(`❌ | ${e}`)
.setTimestamp()
.setFooter(`Made by ${this.author}`, this.user.displayAvatarURL());
c.followUp({ embeds: [embed] });
}
se(c, e) {
const embed = new MessageEmbed()
.setColor(this.color)
.setDescription(e)
.setTimestamp();
c.followUp({ embeds: [embed] });
}
}
module.exports = NYX;

View file

@ -1,6 +1,6 @@
const { StarboardClient } = require("cath");
const client = require("../bot");
const client = require("..");
module.exports = new StarboardClient({
client,
color: "02023a",
color: client.color,
});

2
client/URLClient.js Normal file
View file

@ -0,0 +1,2 @@
const { URLClient } = require("cath");
module.exports = new URLClient();

828
command/CODM/build.js Normal file
View file

@ -0,0 +1,828 @@
const { MessageEmbed } = require("discord.js");
const axios = require("axios");
const moment = require("moment");
module.exports = {
name: "build",
description: "Get gunsmith builds",
type: "CHAT_INPUT",
category: "CODM",
options: [
{
type: "SUB_COMMAND",
name: "assault_rifle",
description: "Get a gunsmith build for a Assault Rifle",
options: [
{
type: 3,
name: "name",
description: "Name of the Gun",
required: true,
choices: [
{
name: "AK117",
value: "ak117",
},
{
name: "M16",
value: "m16",
},
{
name: "Type 25",
value: "type25",
},
{
name: "AK-47",
value: "ak47",
},
{
name: "ASM10",
value: "asm10",
},
{
name: "M4",
value: "m4",
},
{
name: "BK57",
value: "bk57",
},
{
name: "LK24",
value: "lk24",
},
{
name: "Man-o-War",
value: "manowar",
},
{
name: "ICR-1",
value: "icr1",
},
{
name: "KN-44",
value: "kn44",
},
{
name: "HBRa3",
value: "hbra3",
},
{
name: "HVK-30",
value: "hvk30",
},
{
name: "DR-H",
value: "drh",
},
{
name: "Peacekeeper MK2",
value: "peacekeepermk2",
},
{
name: "FR .556",
value: "fr556",
},
{
name: "AS VAL",
value: "asval",
},
{
name: "CR-56 AMAX",
value: "cr56amax",
},
{
name: "M13",
value: "m13",
},
{
name: "Swordfish",
value: "swordfish",
},
],
},
{
type: 3,
name: "youtuber",
description: "Select a Content Creator",
required: true,
choices: [
{
name: "Path.exe",
value: "path",
},
{
name: "Jokesta",
value: "jokesta",
},
],
},
{
type: 3,
name: "tag",
description: "Playstyle/game mode of the build",
required: true,
choices: [
{
name: "Aggressive",
value: "aggressive",
},
{
name: "Passive",
value: "passive",
},
{
name: "Search & Destroy",
value: "snd",
},
{
name: "Respawn",
value: "respawn",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "sub_machine_gun",
description: "Get a gunsmith build for a Sub Machine Gun",
options: [
{
type: 3,
name: "name",
description: "Name of the Gun",
required: true,
choices: [
{
name: "RUS-79u",
value: "rus79u",
},
{
name: "PDW-57",
value: "pdw57",
},
{
name: "Razorback",
value: "razorback",
},
{
name: "MSMC",
value: "msmc",
},
{
name: "HG40",
value: "hg40",
},
{
name: "Pharo",
value: "pharo",
},
{
name: "GKS",
value: "gks",
},
{
name: "Cordite",
value: "cordite",
},
{
name: "QQ9",
value: "qq9",
},
{
name: "Fennec",
value: "fennec",
},
{
name: "Chicom",
value: "chicom",
},
{
name: "AGR 556",
value: "agr556",
},
{
name: "QXR",
value: "qxr",
},
{
name: "PP19 Bizon",
value: "pp19bizon",
},
{
name: "MX9",
value: "mx9",
},
],
},
{
type: 3,
name: "youtuber",
description: "Select a Content Creator",
required: true,
choices: [
{
name: "Path.exe",
value: "path",
},
{
name: "Jokesta",
value: "jokesta",
},
],
},
{
type: 3,
name: "tag",
description: "Playstyle/game mode of the build",
required: true,
choices: [
{
name: "Aggressive",
value: "aggressive",
},
{
name: "Passive",
value: "passive",
},
{
name: "Search & Destroy",
value: "snd",
},
{
name: "Respawn",
value: "respawn",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "sniper_rifle",
description: "Get a gunsmith build for a Sniper Rifle",
options: [
{
type: 3,
name: "name",
description: "Name of the Gun",
required: true,
choices: [
{
name: "Arctic .50",
value: "arctic50",
},
{
name: "M21 EBR",
value: "m21ebr",
},
{
name: "DL Q33",
value: "dlq33",
},
{
name: "Locus",
value: "locus",
},
// {
// name: "XPR-50",
// value: "xpr50",
// },
// {
// name: "NA-45",
// value: "na45",
// },
{
name: "Outlaw",
value: "outlaw",
},
{
name: "Rytec AMR",
value: "rytecamr",
},
],
},
{
type: 3,
name: "youtuber",
description: "Select a Content Creator",
required: true,
choices: [
{
name: "Path.exe",
value: "path",
},
// {
// name: "little_b",
// value: "littleb",
// },
],
},
{
type: 3,
name: "tag",
description: "Playstyle/game mode of the build",
required: true,
choices: [
{
name: "Aggressive",
value: "aggressive",
},
{
name: "Passive",
value: "passive",
},
{
name: "Search & Destroy",
value: "snd",
},
{
name: "Respawn",
value: "respawn",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "light_machine_gun",
description: "Get a gunsmith build for a Light Machine Gun",
options: [
{
type: 3,
name: "name",
description: "Name of the Gun",
required: true,
choices: [
{
name: "S36",
value: "s36",
},
{
name: "UL736",
value: "ul736",
},
{
name: "RPD",
value: "rpd",
},
{
name: "M4 LMG",
value: "m4lmg",
},
{
name: "Chopper",
value: "chopper",
},
{
name: "Holger 26",
value: "holger26",
},
{
name: "Hades",
value: "hades",
},
],
},
{
type: 3,
name: "youtuber",
description: "Select a Content Creator",
required: true,
choices: [
{
name: "Path.exe",
value: "path",
},
],
},
{
type: 3,
name: "tag",
description: "Playstyle/game mode of the build",
required: true,
choices: [
{
name: "Aggressive",
value: "aggressive",
},
{
name: "Passive",
value: "passive",
},
{
name: "Search & Destroy",
value: "snd",
},
{
name: "Respawn",
value: "respawn",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "shotgun",
description: "Get a gunsmith build for a Shotgun",
options: [
{
type: 3,
name: "name",
description: "Name of the Gun",
required: true,
choices: [
{
name: "HS2126",
value: "hs2126",
},
{
name: "BY15",
value: "by15",
},
{
name: "Striker",
value: "striker",
},
{
name: "KRM_262",
value: "krm262",
},
{
name: "Echo",
value: "echo",
},
{
name: "HS0405",
value: "hs0405",
},
{
name: "R9-0",
value: "r90",
},
],
},
{
type: 3,
name: "youtuber",
description: "Select a Content Creator",
required: true,
choices: [
{
name: "Path.exe",
value: "path",
},
{
name: "dHitman",
value: "dhitman",
},
],
},
{
type: 3,
name: "tag",
description: "Playstyle/game mode of the build",
required: true,
choices: [
{
name: "ADS",
value: "ads",
},
{
name: "Hipfire",
value: "hipfire",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "marksman_rifle",
description: "Get a gunsmith build for a Marksman Rifle",
options: [
{
type: 3,
name: "name",
description: "Name of the Gun",
required: true,
choices: [
{
name: "Kilo Bolt-Action",
value: "kiloboltaction",
},
{
name: "SKS",
value: "sks",
},
{
name: "SP-R 208",
value: "spr208",
},
{
name: "MK2",
value: "mk2",
},
],
},
{
type: 3,
name: "youtuber",
description: "Select a Content Creator",
required: true,
choices: [
{
name: "Path.exe",
value: "path",
},
// {
// name: "Little_b",
// value: "littleb",
// },
],
},
{
type: 3,
name: "tag",
description: "Playstyle/game mode of the build",
required: true,
choices: [
{
name: "Aggressive",
value: "aggressive",
},
{
name: "Passive",
value: "passive",
},
{
name: "Respawn",
value: "respawn",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "pistol",
description: "Get a gunsmith build for a Pistol",
options: [
{
type: 3,
name: "name",
description: "Name of the Gun",
required: true,
choices: [
{
name: "J358",
value: "j358",
},
{
name: "MW11",
value: "mw11",
},
{
name: ".50 GS",
value: "gs50",
},
{
name: "Renetti",
value: "renetti",
},
{
name: "Shorty",
value: "shorty",
},
{
name: "Crossbow",
value: "crossbow",
},
],
},
{
type: 3,
name: "youtuber",
description: "Select a Content Creator",
required: true,
choices: [
{
name: "Path.exe",
value: "path",
},
],
},
{
type: 3,
name: "tag",
description: "Playstyle/game mode of the build",
required: true,
choices: [
{
name: "Respawn",
value: "respawn",
},
],
},
],
},
],
run: async (client, interaction, args) => {
const allguns = {
ak117: "AK117",
m16: "M16",
type25: "Type 25",
ak47: "AK-47",
asm10: "ASM10",
m4: "M4",
bk57: "BK57",
lk24: "LK24",
manowar: "Man-O-War",
icr1: "ICR-1",
kn44: "KN-44",
hbra3: "HBRa3",
hvk30: "HVK-30",
drh: "DR-H",
peacekeepermk2: "Peacekeeper MK2",
fr556: "FR .556",
asval: "AS VAL",
cr56amax: "CR-56 AMAX",
m13: "M13",
swordfish: "Swordfish",
j358: "J358",
gs50: ".50 GS",
mw11: "MW11",
renetti: "Renetti",
shorty: "Shorty",
crossbow: "Crossbow",
kiloboltaction: "Kilo Bolt-Action",
sks: "SKS",
spr208: "SP-R 208",
mk2: "mk2",
s36: "S36",
ul736: "UL736",
rpd: "RPD",
m4lmg: "M4LMG",
chopper: "Chopper",
holger26: "Holger 26",
hades: "Hades",
arctic50: "Arctic .50",
m21ebr: "M21 EBR",
dlq33: "DL Q33",
locus: "Locus",
// na45: "NA 45",
// xpr50: "XPR-50",
locus: "Locus",
outlaw: "Outlaw",
rytecamr: "Rytec AMR",
hs2126: "HS2126",
by15: "BY15",
striker: "Striker",
krm262: "KRM 262",
echo: "Echo",
hs0405: "HS0405",
r90: "R9-0",
rus79u: "RUS-79U",
hg40: "HG-40",
pdw57: "PDW-57",
chicom: "Chicom",
razorback: "Razorback",
msmc: "MSMC",
pharo: "Pharo",
gks: "GKS",
cordite: "Cordite",
qq9: "QQ9",
fennec: "Fennec",
agr556: "AGR 556",
qxr: "QXR",
pp19bizon: "PP19 Bizon",
mx9: "MX9",
};
const all = {
assault_rifle: "Assault Rifle",
sniper_rifle: "Sniper Rifle",
marksman_rifle: "Marksman Rifle",
shotgun: "Shotgun",
light_machine_gun: "Light Machine Gun",
sub_machine_gun: "Sub Machine Gun",
path: "Path.exe",
dhitman: "dHitman",
jokesta: "Jokesta",
// littleb:"Little B",
aggressive: "Aggressive",
passive: "Passive",
snd: "Search And Destroy",
respawn: "Respawn",
ads: "ADS",
hipfire: "Hipfire",
};
const gun = args[1];
const cc = args[2];
const tag = args[3];
const data = await axios
.get(
`${process.env.api}/api/v1/codm/builds?name=${gun}&cc=${cc}&tag=${tag}`,
{
headers: {
Authorization: "Gae",
},
}
)
.then(res => res.data)
.catch();
const unavaliable = new MessageEmbed()
.setDescription(
`<:nyx_not_available:897378400031879188> We don't have a ${all[tag]} **${allguns[gun]}** gunsmith build by **${all[cc]}**, Please try another tag or a differnt content creator`
)
.setColor(client.color);
if (!data) {
interaction.followUp({ embeds: [unavaliable] });
} else {
const arr = [];
data.attachments.map((e, i) => {
return arr.push(`**${i + 1}: ${e}**`);
});
const embed = new MessageEmbed()
.setTitle(
`${data.weaponName}(${data.weaponType})'s ${all[tag]} build from ${data.author}`
)
.setDescription(
`<:nyx_description:897379659665264650> Description \`\`\`\n${data.notes}\n\`\`\``
)
.setColor(16580400)
.setImage(data.imageUrl)
.setFooter(
`Builds Aggregated by ${client.author}`,
client.user.displayAvatarURL()
)
.setTimestamp()
.addFields(
{
name: "<:nyx_author:897379080549314601> Author:",
value: `\`\`\`\n${data.author}\n\`\`\``,
inline: true,
},
{
name: "<a:lastupdate:897381474330873887> Last Updated:",
value: `\`\`\`\n${moment(Date.parse(data.lastUpdate)).format(
"MMMM Do YYYY"
)}\n\`\`\``,
inline: true,
},
{
name: ":id: CWTS:",
value: `\`\`\`\n${data.cwts}\n\`\`\``,
inline: true,
},
{
name: ":paperclip: Attachments:",
value: arr.join("\n"),
},
{
name: "<a:tags:897034924140404776> Tags",
value: data.tags.join(", "),
}
)
.setURL(client.web);
interaction.followUp({
embeds: [embed],
});
}
},
};
// ENABLE AFTER Holloween
// run: async (client, interaction, args) => {
// const embed = new MessageEmbed()
// .setTitle(`Prefix commands are now disabled`)
// .setDescription(`Please enable **Application commands** in the channel settings to get access to slash commands, we have discontinued prefix commands.`)
// .setColor(client.color)
// .setThumbnail(interaction.guild.iconURL({ dynamic: true }))
// .addFields(
// {
// name: "Need help ?",
// value: `Join our **[Support Server](https://discord.gg/SR7TeNJG67)**`,
// inline: true,
// },
// {
// name: "Support us <a:donate:896985486260846614>",
// value: `[KoFi](https://ko-fi.com/cathteam)`,
// inline: true,
// }
// )
// .setThumbnail("../../util/assets/images/nyx_logo_transparent.webp")
// .setTimestamp();
// interaction.followUp({ embeds: [embed] });
// },
// };

55
command/CODM/class.js Normal file
View file

@ -0,0 +1,55 @@
const { MessageEmbed } = require("discord.js");
const model = require("../../models/weapons");
const Attachments = require("../../util/Data/attachments.json");
module.exports = {
name: "class",
description: "Generate random class in CODM",
category: "CODM",
run: async (client, interaction) => {
const data = async () => {
const d = await model.findOne({});
const types = d.Categories;
const names = d.Primary;
const category = types[Math.floor(Math.random() * types.length)];
const weapons = names[0][category];
return `${weapons[Math.floor(Math.random() * weapons.length)]}`;
};
const primary_weapon = await data();
const primary = primary_weapon.replace(/[ -]/g, "_").replace(/\./g, "");
const slots = shuffle(Object.keys(Attachments[primary][0]));
const slot_1 = slots.next().value,
slot_2 = slots.next().value,
slot_3 = slots.next().value,
slot_4 = slots.next().value,
slot_5 = slots.next().value;
const result = new MessageEmbed()
.setColor(client.color)
.setTitle(`🎲 A Randomly Generated Class for ${primary_weapon} 🎲`)
.setDescription(
`**Attachments**\n**${getAttachment(
primary,
slot_1
)}**\n**${getAttachment(primary, slot_2)}**\n**${getAttachment(
primary,
slot_3
)}**\n**${getAttachment(primary, slot_4)}**\n**${getAttachment(
primary,
slot_5
)}**`
)
.setURL(client.web)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [result] });
function* shuffle(array) {
let i = array.length;
while (i--) {
yield array.splice(Math.floor(Math.random() * (i + 1)), 1)[0];
}
}
function getAttachment(gun, slot) {
const ca = Attachments[gun][0][slot];
return ca[Math.floor(Math.random() * ca.length)];
}
},
};

125
command/CODM/damage.js Normal file
View file

@ -0,0 +1,125 @@
const common = require("../../util/functions/common");
let currGun = {},
currStats = [],
currAttachments = {},
currDRM = {},
totalEffects = [],
interpretion = "",
hasError = false;
const errMsg = "*Generic placeholder error message*";
module.exports = {
name: "damage",
description: "Check gun damage",
usage: "(Gun)",
category: "CODM",
options: [
{
type: 7,
name: "gun",
description: "Gun name",
required: true,
},
],
run: async (client, interaction, args) => {
const repEmb = dmg(args[0].replace("\n", " "));
if (hasError) {
interaction.followUp({ embeds: [repEmb] });
} else {
interaction.followUp({ embeds: [repEmb] });
}
},
};
function dmg(inpmsg) {
currGun = common.weaponIdentifier(inpmsg);
if (typeof currGun == "string") {
hasError = true;
return currGun;
}
currDRM = currGun.drm[0];
currStats = currGun.stats;
currAttachments = common.attachmentsIdentifier(
inpmsg,
currGun.aments,
currStats
);
if (typeof currAttachments == "string") {
hasError = true;
return currAttachments;
}
if (currAttachments.length) {
totalEffects = common.totaler(currAttachments);
currDRM = currGun.drm[totalEffects[37]];
currDRM.range = currDRM.range.map(
x => (x * (totalEffects[13] + 100)) / 100
);
currStats = common.updateStatswithEffects(totalEffects, currStats);
}
const mn = [
"Head",
"Neck",
"Upper Chest",
"Lower Chest",
"Shoulders",
"Upper Arms",
"Lower Arms",
"Stomach",
"Belly Button",
"Crotch",
"Thighs",
"Calf Muscles",
"Feet",
],
m1 = currDRM.bodymultiplier,
m2 = [...new Set(m1)], // [1.2, 1, 0.9]
m3 = m1.map(x => m2.indexOf(x)), // [0, 1, 1, 1, 1, 1, 2, 2, 2]
m4 = m2
.map(x =>
m3
.map((y, i) => {
if (x === m2[y]) {
return mn[i];
}
})
.filter(y => y)
)
.map(x =>
x.length === m1.length
? ["All"]
: x.length === m1.length - 1
? ["Others"]
: x
);
interpretion = currGun.gunname + common.interpretioner(currAttachments);
return {
title: "**" + interpretion + "**",
color: 4849497,
fields: m4.map((x, i) => {
return {
name: x.join(", ") + ":",
value: common.damageHandler(
currDRM.damage,
currDRM.range,
m2[i],
100,
60000 / currStats[5],
currStats[7],
currStats[6],
currStats[0]
),
};
}),
footer: {
text: "All the stats courtesy of Project Lighthouse",
icon_url:
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
},
};
}
// console.log(dmg("47 + mono"));
/* console.log(dmg("47"));
console.log(dmg("striker + choke"));
console.log(dmg("striker + choke"));
console.log(dmg("striker"));
common.makeError();*/

170
command/CODM/effects.js vendored Normal file
View file

@ -0,0 +1,170 @@
const common = require("../../util/functions/common");
const data = require("../../util/Data/data.json");
let currGun, currAttachments, interpretion, hasError;
const errMsg = "*Generic placeholder error message*";
module.exports = {
name: "effects",
description: "Check gun effects",
usage: "(Gun)",
category: "CODM",
options: [
{
type: 7,
name: "gun",
description: "Gun name",
required: true,
},
],
run: async (client, interaction, args) => {
const repEmb = attachments(args[0].replace("\n", " "));
if (hasError) {
interaction.followUp({ embeds: [repEmb] });
} else {
interaction.followUp({ embeds: [repEmb] });
}
},
};
function attachments(inpmsg) {
const out = "",
at = data.attachmentTypes.map(x => (x.slice(-1) === "s" ? x : x + "s"));
if (inpmsg.includes("+") && inpmsg.includes(":")) {
hasError = true;
return "Bro, can u liek, not do that?";
}
if (inpmsg.includes(":")) {
const inpAll = inpmsg
.split(":")
.map(x => x.trim())
.filter(x => x),
inpType = inpAll.length === 2 ? inpAll[1] : null;
if (!inpType) {
hasError = true;
return inpAll.length < 2
? "Empty " + (inpAll[0] ? "" : "weapon name and ") + "attachment type"
: "Multiple `:`s detected";
}
currGun = common.weaponIdentifier(inpAll[0]);
if (typeof currGun == "string") {
hasError = true;
return currGun;
}
let currAttachmentsType = at.filter(x => simplify(x) == simplify(inpType));
currAttachmentsType = currAttachmentsType.length
? currAttachmentsType
: at.filter(
x => simplify(x.substring(0, x.length - 1)) == simplify(inpType)
);
currAttachmentsType = currAttachmentsType.length
? currAttachmentsType
: at.filter(x => simplify(x).includes(simplify(inpType)));
if (currAttachmentsType.length === 0) {
hasError = true;
return "Couldn't identify `" + inpType + "`";
} else if (currAttachmentsType.length === 1) {
currAttachmentsType = at.indexOf(currAttachmentsType[0]);
} else {
hasError = true;
return (
"Did you mean `" +
currAttachmentsType.reduce((out, x, i) =>
[out, x].join(
i === currAttachmentsType.length - 1 ? "` or `" : "`, `"
)
) +
"`"
);
}
return {
title: currGun.gunname,
color: 11348938,
fields: [
{
name:
"**" +
currGun.gunname +
"** has the following " +
at[currAttachmentsType],
value:
"```\n" +
currGun.aments
.filter(x => x.type - 1 === currAttachmentsType)
.map(x => x.name)
.join("\n") +
"```",
},
],
footer: {
text: "All the stats courtesy of Project Lighthouse",
icon_url:
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
},
};
function simplify(v) {
return v.toLowerCase().replace(/[^0-9a-z]/g, "");
}
}
currGun = common.weaponIdentifier(inpmsg);
if (typeof currGun == "string") {
hasError = true;
return currGun;
}
hasAttachments = common.hasAttachments(inpmsg);
currAttachments = [];
if (hasAttachments) {
currAttachments = common.attachmentsIdentifier(
inpmsg,
currGun.aments,
currGun.stats
);
if (typeof currAttachments == "string") {
hasError = true;
return currAttachments;
}
return {
title: currGun.gunname + common.interpretioner(currAttachments),
color: 11348938,
fields: common.attachmentHandler(
common.totaler(currAttachments),
currGun.stats
),
footer: {
text: "All the stats courtesy of Project Lighthouse",
icon_url:
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
},
};
} else {
const availableAttachmentTypes = [
...new Set(currGun.aments.map(x => x.type)),
];
return {
title: currGun.gunname,
color: 11348938,
fields: [
{
name:
"**" + currGun.gunname + "** has the following attachment types:",
value:
"```\n" +
availableAttachmentTypes.map(x => at[x - 1]).join(",\n") +
"```",
},
],
footer: {
text: "All the stats courtesy of Project Lighthouse",
icon_url:
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
},
};
}
}
// console.log(attachments("Peacekeeper:muzzle")); //common.makeError();
/* console.log(attachments(":")); //common.makeError();
console.log(attachments("47:optics")); //common.makeError();
console.log(attachments("47")); //common.makeError();
console.log(attachments("47 + ")); //common.makeError();
console.log(attachments("47 + :")); //common.makeError();
console.log(attachments("47 + red dot")); common.makeError();*/

196
command/CODM/perk.js Normal file
View file

@ -0,0 +1,196 @@
const { MessageEmbed } = require("discord.js");
const { CODMClient } = require("cath");
const c = new CODMClient("Gae");
module.exports = {
name: "perk",
description: "Get perk stats",
type: "CHAT_INPUT",
usage: "{Perk}",
category: "CODM",
options: [
{
type: "SUB_COMMAND",
name: "red",
description: "Red Perk",
options: [
{
type: 3,
name: "perk",
description: "Perk",
required: true,
choices: [
{
name: "Fast Recover",
value: "fastrecover",
},
{
name: "Persistence",
value: "persistence",
},
{
name: "Flak Jacket",
value: "flakjacket",
},
{
name: "Skulker",
value: "skulker",
},
{
name: "Agile",
value: "agile",
},
{
name: "Lightweight",
value: "lightweight",
},
{
name: "Restock",
value: "restock",
},
{
name: "Tactician",
value: "tactician",
},
{
name: "Overclock",
value: "overclock",
},
{
name: "Martydom",
value: "martydom",
},
{
name: "Iron Lungs",
value: "ironlungs",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "green",
description: "Green Perk",
options: [
{
type: 3,
name: "perk",
description: "Perk",
required: true,
choices: [
{
name: "Vulture",
value: "vulture",
},
{
name: "Toughness",
value: "toughness",
},
{
name: "Tracker",
value: "tracker",
},
{
name: "Ghost",
value: "ghost",
},
{
name: "Cold Blooded",
value: "coldblooded",
},
{
name: "Hardwired",
value: "hardwired",
},
{
name: "Quick Fix",
value: "quickfix",
},
{
name: "Amped",
value: "amped",
},
{
name: "Recon",
value: "recon",
},
{
name: "Gung Ho",
value: "gungho",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "blue",
description: "Blue Perk",
options: [
{
type: 3,
name: "perk",
description: "Perk",
required: true,
choices: [
{
name: "Hardline",
value: "hardline",
},
{
name: "Demo Expert",
value: "demoexpert",
},
{
name: "Tactical Mask",
value: "tacticalmask",
},
{
name: "Alert",
value: "alert",
},
{
name: "Engineer",
value: "engineer",
},
{
name: "Dead Silence",
value: "deadsilence",
},
{
name: "Shrapnel",
value: "shrapnel",
},
{
name: "High Alert",
value: "highalert",
},
{
name: "Launcher Plus",
value: "launcherplus",
},
],
},
],
},
],
run: async (client, interaction, args) => {
const val = args[1];
const d = await c.getperk(val);
const embed = new MessageEmbed()
.setColor(
d.type == "green"
? "09654a"
: d.type == "red"
? "8a0a0a"
: d.type == "blue"
? "1047a4"
: client.color
)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setTitle(d.perk)
.addField("Effects", d.effects);
interaction.followUp({ embeds: [embed] });
},
};

119
command/CODM/sgrelo.js Normal file
View file

@ -0,0 +1,119 @@
module.exports = {
name: "sgrelo",
description: "Calculate reload time for shotgun",
options: [
{
type: 7,
name: "gun",
description: "Gun name",
required: true,
},
],
run: async (client, interaction, args) => {
let err = "",
wrn = "",
interpretedAs = [];
function mather(inp) {
const inpArr = interpreter(inp),
outArr = [];
inpArr.map((x, i, a) => {
for (let j = i + 1; j < a.length; j++) {
outArr.push(worker(x, a[j]));
}
});
const aArr = outArr.map(x => x.a),
iArr = outArr.map(x => x.i);
return (
"Input: `" +
interpretedAs.join("`, `") +
"`" +
(aArr.length == 1
? "\nOpening and Closing Animation Time: " +
beautifier(aArr[0]) +
"\nReload Time: " +
beautifier(iArr[0])
: "\nAll Opening and Closing Animation Time: " +
aArr.map(x => beautifier(x)).join(", ") +
"\nAll Reload Time: " +
iArr.map(x => beautifier(x)).join(", ") +
"\nAverage Opening and Closing Animation Time: " +
beautifier(aArr.reduce((t, x) => t + x, 0) / aArr.length) +
"\nAverage Reload Time: " +
beautifier(iArr.reduce((t, x) => t + x, 0) / iArr.length))
);
}
function interpreter(inp) {
let out = [
...new Set(
inp
.split(/\n|, |,/g)
.filter(x => x)
.map(x => x.toLowerCase().replace(/[^0-9a-z]/g, ""))
),
];
out = out
.map(x => {
interpretedAs.push(x);
const obj = {
b: 0,
f: 0,
};
if (
x.split(/b/g).length > 2 ||
x.split(/f/g).length > 2 ||
x.split(/[a-z]/g).length > 3
) {
err += "Unknown identifier `" + x + "`\n";
} else if (x.indexOf("b") === -1 || x.indexOf("f") === -1) {
err += "Missing identifier `" + x + "`\n";
} else if (x.indexOf("b") === x.length - 1) {
obj.b = parseFloat(x.split("f")[1].trim());
obj.f = parseFloat(x.split("f")[0].trim());
} else if (x.indexOf("f") === x.length - 1) {
obj.b = parseFloat(x.split("b")[0].trim());
obj.f = parseFloat(x.split("b")[1].trim());
} else {
err += "Unknown identifier `" + x + "`\n";
}
if (!obj.b && obj.f) {
err += "Couldn't interpret `" + x + "`\n";
} else if (!Number.isInteger(obj.b)) {
err += "Decimal bullet count found `" + x + "`\n";
} else if (!Number.isInteger(obj.f)) {
wrn += "Decimal value found `" + x + "`\n";
}
return obj;
})
.filter(x => JSON.stringify(x).length && x);
if (out.length === 1) {
err += "Single equation found\n";
}
return err || !out.length ? [] : out;
}
function worker(o1, o2) {
const out = {
i: 0,
a: 0,
};
out.i = (o1.f - o2.f) / (o1.b - o2.b);
out.a = o1.f - out.i * o1.b;
return out;
}
function beautifier(num) {
return parseFloat(num.toFixed(2)).toString() + "s";
}
const msg = mather(args[0]);
if (err !== "") {
interaction.followUp(err);
} else if (wrn !== "") {
interaction.followUp({ content: wrn + "\n" + msg });
} else {
interaction.followUp({ content: msg });
}
},
};

302
command/CODM/stats.js Normal file
View file

@ -0,0 +1,302 @@
const common = require("../../util/functions/common");
const data = require("../../util/Data/data.json");
const Discord = require("discord.js");
let currGun,
currStats,
currAttachments,
currRecoilArr,
currDRM,
interpretion,
recoilAvailable,
chart,
hasError;
const errMsg = "*Generic placeholder error message*";
module.exports = {
name: "stats",
description: "Check gun stats",
usage: "(Gun)",
category: "CODM",
options: [
{
type: 3,
name: "gun_name",
description: "Name of the gun",
required: true,
choices: [],
},
{
type: 3,
name: "1st_attchment",
description: "First attachment",
},
{
type: 3,
name: "2nd_attchment",
description: "Second attachment",
},
{
type: 3,
name: "3rd_attchment",
description: "Third attachment",
},
{
type: 3,
name: "4th_attchment",
description: "Forth attachment",
},
{
type: 3,
name: "5th_attchment",
description: "Fifth attachment",
},
],
run: async (client, interaction, args) => {
recoilAvailable = false;
hasError = false;
console.log(args);
const repEmb = statsHandler(args.join(" ").replace("\n", " "));
if (hasError) {
interaction.followUp({ embeds: [repEmb] });
}
if (recoilAvailable) {
repEmb.fields.push({
name: "**Recoil Graph**",
value:
"```\nThe Recoil graph below is dynamic (change based on attachment equipped)```",
});
const recoilImageLink = await chart.getShortUrl();
repEmb.image = { url: recoilImageLink };
}
interaction.followUp({ embeds: [repEmb] });
},
};
function inpHandler(inpmsg) {
statsHandler(inpmsg.split("+")[0]);
}
function statsHandler(inpmsg) {
let statsNames = [
"Pellets",
"Detonation Range",
"Explosion Radius",
"Explosion Damage",
"Firing Mode",
"Rate of Fire",
"Bullet in Burst",
"Time Between Burst",
"Bullet Speed",
"Penetration Level",
"Bullet Spread",
"Idle Sway",
"Hipfire Pellet Spread",
"ADS Pellet Spread",
"ADS Time",
"Sprint-to-Fire Time",
"ADS Zoom",
"Magazine",
"Reserve",
"Reload Type",
"Cancel Reload Time",
"Reload Time",
"Full Reload Time",
"Drop Time",
"Raise Time",
"Sprinting Speed",
"Walking Speed",
"Straifing Speed",
"Damage per Tick",
"Number of Ticks",
"Time Between Ticks",
"Breath Hold Time",
"shouldNeverHappen0",
"shouldNeverHappen1",
"shouldNeverHappen2",
"shouldNeverHappen3",
"shouldNeverHappen4",
],
out = [];
currGun = common.weaponIdentifier(inpmsg);
if (typeof currGun == "string") {
hasError = true;
return currGun;
}
currStats = currGun.stats;
currDRM = currGun.drm[0];
currAttachments = [];
currAttachments = common.attachmentsIdentifier(
inpmsg,
currGun.aments,
currStats
);
if (typeof currAttachments == "string") {
hasError = true;
return currAttachments;
}
currRecoilArr = [1, 1, currGun.stats[17]];
if (currAttachments.length != 0) {
const totalEffects = common.totaler(currAttachments);
currStats = common.updateStatswithEffects(totalEffects, currStats);
currRecoilArr = [totalEffects[2], totalEffects[3], currGun.stats[17]]; // must happen after currStats update
currDRM = currGun.drm[totalEffects[37]];
currDRM.range = currDRM.range.map(x =>
Math.round(x * (1 + totalEffects[13] / 100))
);
out = common.attachmentHandler(totalEffects, currStats);
}
function statsWorker() {
if (currStats[19] === 2) {
currStats[21] =
currStats[20] + currStats[21] * currStats[17] + currStats[22];
currStats[20] = 0;
currStats[22] = 0;
}
currStats[25] = (currStats[25] * currStats[26]) / 100;
const outReady = currStats.map((x, i) =>
x ? statsNames[i].padEnd(24) + ":".padEnd(3) + beautifier(i) : ""
);
out = [
...[
"Basic Stats",
"ADS Stats",
"Bullet Stats",
"Magazine",
"Handling Stats",
"Mobility Stats",
"Miscellaneous Stats",
].map((x, i) =>
fieldMaker(
x,
[
[04, 05, 09],
[14, 16, 11, 31],
[00, 06, 07, 08, 10, 12, 13],
[17, 18, 19, 20, 21, 22],
[23, 24],
[25, 26, 27, 15],
[28, 29, 30, 01, 02, 03],
][i]
)
),
...out,
];
function fieldMaker(inpName, inpIndx) {
inpIndx = inpIndx.filter(x => outReady[x]);
return inpIndx.length
? {
name: "**" + inpName + "**",
value: "```\n" + inpIndx.map(x => outReady[x]).join("\n") + "```",
}
: "";
}
}
statsWorker();
function beautifier(j) {
switch (j) {
case 04:
return data.firingModes[currStats[j] - 1];
case 09:
return data.penetrationLevels[currStats[j] - 1];
case 19:
return data.reloadTypes[currStats[j] - 1];
case 08:
if (currStats[j] == -1) {
return "Infinity";
} else {
return parseFloat(currStats[j].toFixed(2)).toString() + " m/s";
}
case 03:
return parseFloat(currStats[j].toFixed(2))
.toString()
.replace(".", " ~ ");
default:
return parseFloat(currStats[j].toFixed(2)).toString() + addUnit(j);
}
function addUnit(j) {
switch (j) {
case 07:
case 14:
case 15:
case 23:
case 24:
case 31:
return " ms";
case 27:
case 28:
case 25:
case 26:
return " m/s";
case 20:
case 21:
case 22:
return " s";
case 16:
return "%";
case 06:
return " Rounds";
case 05:
return " RPM";
default:
return "";
}
}
}
interpretion = currGun.gunname + common.interpretioner(currAttachments);
if (currGun.recoil.hr.length > 2) {
chart = common.recoilHandler(
currGun.recoil.hr,
currGun.recoil.vr,
currRecoilArr[0],
currRecoilArr[1],
currRecoilArr[2]
);
recoilAvailable = true;
} else {
recoilAvailable = false;
}
if (chart == "none") {
recoilAvailable = false;
}
if (chart == "err" || currAttachments == "err") {
hasError = true;
return "Cocaineeee";
}
const dmg =
common.damageHandler(
currDRM.damage,
currDRM.range,
1,
100,
60000 / currStats[5],
currStats[7],
currStats[6],
currStats[0]
) || "```This should never happen```";
out = [
currGun.description
? {
name: "**Description:**",
value: "```\n" + currGun.description + "```",
}
: {},
{ name: "**Damage Profile:**", value: dmg },
...out,
];
out = out.filter(x => x.value);
return {
title: interpretion,
color: 5814783,
fields: out,
footer: {
text: "[OUTDATED] All data courtesy of Project Lighthouse 2.0 and CoDM Research Crew",
icon_url:
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
},
};
}

View file

@ -12,21 +12,23 @@ module.exports = {
required: true,
},
],
run: async (client, interaction, args) => {
run: async (client, interaction) => {
try {
console.log(interaction.options.getBoolean("choice"));
const user = await client.data.getUser(interaction.user.id);
const guild = await client.data.getGuild(interaction.guild.id);
if (interaction.options.getBoolean("choice") == true) {
if (guild.Premium == true) {
return client.serr(interaction, "Config", "premium", 506);
interaction.followUp({ content: "This server is already premium" });
}
if (
(user.Tier == 1 && user.PremiumServers.length >= 5) ||
(user.Tier == 2 && user.PremiumServers.length >= 2) ||
(user.Tier == 3 && user.PremiumServers.length >= 0)
) {
return client.serr(interaction, "Config", "premium", 505);
interaction.followUp({
content:
"You have already reached the maximum amount of premium servers",
});
} else {
await client.data.setPremium(interaction.guild.id, "true");
await client.data.pushGuild(
@ -50,7 +52,7 @@ module.exports = {
),
],
});
client.channels.cache.get(client.ServerLog).send({
client.channels.cache.get(client.config.ServerLog).send({
embeds: [
new MessageEmbed()
.setTitle("New Premium Server")
@ -68,11 +70,14 @@ module.exports = {
}
} else {
if (guild.Premium == false) {
return client.serr(interaction, "Config", "premium", 507);
interaction.followUp({ content: "This server isn't premium yet" });
}
if (!user.PremiumServers.includes(interaction.guild.id))
return client.serr(interaction, "Config", "premium", 509);
else {
if (!user.PremiumServers.includes(interaction.guild.id)) {
interaction.followUp({
content:
"You can't remove due to you aren't the person who made the server premium",
});
} else {
await client.data.setPremium(interaction.guild.id, "false");
await client.data.pushGuild(
interaction.user.id,
@ -94,7 +99,7 @@ module.exports = {
),
],
});
client.channels.cache.get(client.ServerLog).send({
client.channels.cache.get(client.config.ServerLog).send({
embeds: [
new MessageEmbed()
.setTitle("Premium Server Removed")
@ -113,7 +118,7 @@ module.exports = {
}
} catch (e) {
console.log(e);
return client.serr(interaction, "Config", "premium", 999);
interaction.followUp({ content: `**Error**: ${e.message}` });
}
},
};

View file

@ -1,220 +0,0 @@
const starboardClient = require("../../client/StarboardClient");
module.exports = {
name: "set",
description: "Configure settings for the server",
UserPerms: ["ADMINISTRATOR"],
category: "Config",
options: [
{
type: 1,
name: "muterole",
description: "Set mute role for the server",
options: [
{
type: 8,
name: "role",
description: "The role for muted users",
required: true,
},
],
},
{
type: 1,
name: "prefix",
description: "Set prefix for the server",
options: [
{
type: 3,
name: "prefix",
description: "The prefix for the server",
required: true,
choices: [],
},
],
},
{
type: 1,
name: "welcome",
description: "Set welcome channel for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for welcome messages",
required: true,
},
],
},
{
type: 1,
name: "goodbye",
description: "Set goodbye channel for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for goodbye messages",
required: true,
},
],
},
{
type: 1,
name: "starboard",
description: "Set starboard channel for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for starboard messages",
required: true,
},
{
type: 4,
name: "starcount",
description: "The required amount of star to trigger the starboard",
required: true,
},
],
},
{
type: 1,
name: "chatbot",
description: "Set chatbot channel for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for chatbot messages",
required: true,
},
],
},
{
type: 1,
name: "log",
description: "Set log channel for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for log messages",
required: true,
},
],
},
{
type: 1,
name: "level",
description: "Set whether level system is activated for the server",
options: [
{
type: 5,
name: "choice",
description: "whether level system is activated for the server",
required: true,
},
],
},
],
run: async (client, interaction, args) => {
if (args[0].toLowerCase() === "muterole") {
const role = interaction.guild.roles.cache.get(args[1]);
if (role.managed) {
interaction.followUp({ content: "You must provide a non bot role" });
} else {
await client.data.setMuterole(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${role.name}** as the mute role`,
});
}
} else if (args[0].toLowerCase() === "prefix") {
await client.data.setPrefix(interaction.guild.id, args[1]);
interaction.followUp({ content: `Saved \`${args[1]}\` as the prefix` });
} else if (args[0].toLowerCase() === "welcome") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT")
interaction.followUp({ content: "Please provide a text channel" });
else {
await client.data.setWelcome(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the welcome channel`,
});
}
} else if (args[0].toLowerCase() === "goodbye") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT")
interaction.followUp({ content: "Please provide a text channel" });
else {
await client.data.setGoodbye(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the goodbye channel`,
});
}
} else if (args[0].toLowerCase() === "starboard") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT")
interaction.followUp({ content: "Please provide a text channel" });
else {
starboardClient.config.guilds.add({
id: interaction.guild.id,
options: {
starCount: args[2],
starboardChannel: args[1],
},
});
await client.data.setStarboard(interaction.guild.id, args[1], args[2]);
interaction.followUp({
content: `Saved **${channel}** as the starboard channel`,
});
}
} else if (args[0].toLowerCase() === "chatbot") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT")
interaction.followUp({ content: "Please provide a text channel" });
else {
await client.data.setChatbot(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the chatbot channel`,
});
}
} else if (args[0].toLowerCase() === "log") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT")
interaction.followUp({ content: "Please provide a text channel" });
else {
let webhookid;
let webhooktoken;
await channel
.createWebhook(interaction.guild.name, {
avatar: interaction.guild.iconURL({ format: "png" }),
})
.then(webhook => {
webhookid = webhook.id;
webhooktoken = webhook.token;
});
await client.data.setLog(
interaction.guild.id,
channel.id,
webhookid,
webhooktoken
);
interaction.followUp({
content: `Saved **${channel}** as the log channel`,
});
}
} else if (args[0].toLowerCase() === "level") {
if (args[1]) {
await client.data.setGLevel(interaction.guild.id, "true");
interaction.followUp({
content: `Levelling is enabled in this server now.`,
});
} else {
await client.data.setGLevel(interaction.guild.id, "false");
interaction.followUp({
content: `Levelling is disabled in this server now.`,
});
}
}
},
};

537
command/Config/settings.js Normal file
View file

@ -0,0 +1,537 @@
const starboardClient = require("../../client/StarboardClient");
const { MessageEmbed } = require("discord.js");
const fs = require("fs");
module.exports = {
name: "settings",
description: "Configure settings for the server",
UserPerms: ["ADMINISTRATOR"],
category: "Config",
options: [
{
type: 1,
name: "muterole",
description: "Configure mute role settings for the server",
options: [
{
type: 8,
name: "role",
description: "The role for muted users",
required: true,
},
],
},
{
type: 1,
name: "prefix",
description: "Configure prefix settings for the server",
options: [
{
type: 3,
name: "prefix",
description: "The prefix for the server",
required: true,
choices: [],
},
],
},
{
type: 1,
name: "welcome",
description: "Configure welcome channel settings for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for welcome messages",
required: true,
channelTypes: ["GUILD_TEXT"],
},
],
},
{
type: 1,
name: "goodbye",
description: "Configure goodbye channel settings for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for goodbye messages",
required: true,
channelTypes: ["GUILD_TEXT"],
},
],
},
{
type: 1,
name: "starboard",
description: "Configure starboard channel settings for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for starboard messages",
required: true,
channelTypes: ["GUILD_TEXT"],
},
{
type: 4,
name: "starcount",
description: "The required amount of star to trigger the starboard",
required: true,
},
],
},
{
type: 1,
name: "chatbot",
description: "Configure chatbot channel settings for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for chatbotmessages",
required: true,
channelTypes: ["GUILD_TEXT"],
},
],
},
{
type: 1,
name: "log",
description: "Configure log channel settings for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for log messages",
required: true,
channelTypes: ["GUILD_TEXT"],
},
],
},
{
type: 2,
name: "enable",
description: "Enable commands/category for the server",
options: [
{
type: 1,
name: "command",
description: "To enable commands",
options: [
{
type: 3,
name: "name",
description: "The command name to be enabled",
required: true,
},
],
},
{
type: 1,
name: "category",
description: "To enable categories",
options: [
{
type: 3,
name: "name",
description: "The category name to be enabled",
required: true,
choices: [
{
name: "codm",
value: "CODM",
},
{
name: "config",
value: "Config",
},
{
name: "economy",
value: "Economy",
},
{
name: "fun",
value: "Fun",
},
{
name: "information",
value: "Information",
},
{
name: "moderation",
value: "Moderation",
},
{
name: "utilities",
value: "Utilities",
},
],
},
],
},
],
},
{
type: 2,
name: "disable",
description: "Disable commands/category for the server",
options: [
{
type: 1,
name: "command",
description: "To disable commands",
options: [
{
type: 3,
name: "name",
description: "The command name to be disabled",
required: true,
},
],
},
{
type: 1,
name: "category",
description: "To disable categories",
options: [
{
type: 3,
name: "name",
description: "The category name to be disabled",
required: true,
choices: [
{
name: "codm",
value: "CODM",
},
{
name: "config",
value: "Config",
},
{
name: "economy",
value: "Economy",
},
{
name: "fun",
value: "Fun",
},
{
name: "information",
value: "Information",
},
{
name: "moderation",
value: "Moderation",
},
{
name: "utilities",
value: "Utilities",
},
],
},
],
},
],
},
{
type: 1,
name: "level",
description: "Configure level settings for the server",
options: [
{
type: 5,
name: "choice",
description: "Set whether level system is activated for the server",
required: true,
},
],
},
{
type: 1,
name: "nsfw",
description: "Configure nsfw settings for the server",
options: [
{
type: 5,
name: "choice",
description: "Set whether NSFW commands are activated for the server",
required: true,
},
],
},
{
type: 1,
name: "tips",
description: "Configure tips settings for the server",
options: [
{
type: 5,
name: "choice",
description: "Set whether tips system is activated for the server",
required: true,
},
],
},
{
type: 1,
name: "overall",
description: "See overall settings for the server",
options: [],
},
],
run: async (client, interaction, args, utils, data) => {
if (args[0].toLowerCase() === "muterole") {
const role = interaction.guild.roles.cache.get(args[1]);
if (role.managed) {
interaction.followUp({ content: "You must provide a non bot role" });
} else {
await client.data.setMuterole(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${role.name}** as the mute role`,
});
}
} else if (args[0].toLowerCase() === "prefix") {
await client.data.setPrefix(interaction.guild.id, args[1]);
interaction.followUp({ content: `Saved \`${args[2]}\` as the prefix` });
} else if (args[0].toLowerCase() === "welcome") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
await client.data.setWelcome(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the welcome channel`,
});
}
} else if (args[0].toLowerCase() === "goodbye") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
await client.data.setGoodbye(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the goodbye channel`,
});
}
} else if (args[0].toLowerCase() === "starboard") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
starboardClient.config.guilds.add({
id: interaction.guild.id,
options: {
starCount: args[2],
starboardChannel: args[1],
},
});
await client.data.setStarboard(interaction.guild.id, args[1], args[2]);
interaction.followUp({
content: `Saved **${channel}** as the starboard channel`,
});
}
} else if (args[0].toLowerCase() === "chatbot") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
await client.data.setChatbot(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the chatbot channel`,
});
}
} else if (args[0].toLowerCase() === "log") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
let webhookid;
let webhooktoken;
await channel
.createWebhook(interaction.guild.name, {
avatar: interaction.guild.iconURL({ format: "png" }),
})
.then(webhook => {
webhookid = webhook.id;
webhooktoken = webhook.token;
});
await client.data.setLog(
interaction.guild.id,
channel.id,
webhookid,
webhooktoken
);
interaction.followUp({
content: `Saved **${channel}** as the log channel`,
});
}
} else if (args[0].toLowerCase() === "level") {
if (args[1]) {
await client.data.setGLevel(interaction.guild.id, "true");
interaction.followUp({
content: `Levelling is enabled in this server now.`,
});
} else {
await client.data.setGLevel(interaction.guild.id, "false");
interaction.followUp({
content: `Levelling is disabled in this server now.`,
});
}
} else if (args[0].toLowerCase() === "nsfw") {
if (args[1]) {
await client.data.setNSFW(interaction.guild.id, "true");
interaction.followUp({
content: `NSFW is enabled in this server now.`,
});
} else {
await client.data.setNSFW(interaction.guild.id, "false");
interaction.followUp({
content: `NSFW is disabled in this server now.`,
});
}
} else if (args[0].toLowerCase() === "tips") {
if (args[1]) {
await client.data.setTips(interaction.guild.id, "true");
interaction.followUp({
content: `Tips is enabled in this server now.`,
});
} else {
await client.data.setTips(interaction.guild.id, "false");
interaction.followUp({
content: `Tips is disabled in this server now.`,
});
}
} else if (args[0].toLowerCase() === "enable") {
const type = args[1].toLowerCase();
const name = args[2].toLowerCase();
if (type === "command") {
if (!!client.slashCommands.get(name) === false) {
interaction.followUp({
content: `There isn't any command/category named \`${name}\``,
});
} else if (!data.Guild.Commands.includes(name)) {
interaction.followUp({
content: `\`${args[2]}\` command had already been enabled`,
});
} else if (
data.Guild.Commands.includes(name) &&
!!client.slashCommands.get(name) === true
) {
await client.data.enable(interaction.guild.id, "command", name);
interaction.followUp({
content: `\`${args[2]}\` command is now enabled`,
});
}
}
if (type === "category") {
const category = fs.readdirSync("./command");
if (!data.Guild.Category.includes(args[2])) {
interaction.followUp({
content: `\`${args[2]}\` category had already been enabled`,
});
}
if (
data.Guild.Category.includes(args[2]) &&
category.includes(args[2])
) {
await client.data.enable(interaction.guild.id, "category", args[2]);
interaction.followUp({
content: `\`${args[2]}\` category is now enabled`,
});
}
}
} else if (args[0].toLowerCase() === "disable") {
const type = args[1].toLowerCase();
const name = args[2].toLowerCase();
if (type === "command") {
if (!!client.slashCommands.get(name) === false) {
interaction.followUp({
content: `There isn't any command/category named \`${name}\``,
});
} else if (data.Guild.Commands.includes(name)) {
interaction.followUp({
content: `\`${args[2]}\` command had already been disabled`,
});
} else if (
!data.Guild.Commands.includes(name) &&
!!client.slashCommands.get(name) === true
) {
await client.data.disable(interaction.guild.id, "command", name);
interaction.followUp({
content: `\`${args[2]}\` command is now disabled`,
});
}
}
if (type === "category") {
const category = fs.readdirSync("./command");
if (data.Guild.Category.includes(args[2])) {
interaction.followUp({
content: `\`${args[2]}\` category had already been disabled`,
});
}
if (
!data.Guild.Category.includes(args[2]) &&
category.includes(args[2])
) {
await client.data.disable(interaction.guild.id, "category", args[2]);
interaction.followUp({
content: `\`${args[2]}\` category is now disabled`,
});
}
}
} else {
const d = `
**Mute Role**: ${
interaction.guild.roles.cache.get(data.Guild.Muterole)
? interaction.guild.roles.cache.get(data.Guild.Muterole)
: "None"
}
**Prefix**: ${data.Guild.Prefix ? data.Guild.Prefix : "C."}
**Welcome Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Welcome)
? interaction.guild.channels.cache.get(data.Guild.Welcome)
: "None"
}
**Goodbye Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Goodbye)
? interaction.guild.channels.cache.get(data.Guild.Goodbye)
: "None"
}
**Starboard Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Starboard)
? interaction.guild.channels.cache.get(data.Guild.Starboard)
: "None"
}
**Chatbot Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Chatbot)
? interaction.guild.channels.cache.get(data.Guild.Chatbot)
: "None"
}
**Log Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Log)
? interaction.guild.channels.cache.get(data.Guild.Log)
: "None"
}
**Level**: ${data.Guild.Level ? "Enable" : "Disabled"}
**NSFW**: ${data.Guild.NSFW ? "Enable" : "Disabled"}
**Tips**: ${data.Guild.Tips ? "Enable" : "Disabled"}
**Disabled Commands**: ${
data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None"
}
**Disabled Categories**: ${
data.Guild.Category.length ? data.Guilds.Category.join(",") : "None"
}
`;
const embed = new MessageEmbed()
.setTitle(`**${interaction.guild.name}** Settings`)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setDescription(d);
interaction.followUp({ embeds: [embed] });
}
},
};

View file

@ -8,21 +8,22 @@ module.exports = {
{
type: 6,
name: "user",
description: "The user you want to hack",
required: true,
description: "The user you want to see",
required: false,
},
],
type: "CHAT_INPUT",
run: async (client, interaction, args) => {
const user = interaction.guild.members.cache.get(args[0]);
const user =
interaction.guild.members.cache.get(args[0]) || interaction.member;
const bal = await client.bal(user.id);
let embed = new MessageEmbed()
.addField(`${client.currency} Balance`, `**${bal}**`)
const embed = new MessageEmbed()
.setTitle(`${user.displayName}'s Balance`)
.setDescription(`**${bal}** ${client.currency}`)
.setColor(client.color)
.setURL(client.web)
.setTitle(`${user.displayName}'s Balance`)
.setTimestamp()
.setFooter(`Requested by ${client.author}`);
await interaction.followUp({ embeds: [embed] });
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL());
interaction.followUp({ embeds: [embed] });
},
};

View file

@ -1,53 +1,81 @@
const { MessageEmbed } = require("discord.js");
const { bool } = require("cath");
module.exports = {
name: "gamble",
name: "bet",
usage: "(Number)",
timeout: 5000,
description: "Win double amount of coins or lose all coins",
category: "Economy",
options: [
{
type: 10,
type: 4,
name: "cp",
description: "The number of CP you want to bet",
required: true,
},
],
run: async (client, interaction, args, utils, data) => {
const max = 1000000;
const amt = args[0];
if ((await client.bal(interaction.user.id)) < amt) {
return client.serr(interaction, "Economy", "bet", 20);
}
if (amt > max) {
return client.serr(interaction, "Economy", "bet", 101);
}
if (utils.toBool() === true) {
const winamt = amt * 1;
run: async (client, interaction, args) => {
const max = 100000;
let amt = args[0];
if (amt > max) amt = max;
const winamt = amt * 2;
if (args[0] < 100) {
interaction.followUp({
content: `You need to bet at least 100${client.currency}`,
});
} else if ((await client.bal(interaction.user.id)) < amt) {
interaction.followUp({ content: "You don't have enough balance" });
} else if (bool()) {
const multi = (await client.multi(interaction)) / 10 + 1;
await client.add(interaction.user.id, winamt, interaction);
await client.ADDBWin(interaction.user.id);
const abc = new MessageEmbed()
.setColor("GREEN")
.setTimestamp()
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTitle(`${interaction.user.username} wins a gamble game`)
.setDescription(
`You win\n**${winamt}**${client.currency}\nYou now have **${
parseInt(await client.bal(interaction.user.id)) + amt
}**${client.currency}`
.addFields(
{
name: "Won",
value: `**${Math.round(winamt * multi)}**${client.currency}`,
inline: true,
},
{
name: "New Balance",
value: `**${Math.round(
(await client.bal(interaction.user.id)) + winamt * multi
)}**${client.currency}`,
inline: true,
},
{
name: "Multiplier",
value: `x${2 + multi}`,
inline: true,
}
);
await interaction.followUp({ embeds: [abc] });
interaction.followUp({ embeds: [abc] });
} else {
await client.rmv(interaction.user.id, amt);
const cba = new MessageEmbed()
.setColor("RED")
.setTimestamp()
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTitle(`${interaction.user.username} loses a gamble game`)
.setDescription(
`You lost\n**${amt}**${client.currency}\nYou now have **${
parseInt(await client.bal(interaction.user.id)) - amt
}**${client.currency}`
.addFields(
{
name: "Lost",
value: `**${amt}**${client.currency}`,
inline: true,
},
{
name: "New Balance",
value: `**${
parseInt(await client.bal(interaction.user.id)) - amt
}**${client.currency}`,
inline: true,
}
);
await interaction.followUp({ embeds: [cba] });
interaction.followUp({ embeds: [cba] });
}
},
};

View file

@ -0,0 +1,304 @@
const Discord = require("discord.js");
module.exports = {
name: "blackjack",
usage: "(Number)",
description: "Play a blackjack game to win money",
category: "Economy",
timeout: 10000,
options: [
{
type: 4,
name: "cp",
description: "The number of CP you want to give",
required: true,
},
],
run: async (client, interaction, args) => {
let money = args[0];
const max = 100000;
if (money > max) money = max;
const user = interaction.user;
if (money < 100) {
interaction.followUp({
content: `You need to blackjack at least 100 ${client.currency}`,
});
} else if ((await client.bal(user.id)) < money) {
interaction.followUp({ content: "You don't have enough balance" });
} else {
let numCardsPulled = 0;
let gameOver = false;
const player = {
cards: [],
score: 0,
};
const dealer = {
cards: [],
score: 0,
};
function getCardsValue(a) {
let cardArray = [],
sum = 0,
i = 0,
dk = 10.5,
doubleking = "QQ",
aceCount = 0;
cardArray = a;
for (i; i < cardArray.length; i += 1) {
if (
cardArray[i].rank === "J" ||
cardArray[i].rank === "Q" ||
cardArray[i].rank === "K"
) {
sum += 10;
} else if (cardArray[i].rank === "A") {
sum += 11;
aceCount += 1;
} else if (cardArray[i].rank === doubleking) {
sum += dk;
} else {
sum += cardArray[i].rank;
}
}
while (aceCount > 0 && sum > 21) {
sum -= 10;
aceCount -= 1;
}
return sum;
}
const deck = {
deckArray: [],
initialize: function () {
let suitArray, rankArray, s, r, n;
suitArray = ["b", "d", "g", "s"];
rankArray = [2, 3, 4, 5, 6, 7, 8, 9, 10, "J", "Q", "K", "A"];
n = 13;
for (s = 0; s < suitArray.length; s += 1) {
for (r = 0; r < rankArray.length; r += 1) {
this.deckArray[s * n + r] = {
rank: rankArray[r],
suit: suitArray[s],
};
}
}
},
shuffle: function () {
let temp, i, rnd;
for (i = 0; i < this.deckArray.length; i += 1) {
rnd = Math.floor(Math.random() * this.deckArray.length);
temp = this.deckArray[i];
this.deckArray[i] = this.deckArray[rnd];
this.deckArray[rnd] = temp;
}
},
};
deck.initialize();
deck.shuffle();
async function bet(outcome) {
if (outcome === "win") {
await client.add(user.id, money, interaction);
await client.ADDBJWin(interaction.user.id);
}
if (outcome === "lose") {
await client.rmv(user.id, money);
}
}
function endMsg(f, msg, cl, dealerC) {
let cardsMsg = "";
player.cards.forEach(function (card) {
const emAR = ["♥", "♦", "♠", "♣"];
const t = emAR[Math.floor(Math.random() * emAR.length)];
cardsMsg += "[`" + t + card.rank.toString();
if (card.suit == "d1") cardsMsg += "♥";
if (card.suit == "d2") cardsMsg += "♦";
if (card.suit == "d3") cardsMsg += "♠";
if (card.suit == "d4") cardsMsg += "♣";
cardsMsg += "`](https://cath.gq/) ";
});
cardsMsg += " > " + player.score.toString();
let dealerMsg = "";
if (!dealerC) {
const emAR = ["♥", "♦", "♠", "♣"];
const t = emAR[Math.floor(Math.random() * emAR.length)];
dealerMsg = "[`" + t + dealer.cards[0].rank.toString();
if (dealer.cards[0].suit == "d1") dealerMsg += "♥";
if (dealer.cards[0].suit == "d2") dealerMsg += "♦";
if (dealer.cards[0].suit == "d3") dealerMsg += "♠";
if (dealer.cards[0].suit == "d4") dealerMsg += "♣";
dealerMsg += " ? ?`](https://cath.gq/)";
} else {
dealerMsg = "";
dealer.cards.forEach(function (card) {
const emAR = ["♥", "♦", "♠", "♣"];
const t = emAR[Math.floor(Math.random() * emAR.length)];
dealerMsg += "[`" + t + card.rank.toString();
if (card.suit == "d1") dealerMsg += "♥";
if (card.suit == "d2") dealerMsg += "♦";
if (card.suit == "d3") dealerMsg += "♠";
if (card.suit == "d4") dealerMsg += "♣";
dealerMsg += "`](https://cath.gq/) ";
});
dealerMsg += " > " + dealer.score.toString();
}
const gambleEmbed = new Discord.MessageEmbed()
.setColor(cl || client.color)
.setTimestamp()
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTitle(interaction.user.username + `'s Blackjack game`)
.addField("You", cardsMsg, true)
.addField("NYX", dealerMsg, true)
.addField(f, msg);
interaction.followUp({ embeds: [gambleEmbed] });
}
async function endGame() {
if (player.score === 21) {
bet("win");
gameOver = true;
await endMsg(
`Win! You got 21!`,
`NYX had ${dealer.score.toString()}`,
`GREEN`
);
}
if (player.score > 21) {
bet("lose");
gameOver = true;
await endMsg(
`Lost! You reached over 21!`,
`NYX had ${dealer.score.toString()}`,
`RED`
);
}
if (dealer.score === 21) {
bet("lose");
gameOver = true;
await endMsg(
`Lost! The dealer got 21!`,
`NYX had ${dealer.score.toString()}`,
`RED`
);
}
if (dealer.score > 21) {
bet("win");
gameOver = true;
await endMsg(
`Win! NYX reached over 21!`,
`NYX had ${dealer.score.toString()}`,
`GREEN`
);
}
if (
dealer.score >= 17 &&
player.score > dealer.score &&
player.score < 21
) {
bet("win");
gameOver = true;
await endMsg(
`Win! You defeated NYX!`,
`NYX had ${dealer.score.toString()}`,
`GREEN`
);
}
if (
dealer.score >= 17 &&
player.score < dealer.score &&
dealer.score < 21
) {
bet("lose");
gameOver = true;
await endMsg(
`Lost! NYX won!`,
`NYX had ${dealer.score.toString()}`,
`RED`
);
}
if (
dealer.score >= 17 &&
player.score === dealer.score &&
dealer.score < 21
) {
gameOver = true;
await endMsg(`Tie!`, `NYX had ${dealer.score.toString()}`, `RED`);
}
}
function dealerDraw() {
dealer.cards.push(deck.deckArray[numCardsPulled]);
dealer.score = getCardsValue(dealer.cards);
numCardsPulled += 1;
}
function newGame() {
hit();
hit();
dealerDraw();
endGame();
}
function hit() {
player.cards.push(deck.deckArray[numCardsPulled]);
player.score = getCardsValue(player.cards);
numCardsPulled += 1;
if (numCardsPulled > 2) {
endGame();
}
}
function stand() {
while (dealer.score < 17) {
dealerDraw();
}
endGame();
}
newGame();
async function loop() {
if (gameOver) return;
endMsg(
"To hit type `h`, for stand type `s`",
`GoodLuck ;)`,
client.color
);
const filter = m => m.author.id === interaction.user.id;
interaction.channel
.awaitMessages({ filter, max: 1, time: 1200000, errors: ["time"] })
.then(interaction => {
interaction = interaction.first();
if (
interaction.content.toLowerCase() === "h" ||
interaction.content.toLowerCase() === "hit"
) {
hit();
loop();
return;
} else if (
interaction.content.toLowerCase() === "s" ||
interaction.content.toLowerCase() === "stand"
) {
stand();
loop();
return;
} else {
bet("lose");
endMsg("Invalid response", `You lost ${money}`, "RED");
return;
}
})
.catch(_ => {
interaction.channel.send({ content: "Lost!!" });
bet("lose");
return;
});
}
await loop();
}
},
};

103
command/Economy/buy.js Normal file
View file

@ -0,0 +1,103 @@
const { MessageEmbed } = require("discord.js");
const inventory = require("../../models/econ");
const items = require("../../util/Data/item.json");
module.exports = {
name: "buy",
usage: "(Item)",
description: "Buy something from the shop",
category: "Economy",
options: [
{
type: 3,
name: "item",
description: "The item to buy",
required: true,
},
{
type: 4,
name: "amount",
description: "The amount to buy",
required: true,
},
],
run: async (client, interaction, args) => {
const itemToBuy = args[0].toLowerCase();
const validItem = !!items.find(item => item.aliases.includes(itemToBuy));
const num = args[1];
if (num < 0) {
interaction.followUp({
content: `You need to buy at least 1 item`,
});
} else if (!validItem) {
interaction.followUp({
content:
"The item is not valid\nIf you want to get information about the item, use `/shop`",
});
} else {
const itemName = items.find(item =>
item.aliases.includes(itemToBuy)
).name;
const dbName = items.find(item =>
item.aliases.includes(itemToBuy)
).dbname;
const itemPrice = items.find(item =>
item.aliases.includes(itemToBuy)
).price;
const itemEmoji = items.find(item =>
item.aliases.includes(itemToBuy)
).emoji;
const buyable = items.find(item =>
item.aliases.includes(itemToBuy)
).buyable;
if ((await client.bal(interaction.user.id)) < itemPrice * num) {
interaction.followUp({ content: "You don't have enough balance" });
} else if (!buyable) {
interaction.followUp({ content: `That item isn't buyable` });
} else {
const params = { User: interaction.user.id };
inventory.findOne(params, async (err, data) => {
if (data) {
const hasItem = Object.keys(data.Inventory).includes(dbName);
if (!hasItem) {
data.Inventory[dbName] += num;
} else {
data.Inventory[dbName] += num;
}
await inventory.findOneAndUpdate(params, data);
} else {
new inventory({
User: interaction.user.id,
Inventory: {
[dbName]: num,
},
}).save();
}
});
interaction.followUp({
embeds: [
new MessageEmbed()
.setTimestamp()
.setDescription(
`**${
interaction.user.username
}** buys ** ${num} ${itemEmoji}${itemName}** for **${
itemPrice * num
}**${client.currency}`
)
.setColor("GREEN")
.setURL(client.web)
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
),
],
});
await client.rmv(interaction.user.id, itemPrice * num);
}
}
},
};

View file

@ -5,30 +5,27 @@ module.exports = {
category: "Economy",
timeout: 1000 * 60 * 60 * 24,
run: async (client, interaction, args) => {
var money;
let money;
const user = await client.data.getUser(interaction.user.id);
if (user) {
if (user.Premium == true) {
money = 20000;
let pre_embed = new MessageEmbed()
.setAuthor(
interaction.member.user.tag,
interaction.user.displayAvatarURL({ dyanmic: true })
)
const pre_embed = new MessageEmbed()
.setTitle(`${user.username}'s profile`)
.setDescription(
`**Here is your daily ${money}${client.currency}!\nThanks for supporting Cath!**`
`Here is your daily **${money}** ${client.currency}\nYou can use this again in 24hrs`
)
.setURL(client.web)
.setColor(client.color)
.setFooter(`Made by ${client.author}`)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
await client.add(interaction.user.id, money, interaction);
return await interaction.followUp({ embeds: [pre_embed] });
return interaction.followUp({ embeds: [pre_embed] });
} else {
money = 10000;
let norm_embed = new MessageEmbed()
const norm_embed = new MessageEmbed()
.setAuthor(
interaction.member.user.tag,
interaction.user.tag,
interaction.user.displayAvatarURL({ dyanmic: true })
)
.setDescription(
@ -36,10 +33,10 @@ module.exports = {
)
.setURL(client.web)
.setColor(client.color)
.setFooter(`Made by ${client.author}`)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
await client.add(interaction.user.id, money, interaction);
return await interaction.followUp({ embeds: [norm_embed] });
return interaction.followUp({ embeds: [norm_embed] });
}
}
},

View file

@ -1,44 +0,0 @@
module.exports = {
name: "drop",
usage: "{Channel} (Number)",
description: "Drops money to a channel",
category: "Economy",
options: [
{
type: 7,
name: "channel",
description: "The channel you want to drop",
required: true,
},
{
type: 4,
name: "cp",
description: "The amount of CP to drop",
required: true,
},
],
run: async (client, interaction, args) => {
const channel = interaction.guild.channels.cache.get(args[0]);
const coinsAmount = args[1];
if ((await client.bal(interaction.user.id)) < coinsAmount) {
return client.serr(interaction, "Economy", "drop", 20);
}
const filter = msg =>
msg.guild.id === interaction.guild.id && msg.content === `claim`;
interaction.followUp({
content: "The drop has started in " + channel.toString(),
});
channel.send({
content: `${interaction.user.username} has dropped a ${client.currency} bomb! Type \`claim\` to claim ${client.currency}!!`,
});
client.rmv(interaction.user.id, parseInt(coinsAmount));
channel.awaitMessages({ filter, max: 1, time: 60000 }).then(async msg => {
const id = msg.first().author.id;
const coinsToClaim = parseInt(coinsAmount);
await client.add(id, coinsToClaim, interaction);
msg.first().reply({
content: `Congratultions! You have claimed **${coinsToClaim}** ${client.currency}!`,
});
});
},
};

136
command/Economy/gift.js Normal file
View file

@ -0,0 +1,136 @@
const { MessageEmbed } = require("discord.js");
const inventory = require("../../models/econ");
const items = require("../../util/Data/item.json");
module.exports = {
name: "gift",
timeout: 5000,
usage: "(User) (Item)",
description: "Gift item to an user",
category: "Economy",
options: [
{
type: 6,
name: "user",
description: "The user you want to gift",
required: true,
},
{
type: 3,
name: "item",
description: "The item to gift",
required: true,
},
{
type: 4,
name: "amount",
description: "The amount to gift",
required: true,
},
],
run: async (client, interaction, args) => {
const user = interaction.guild.members.cache.get(args[0]);
if (user.id === interaction.user.id) {
interaction.followUp({ content: "You can't gift yourself items" });
}
const itemToGift = args[1].toLowerCase();
const number = args[2];
const validItem = !!items.find(item => item.aliases.includes(itemToGift));
if (number < 0) {
interaction.followUp({
content: `You need to gift at least 1 item`,
});
} else if (!validItem) {
interaction.followUp({
content:
"The item is not valid\nIf you want to get information about the item, use `/shop`",
});
} else {
const params = {
User: interaction.user.id,
};
const param = {
User: user.id,
};
const itemName = items.find(item =>
item.aliases.includes(itemToGift)
).name;
const dbName = items.find(item =>
item.aliases.includes(itemToGift)
).dbname;
const itemEmoji = items.find(item =>
item.aliases.includes(itemToGift)
).emoji;
inventory.findOne(params, async (err, data) => {
if (data.Inventory) {
const hasItem = Object.keys(data.Inventory).includes(dbName);
if (hasItem) {
if (data.Inventory[dbName] <= number) {
interaction.followUp({
content: `You don't have enough items to gift`,
});
} else {
data.Inventory[dbName] -= number;
interaction.followUp({
embeds: [
new MessageEmbed()
.setColor(client.color)
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.setTimestamp()
.setDescription(
`**${interaction.user.username}** has given **${
user.user.username
} ${number.toLocaleString()} ${itemEmoji}${itemName}**`
),
],
});
user
.send({
content: `**${
interaction.user.tag
}** has given you **${number.toLocaleString()} ${itemEmoji}${itemName}** in **${
interaction.guild.name
}**`,
})
.catch(e => {});
await inventory.findOneAndUpdate(params, data);
}
} else {
interaction.followUp({
content: `You don't have enough items to gift`,
});
}
} else {
interaction.followUp({
content: `You don't have enough items to gift`,
});
}
});
inventory.findOne(param, async (err, data) => {
if (data?.Inventory) {
const hasItem = Object.keys(data.Inventory).includes(dbName);
if (!hasItem) {
data.Inventory[dbName] += number;
} else {
data.Inventory[dbName] += number;
}
await inventory.findOneAndUpdate(param, data);
} else {
new inventory({
User: user.id,
CP: 0,
Inventory: {
[dbName]: number,
},
}).save();
}
});
}
},
};

72
command/Economy/give.js Normal file
View file

@ -0,0 +1,72 @@
const m = require("../../models/econ");
module.exports = {
name: "give",
timeout: 5000,
usage: "(User) (Number)",
description: "Give money to an user",
category: "Economy",
options: [
{
type: 6,
name: "user",
description: "The user you want to give",
required: true,
},
{
type: 4,
name: "cp",
description: "The number of CP you want to give",
required: true,
},
],
run: async (client, interaction, args) => {
const max = 300000;
const user = interaction.guild.members.cache.get(args[0]);
let parsed = args[1];
if (parsed > max) parsed = max;
if (parsed < 100) {
interaction.followUp({
content: `You need to give at least 100 ${client.currency}`,
});
} else if (user.id === interaction.user.id) {
interaction.followUp({ content: "You can't give yourself money" });
} else if (parsed > (await client.bal(interaction.user.id))) {
interaction.followUp({ content: "You don't have enough balance" });
} else {
m.findOne({ User: interaction.user.id }, async (err, data) => {
if (data) {
data.CP -= parsed;
data.save();
} else {
client.createProfile(interaction.user.id);
}
});
m.findOne({ User: user.id }, async (err, data) => {
if (data) {
data.CP += parsed;
data.save();
} else {
new m({ CP: parsed });
}
});
interaction.followUp({
content: `**${interaction.user.username}** gave **${
user.user.username
}** **${parsed.toLocaleString()}** coins, you now have **${(
(await client.bal(interaction.user.id)) - parsed
).toLocaleString()}** ${client.currency} and they have **${(
(await client.bal(user.id)) + parsed
).toLocaleString()}** ${client.currency}`,
});
user
.send({
content: `**${
interaction.user.tag
}** gave you **${parsed.toLocaleString()}** coins in **${
interaction.guild.name
}**`,
})
.catch();
}
},
};

120
command/Economy/gun.js Normal file
View file

@ -0,0 +1,120 @@
const { MessageEmbed } = require("discord.js");
const e = require("../../models/econ");
const list = require("../../util/Data/gun.json");
module.exports = {
name: "gun",
description: "Configure Weapon Master System settings",
options: [
{
type: 1,
name: "select",
description: "Select the gun for the game",
options: [
{
name: "gun",
description: "The gun you want to select",
type: 3,
required: true,
choices: [
{
name: "kuk69",
value: "kuku69",
},
{
name: "nani45",
value: "nani45",
},
],
},
],
},
{
type: 1,
name: "list",
description: "See the information for the guns",
options: [],
},
{
type: 1,
name: "info",
description: "See the stats of your gun",
},
],
run: async (client, interaction, args) => {
if (args[0] === "list") {
const lists = list.map(value => {
return `**${value.emoji} ${value.name}**\n**Description**: ${value.description}`;
});
const embed = new MessageEmbed()
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setDescription(lists.join("\n\n"));
interaction.followUp({ embeds: [embed] });
} else if (args[0] === "select") {
if (args[1] == "kuku69") {
await e.findOne({ User: interaction.user.id }, async (err, data) => {
if (!data) {
new e({
User: interaction.user.id,
Gun: {
Name: "kuku69",
Rank: "Iron",
Kills: 0,
XP: 0,
Level: 1,
},
});
} else {
data.Gun.Name = "kuku69";
await data.save();
}
});
interaction.followUp({ content: "**Your current gun:\nkuku69**" });
}
if (args[1] == "nani45") {
await e.findOne({ User: interaction.user.id }, async (err, data) => {
if (!data) {
new e({
User: interaction.user.id,
Gun: {
Name: "nani45",
Rank: "Iron",
Kills: 0,
XP: 0,
Level: 1,
},
});
} else {
data.Gun.Name = "nani45";
await data.save();
}
});
interaction.followUp({ content: "**Your current gun:\nnani45**" });
}
} else if (args[0] === "info") {
await e.findOne({ User: interaction.user.id }, async (err, data) => {
if (!data?.Gun.Name) {
interaction.followUp({
content:
"You don't have a gun yet! Please use `/gun select` to select your gun!",
});
} else {
const link = list.find(a => a.name === data.Gun.Name).link;
const embed = new MessageEmbed()
.setThumbnail(link)
.setTimestamp()
.setColor(client.color)
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.addField("Name", data.Gun.Name, true)
.addField("Rank", data.Gun.Rank, true)
.addField("XP", data.Gun.XP.toString(), true);
interaction.followUp({ embeds: [embed] });
}
});
}
},
};

View file

@ -1,6 +1,7 @@
const { MessageEmbed } = require("discord.js");
const inv = require("../../models/econ");
const util = require("../../util/pagination/pagination");
const { Pagination } = require("cath");
const items = require("../../util/Data/item.json");
module.exports = {
name: "inventory",
description: "Check the inventory of an user",
@ -15,21 +16,29 @@ module.exports = {
required: false,
},
],
run: async (client, interaction, args, data, utils) => {
run: async (client, interaction, args) => {
const util = new Pagination();
const user =
interaction.guild.members.cache.get(args[0]) || interaction.member;
inv.findOne({ User: user.id }, async (err, data) => {
if (data) {
if (!data.Inventory)
if (!data.Inventory) {
return interaction.followUp({
content: `User doesn't have any data`,
});
const mappedData = Object.keys(data.Inventory).map(key => {
if (data.Inventory[key] == 0) {
return;
}
return `\n**${key}** — ${data.Inventory[key]}`;
});
}
const mappedData = Object.keys(data.Inventory)
.map(key => {
if (data.Inventory[key] == 0) {
return;
} else {
const name = items.find(val => val.dbname === key).name;
const emoji = items.find(val => val.dbname === key).emoji;
const type = items.find(val => val.dbname === key).type;
return `\n**${emoji}${name}** — ${data.Inventory[key]}\n **Type**: \`${type}\``;
}
})
.filter(e => e !== undefined);
if (mappedData.length == 0) {
return interaction.followUp({
content: `User doesn't have any data`,
@ -44,13 +53,15 @@ module.exports = {
.setFooter(`Page 1 of ${c.length}`);
try {
const msg = await interaction.followUp({ embeds: [embed] });
if (mappedData.length > 5)
if (mappedData.length > 5) {
await util.pagination(msg, interaction.user, c);
}
} catch (e) {
console.log(e);
}
} else
} else {
return interaction.followUp({ content: `User doesn't have any data` });
}
});
},
};

View file

@ -1,37 +0,0 @@
const Levels = require("discord-xp");
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "leaderboard",
timeout: 5000,
description: "Check the leaderboard of a server",
category: "Economy",
Level: true,
run: async (client, interaction, args) => {
const rawLeaderboard = await Levels.fetchLeaderboard(
interaction.guild.id,
10
);
if (rawLeaderboard.length < 1)
return interaction.followUp({ content: "There isn't any data" });
const leaderboard = await Levels.computeLeaderboard(
client,
rawLeaderboard,
true
);
const lb = leaderboard.map(
e =>
`**${e.position}**. ${e.username}#${e.discriminator} Level: ${
e.level
} XP: ${e.xp.toLocaleString()}`
);
const embed = new MessageEmbed()
.setTitle(`**Leaderboard for ${interaction.guild.name}**`)
.setDescription(`\n${lb.join("\n")}`)
.setFooter(
`Requested by ${interaction.user.tag}`,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
},
};

View file

@ -0,0 +1,44 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "multiplier",
description: "Displaying your/user's multiplier.",
category: "Economy",
options: [
{
type: 6,
name: "user",
description: "The user you want to see",
required: false,
},
],
run: async (client, interaction, args) => {
let i = "";
let e = 0;
const user =
interaction.guild.members.cache.get(args[0]) || interaction.member;
const data = await client.data.getUser(
args[0] ? args[0] : interaction.member.id
);
if (data?.Premium) {
i += "\nPremium User - 25%\n";
e += 25;
}
if (client.path.includes(interaction.guild.id)) {
i += "NYX Partnered Server - 15%\n";
e += 15;
}
if (interaction.channel.name.toLowerCase().includes("nyx")) {
i += "Channel Name includes NYX - 10%\n";
e += 10;
}
const embed = new MessageEmbed()
.addField(`**Total Multiplier: ${e}%** (Maximum: 50%)`, i)
.setColor(client.color)
.setURL(client.web)
.setTitle(`${user.displayName}'s Multiplier`)
.setTimestamp()
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL());
interaction.followUp({ embeds: [embed] });
},
};

View file

@ -12,7 +12,7 @@ module.exports = {
required: false,
},
],
run: async (client, interaction, args, data, utils) => {
run: async (client, interaction, args) => {
const user =
interaction.guild.members.cache.get(args[0]) || interaction.member;
const bjwin = await client.bjWin(user.user.id);
@ -22,25 +22,28 @@ module.exports = {
const bal = await client.bal(user.user.id);
const multi = await client.multi(interaction);
const game = new MessageEmbed()
.setFooter(
`Requested by ${user.user.tag}`,
user.user.displayAvatarURL({ dynamic: true, size: 4096 })
)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setColor("7196ef")
.setTitle(`${user.displayName}'s profile`)
.addField(
"**Stats**\n",
`🃏 Blackjack wins: \`${bjwin}\`\n` +
`🎰 Slots wins: \`${swin}\`\n` +
`🕹 Bet wins: \`${bwin}\`\n` +
`Commands used: \`${cmdused}\`\n` +
`Totalwins: \`${bjwin + swin + bwin}\``,
true
)
.addField(
"**Balance**\n",
`💲CP: \`${bal}\`\n` + `Multiplier: \`${`1.${multi}x`}\``
.setDescription(`Current Balance ${bal} ${client.currency}`)
.setURL(client.web)
.addFields(
{
name: "Basic",
value: `
Total Commands Used \`${cmdused}\`\n
${client.xp} Multiplier \`${`1.${multi}x`}\``,
inline: true,
},
{
name: "🎊 Wins",
value: `Overall \`${bjwin + swin + bwin}\`
🃏 Blackjack \`${bjwin}\`\n
🎰 Slots \`${swin}\`\n
🕹 Bets \`${bwin}\`\n`,
inline: true,
}
);
await interaction.followUp({ embeds: [game] });
interaction.followUp({ embeds: [game] });
},
};

View file

@ -3,7 +3,8 @@ module.exports = {
name: "rich",
description: "Displaying top 10 richest users.",
category: "Economy",
run: async (client, interaction, args) => {
timeout: 4000,
run: async (client, interaction) => {
const collection = new Collection();
await Promise.all(
interaction.guild.members.cache.map(async member => {
@ -18,25 +19,26 @@ module.exports = {
: null;
})
);
if (!collection)
return await interaction.followUp({
if (!collection) {
return interaction.followUp({
content: `None of the members got ${client.currency}!`,
});
}
const ata = collection.sort((a, b) => b.bal - a.bal).first(10);
await interaction.followUp({
interaction.followUp({
embeds: [
new MessageEmbed()
.setTitle(`Richest users in ${interaction.guild.name}`)
.setDescription(
ata
.map((v, i) => {
return `${i + 1}: ${
return `**${i + 1}** ${
interaction.guild.members.cache.get(v.id).user.tag
} => **${v.bal}${client.currency}**`;
} = **${v.bal} ${client.currency}**`;
})
.join("\n")
)
.setFooter(`Made by ${client.author}`)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setColor(client.color),
],

View file

@ -1,28 +1,78 @@
const { MessageEmbed } = require("discord.js");
const util = require("../../util/pagination/pagination");
const items = require("../../util/dist/item");
const { Pagination } = require("cath");
const items = require("../../util/Data/item.json");
module.exports = {
name: "shop",
description: "Check the items from the shop",
category: "Economy",
run: async (client, interaction, args) => {
const list = items.map((value, index) => {
return `**${value.item}** — ${value.price.toLocaleString()}${
client.currency
}\nID: \`${value.id}\``;
});
const c = util.chunk(list, 5).map(x => x.join("\n\n"));
const embed = new MessageEmbed()
.setTitle("**cath.exe shop**")
.setTimestamp()
.setDescription(c[0])
.setColor(client.color)
.setFooter(`Page 1 of ${c.length}`);
try {
const msg = await interaction.followUp({ embeds: [embed] });
if (list.length > 5) await util.pagination(msg, interaction.user, c);
} catch (e) {
console.log(e);
options: [
{
type: 3,
name: "item",
description: "The item you want to see",
required: false,
},
],
run: async (client, interaction, args, utils, data) => {
if (!args[0]) {
const util = new Pagination();
const list = items.map(value => {
return `**${value.emoji} ${
value.name
} [${value.price.toLocaleString()} ${
client.currency
}](https://www.youtube.com/watch?v=YSKDu1gKntY)**\n\`Aliases:\` **${value.aliases.join(
", "
)}**\n\`Type:\` **${value.type}**`;
});
const c = util.chunk(list, 5).map(x => x.join("\n\n"));
const embed = new MessageEmbed()
.setTitle("**NYX Shop**")
.setTimestamp()
.setDescription(c[0])
.setColor(client.color)
.setFooter(`Page 1 of ${c.length}`);
try {
const msg = await interaction.followUp({ embeds: [embed] });
if (list.length > 5) await util.pagination(msg, interaction.user, c);
} catch (e) {
console.log(e);
}
} else {
const itemToSearch = args[0].toLowerCase();
const validItem = !!items.find(item =>
item.aliases.includes(itemToSearch)
);
if (!validItem) {
interaction.followUp({
content:
"The item is not valid\nIf you want to get information about the item, use `/shop`",
});
} else {
const theitem = items.find(i => i.aliases.includes(itemToSearch));
const all = new MessageEmbed()
.setTitle(`${theitem.emoji} ${theitem.name}`)
.setDescription(
`
**Owns** - ${
data.UserEcon.Inventory?.[theitem.dbname]
? data.UserEcon.Inventory?.[theitem.dbname]
: 0
}
**Cost Price** - ${client.currency} ${theitem.price}\n
**Sell Price** - ${client.currency} ${
theitem.sellable ? theitem.sell : "Unable to sell"
}\n
**Aliases** - \`${theitem.aliases.join(", ")}\`\n\n`
)
.setColor(client.color)
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL({ dynamic: true })
)
.setTimestamp();
interaction.followUp({ embeds: [all] });
}
}
},
};

View file

@ -7,14 +7,14 @@ module.exports = {
category: "Economy",
options: [
{
type: 10,
type: 4,
name: "cp",
description: "The number of CP you want to bet",
description: "The number of CP you want to slots",
required: true,
},
],
run: async (client, interaction, args) => {
const max = 1000000;
const max = 100000;
const slots = [
"<:blushca:852174555513618502>",
"<:abusecat:853501068074942464>",
@ -29,22 +29,28 @@ module.exports = {
const slotseven = slots[Math.floor(Math.random() * slots.length)];
const sloteight = slots[Math.floor(Math.random() * slots.length)];
const slotnine = slots[Math.floor(Math.random() * slots.length)];
const amt = args[0];
if (amt > max) return client.serr(interaction, "Economy", "bet", 101);
if ((await client.bal(interaction.user.id)) < amt) {
return client.serr(interaction, "Economy", "bet", 20);
}
if (
const ar = [1.3, 1.5, 1.7, 1.9, 2.1, 2.3, 2.5, 2.7, 2.9, 3.1, 3.3, 3.5];
const r = ar[Math.floor(Math.random() * ar.length)];
let amt = args[0];
if (amt > max) amt = max;
if (amt < 100) {
interaction.followUp({
content: `You need to slot at least 100${client.currency}`,
});
} else if ((await client.bal(interaction.user.id)) < amt) {
interaction.followUp({ content: "You don't have enough balance" });
} else if (
(slotOne === slotTwo && slotOne === slotThree) ||
(slotfour === slotfive && slotfour === slotsix) ||
(slotseven === sloteight && slotseven === slotnine)
) {
const winamt = Math.floor(Math.random() * 2 * amt);
const winamt = Math.round(r * amt);
const multi = (await client.multi(interaction)) / 10 + 1;
await client.add(interaction.user.id, winamt, interaction);
await client.ADDSWin(interaction.user.id);
const won = new MessageEmbed()
.setColor("GREEN")
.setFooter(`Made by ${client.author}`)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.addField(
"|-----|-----|----|",
@ -59,17 +65,31 @@ module.exports = {
`| ${slotseven} | ${sloteight} | ${slotnine} |`
)
.setTitle(`${interaction.user.username} wins a slots game`)
.setDescription(
`You win\n**${winamt + amt}**${client.currency}\nYou now have **${
parseInt(await client.bal(interaction.user.id)) - amt
}**${client.currency}`
.addFields(
{
name: "Won",
value: `**${Math.round(winamt * multi)}**${client.currency}`,
inline: true,
},
{
name: "New Balance",
value: `**${Math.round(
(await client.bal(interaction.user.id)) + winamt * multi
)}**${client.currency}`,
inline: true,
},
{
name: "Multiplier",
value: `x${r + multi}`,
inline: true,
}
);
interaction.followUp({ embeds: [won] });
} else {
await client.rmv(interaction.user.id, amt);
const lost = new MessageEmbed()
.setColor("RED")
.setFooter(`Made by ${client.author}`)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.addField(
"|-----|-----|----|",
@ -84,10 +104,19 @@ module.exports = {
`| ${slotseven} | ${sloteight} | ${slotnine} |`
)
.setTitle(`${interaction.user.username} loses a slots game`)
.setDescription(
`You lost\n**${amt}**${client.currency}\nYou now have **${
parseInt(await client.bal(interaction.user.id)) - amt
}**${client.currency}`
.addFields(
{
name: "Lost",
value: `**${amt}**${client.currency}`,
inline: true,
},
{
name: "New Balance",
value: `**${
parseInt(await client.bal(interaction.user.id)) - amt
}**${client.currency}`,
inline: true,
}
);
interaction.followUp({ embeds: [lost] });
}

151
command/Economy/steal.js Normal file
View file

@ -0,0 +1,151 @@
const db = require("../../models/econ");
const { MessageEmbed } = require("discord.js");
const { bool } = require("cath");
module.exports = {
name: "rob",
description: "Rob money from an user",
usage: "(User)",
category: "Economy",
timeout: 120000,
options: [
{
type: 6,
name: "user",
description: "The user you want to rob",
required: true,
},
],
run: async (client, interaction, args, utils) => {
const s = new Set();
const tryrob = interaction.guild.members.cache.get(args[0]);
if (tryrob.id === interaction.user.id) {
interaction.followUp({ content: "You can't rob yourself" });
} else if (s.has(tryrob.user.tag)) {
interaction.followUp({
content:
"That user has already been robbed within three minutes, be kind!",
});
} else {
await db.findOne({ User: interaction.user.id }, async (err, data) => {
if (data) {
if (!data.CP) {
data.CP = 0;
data.save();
interaction.followUp({ content: "You don't have enough balance" });
} else {
await db.findOne({ User: tryrob.id }, async (err1, data1) => {
const coins = Math.floor(Math.random() * data.CP);
const coins1 = Math.floor(Math.random() * data1?.CP);
if (!data1) {
client.createProfile(tryrob.id);
interaction.followUp({
embeds: [
new MessageEmbed()
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.setTimestamp()
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setColor("RED")
.setDescription(
`They don't have any ${client.currency}. Be kind!`
),
],
});
} else if (data1) {
if (data1.CP <= 0 || !data1.CP) {
interaction.followUp({
embeds: [
new MessageEmbed()
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.setTimestamp()
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setColor("RED")
.setDescription(
`They don't have any ${client.currency}. Be kind!`
),
],
});
}
if (bool()) {
data.CP += coins1;
data.save();
data1.CP -= coins1;
data1.save();
s.add(tryrob.user.tag);
setTimeout(function () {
s.delete(tryrob.user.tag);
}, 1000 * 60 * 3);
tryrob
.send(
`**${
interaction.user.tag
}** has robbed you **${coins1.toLocaleString()}** coins in **${
interaction.guild.name
}**`
)
.catch(e => {});
interaction.followUp({
embeds: [
new MessageEmbed()
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.setTimestamp()
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setColor("GREEN")
.setDescription(
`You robbed **${tryrob.user.tag}**! And you got \`${coins1}\`${client.currency}`
),
],
});
} else {
data.CP -= coins;
data.save();
data1.CP += coins;
data1.save();
interaction.followUp({
embeds: [
new MessageEmbed()
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.setTimestamp()
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setColor("RED")
.setDescription(
`You failed on robbing **${tryrob.user.tag}**! And you had to pay him/her \`${coins}\`${client.currency}`
),
],
});
}
}
});
}
}
if (!data) {
client.createProfile(interaction.user.id);
interaction.followUp({ content: "You don't have enough balance" });
}
});
}
},
};

View file

@ -1,10 +1,11 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "work",
description: "Work to earn money",
category: "Economy",
timeout: 1000 * 60 * 10,
run: async (client, interaction, args, utils) => {
const job = [
const jobs = [
"Software engineer",
"Programmer",
"Teacher",
@ -15,10 +16,22 @@ module.exports = {
"Banker",
];
const earning = utils.rndint(5000, 3000);
const jobs = job[Math.floor(Math.random() * job.length)];
const job = jobs[Math.floor(Math.random() * jobs.length)];
await client.add(interaction.user.id, earning, interaction);
interaction.followUp({
content: `You worked as a **${jobs}** and earned **${earning}${client.currency}**`,
embeds: [
new MessageEmbed()
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setDescription(
`Good Job! You worked as a **${job}** and earned **${earning}${client.currency}**`
)
.setTimestamp()
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setColor(client.color),
],
});
},
};

View file

@ -1,31 +0,0 @@
const { MessageEmbed } = require("discord.js");
const { random8ball } = require("cath");
module.exports = {
name: "8ball",
usage: "(Question)",
description: "8ball an answer",
category: "Fun",
type: "CHAT_INPUT",
options: [
{
type: 3,
name: "question",
description: "The question you want to ask",
required: true,
},
],
run: async (client, interaction, args) => {
const data = await random8ball();
const embed = new MessageEmbed()
.setAuthor(
`🎱 ${interaction.member.user.tag} asks`,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setDescription(`**🎱Question:** \n${args[0]} \n**🎱Answer:** \n ${data}`)
.setColor(client.color)
.setTimestamp()
.setURL(client.web)
.setFooter(`Made by ${client.author}`);
await interaction.followUp({ embeds: [embed] });
},
};

View file

@ -1,4 +1,4 @@
const figlet = require("figlet");
const axios = require("axios");
module.exports = {
name: "ascii",
description: "Converts text into ASCII art",
@ -13,10 +13,11 @@ module.exports = {
},
],
run: async (client, interaction, args) => {
const msg = args[0];
figlet.text(msg, async (err, data) => {
if (err) console.log(err);
await interaction.followUp(`\`\`\`${data}\`\`\``);
});
const data = await axios
.get(
`https://artii.herokuapp.com/make?text=${encodeURIComponent(args[0])}`
)
.then(res => res.data);
interaction.followUp(`\`\`\`${data}\`\`\``);
},
};

View file

@ -1,25 +0,0 @@
const { MessageAttachment } = require("discord.js");
module.exports = {
name: "busted",
description: "Bust someone",
category: "Fun",
options: [
{
type: 6,
name: "user",
description: "The user you want to use the effect",
required: true,
},
],
type: "CHAT_INPUT",
run: async (client, interaction, args) => {
const user = interaction.guild.members.cache.get(args[0]);
const ima = new MessageAttachment(
`${process.env.api}/api/v1/image/busted?q=${user.user.displayAvatarURL({
format: "png",
size: 2048,
})}`
);
await interaction.followUp({ files: [ima] });
},
};

View file

@ -1,28 +0,0 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "cat",
category: "Fun",
description: "Get a cat from reddit",
run: async (client, interaction, args) => {
let subreddits = ["cat", "cats"];
let subreddit = subreddits[Math.floor(Math.random() * subreddits.length)];
const data = await getreddit(subreddit);
await interaction.followUp({
embeds: [
new MessageEmbed({
title: data.title,
url: data.url,
image: { url: data.image },
timestamp: Date.now(),
footer: { text: data.footer },
color: client.color,
author: {
name: interaction.member.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
},
}),
],
});
},
};

View file

@ -67,7 +67,7 @@ module.exports = {
},
],
run: async (client, interaction, args) => {
let choices = args[Math.floor(Math.random() * args.length)];
await interaction.followUp(`I will choose - \`${choices}\``);
const choices = args[Math.floor(Math.random() * args.length)];
interaction.followUp(`I will choose - \`${choices}\``);
},
};

View file

@ -1,17 +0,0 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "coinflip",
description: "Flip a coin",
category: "Fun",
run: async (client, interaction, args) => {
let HT = ["Heads!", "Tails!"];
let pick = HT[Math.floor(Math.random() * HT.length)];
let embed = new MessageEmbed()
.setColor(client.color)
.setTitle("CoinFilp Game")
.setTimestamp()
.setFooter(`Made by ${client.author}`)
.setDescription(pick);
await interaction.followUp({ embeds: [embed] });
},
};

19
command/Fun/dare.js Normal file
View file

@ -0,0 +1,19 @@
const { MessageEmbed } = require("discord.js");
const dares = require("../../util/Data/dares.json");
module.exports = {
name: "dare",
description: "The maturity level of the topics the question can relate to",
run: async (client, interaction) => {
const embed = new MessageEmbed()
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dyamic: true })
)
.setTitle(dares[Math.round(Math.random() * (dares.length - 1))])
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
},
};

View file

@ -1,98 +0,0 @@
module.exports = {
name: "dinochrome",
category: "Fun",
description: "Dinosaur in Chrome",
run: async (client, interaction, args) => {
await interaction.deleteReply();
let msg = await interaction.channel.send(`---------------🦖`);
let time = 1 * 1000;
setTimeout(function () {
msg.edit(`-----------🦖----`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`----------🦖------`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`--------🦖--------`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`------🦖-----------`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`-------🦖-----------`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`---🌵-----🦖---------`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`---🌵-🦖-------------`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`🦖\n ---🌵--------------`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`------🦖---🌵--------------`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`----🦖-----🌵----------------`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`-🌵🌵-----🦖-------🌵--------`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`----🌵🌵-🦖----------🌵------`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`🦖\n ---🌵🌵-------------🌵---`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`-----🦖---🌵🌵-------------🌵--`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`-------🦖-----🌵🌵-------------`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`🎂----🦖--------🌵🌵-----------`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`---🎂--🦖----------🌵🌵---------`);
}, time);
time += 1.5 * 1000;
setTimeout(function () {
msg.edit(`**Ⓜⓘⓢⓢⓘⓞⓝ Ⓒⓞⓜⓟⓛⓔⓣⓔⓓ !**\n ---🎂🦖----------🌵🌵-------------`);
}, time);
},
};

View file

@ -1,28 +0,0 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "dog",
category: "Fun",
description: "Get a dog from reddit",
run: async (client, interaction, args) => {
let subreddits = ["dog", "dogs"];
let subreddit = subreddits[Math.floor(Math.random() * subreddits.length)];
const data = await getreddit(subreddit);
await interaction.followUp({
embeds: [
new MessageEmbed({
title: data.title,
url: data.url,
image: { url: data.image },
timestamp: Date.now(),
footer: { text: data.footer },
color: client.color,
author: {
name: interaction.member.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
},
}),
],
});
},
};

View file

@ -1,31 +0,0 @@
const { MessageAttachment } = require("discord.js");
const axios = require("axios");
module.exports = {
name: "drake",
description: "Drake meme",
usage: "(Text) (Text)",
category: "Fun",
options: [
{
type: 3,
name: "first",
description: "The first text",
required: true,
},
{
type: 3,
name: "second",
description: "The second text",
required: true,
},
],
run: async (client, interaction, args) => {
const res = await axios.get(
`https://frenchnoodles.xyz/api/endpoints/drake/?text1=${args[0]}&text2=${args[1]}`,
{}
);
let i = await res.buffer();
const drake = new MessageAttachment(i);
await interaction.followUp({ files: [drake] });
},
};

View file

@ -1,24 +0,0 @@
const axios = require("axios");
module.exports = {
name: "doublestruck",
description: "Doublestruck your text",
usage: "(text)",
category: "Fun",
type: "CHAT_INPUT",
options: [
{
type: 3,
name: "text",
description: "The text you want to convert",
required: true,
},
],
run: async (client, interaction, args) => {
let text = args[0].split(" ").join("+");
let res = await axios.get(
"https://api.popcatdev.repl.co/doublestruck?text=" + text
);
let json = await res.json();
await interaction.followUp(json.text);
},
};

View file

@ -1,43 +0,0 @@
module.exports = {
name: "emojify",
usage: "(Word)",
description: "Emojify a sentence",
type: "CHAT_INPUT",
category: "Fun",
options: [
{
type: 3,
name: "text",
description: "The text you want to convert",
required: true,
},
],
run: async (client, interaction, args) => {
const mapping = {
" ": " ",
0: ":zero:",
1: ":one:",
2: ":two:",
3: ":three:",
4: ":four:",
5: ":five:",
6: ":six:",
7: ":seven:",
8: ":eight:",
9: ":nine:",
"!": ":grey_exclamation:",
"?": ":grey_question:",
"#": ":hash:",
"*": ":asterisk:",
};
"abcdefghijklmnopqrstuvwxyz".split("").forEach(c => {
mapping[c] = mapping[c.toUpperCase()] = ` :regional_indicator_${c}:`;
});
await interaction.followUp(
args[0]
.split("")
.map(c => mapping[c] || c)
.join("")
);
},
};

130
command/Fun/fun.js Normal file
View file

@ -0,0 +1,130 @@
const { MessageEmbed, MessageAttachment } = require("discord.js");
const { random8ball } = require("cath");
module.exports = {
name: "fun",
description: "Fun commands",
options: [
{
type: 1,
name: "8ball",
description: "8ball an answer",
options: [
{
type: 3,
name: "question",
description: "The question you want to ask",
required: true,
},
],
},
{
type: 1,
name: "rickroll",
description: "Rickroll?",
},
{
type: 1,
name: "emojify",
description: "Emojify a sentence",
options: [
{
type: 3,
name: "text",
description: "The text you want to convert",
required: true,
},
],
},
{
type: 1,
name: "pp",
description: "Check how long is the user",
options: [
{
type: 6,
name: "user",
description: "The user you want to see",
required: false,
},
],
},
],
run: async (client, interaction, args) => {
if (args[0] == "8ball") {
const data = await random8ball();
const embed = new MessageEmbed()
.setAuthor(
`🎱 ${interaction.user.tag} asks`,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setDescription(
`**🎱Question:** \n${args[1]} \n**🎱Answer:** \n ${data}`
)
.setColor(client.color)
.setTimestamp()
.setURL(client.web)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL());
interaction.followUp({ embeds: [embed] });
} else if (args[0] === "rickroll") {
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)];
interaction.followUp({
content: `**${rick}**`,
files: [
new MessageAttachment(
"https://i.pinimg.com/originals/88/82/bc/8882bcf327896ab79fb97e85ae63a002.gif"
),
],
});
} else if (args[0] === "emojify") {
const mapping = {
" ": " ",
0: ":zero:",
1: ":one:",
2: ":two:",
3: ":three:",
4: ":four:",
5: ":five:",
6: ":six:",
7: ":seven:",
8: ":eight:",
9: ":nine:",
"!": ":grey_exclamation:",
"?": ":grey_question:",
"#": ":hash:",
"*": ":asterisk:",
};
"abcdefghijklmnopqrstuvwxyz".split("").forEach(c => {
mapping[c] = mapping[c.toUpperCase()] = ` :regional_indicator_${c}:`;
});
interaction.followUp(
args[1]
.split("")
.map(c => mapping[c] || c)
.join("")
);
} else if (args[0] === "pp") {
const { user } =
interaction.guild.members.cache.get(args[1]) || interaction.member;
const embed = new MessageEmbed()
.addField(
`${user.username}'s peepee`,
`8${"=".repeat(Math.floor(Math.random() * 20))}D`
)
.setColor(client.color)
.setTitle("Peepee size machine")
.setTimestamp()
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL());
interaction.followUp({
embeds: [embed],
});
}
},
};

View file

@ -13,8 +13,8 @@ module.exports = {
},
],
type: "CHAT_INPUT",
run: async (client, interaction, args) => {
let answers = [
run: async (client, interaction, args, utils) => {
const answers = [
"@yousuck.noob",
"@hesnoob.haha",
"@thisguy.suck",
@ -33,7 +33,7 @@ module.exports = {
"@gmail.com",
"@yahoo.com",
];
let passwords = [
const passwords = [
"Disb****",
"disc******",
"pass**********",
@ -50,7 +50,7 @@ module.exports = {
"egghunt2***",
"secr*****",
];
let ips = [
const ips = [
"10.313.523.502.00.1",
"25.537.753.462.29.2",
"21.175.866.974.07.08",
@ -69,69 +69,69 @@ module.exports = {
interaction.channel
.send(`Hacking ${taggedUser.user.username}...`)
.then(async msg => {
client.function.sleep(100);
utils.sleep(100);
msg.edit("Status: ■□□□□□□□□□□ 0%");
client.function.sleep(100);
utils.sleep(100);
msg.edit("Status: ■■□□□□□□□□□ 7%: Hacking Email...");
client.function.sleep(600);
utils.sleep(600);
msg.edit(
`Status: ■■■□□□□□□□□ 8%:\n \`Email: ${taggedUser.user.username}@yousuck.noob\`\n \`Password: ${passwrd}\` `
);
client.function.sleep(600);
utils.sleep(600);
msg.edit("Status: ■■□□□□□□□□□ 9%: Logging in to the Email...");
client.function.sleep(2000);
utils.sleep(2000);
msg.edit("Status: ■■■□□□□□□□□ 12%: Turning off the antivirus");
client.function.sleep(1000);
utils.sleep(1000);
msg.edit("Status: ■■■■□□□□□□ 14%: Downloading SYNAPSE X");
client.function.sleep(100);
utils.sleep(100);
msg.edit("Status: ■■■□□□□□□□□ 17%: Deleting Captcha...");
client.function.sleep(100);
utils.sleep(100);
msg.edit("Status: ■■□□□□□□□□□ 20%: Deleting Paypal account...");
client.function.sleep(10);
utils.sleep(10);
msg.edit("Status: ■■■□□□□□□□□ 21%");
client.function.sleep(12);
utils.sleep(12);
msg.edit("Status: ■■■■□□□□□□□ 22%");
client.function.sleep(100);
utils.sleep(100);
msg.edit("Status: ■■■■■□□□□□□ 24%: Paypal account deleted");
client.function.sleep(1000);
utils.sleep(1000);
msg.edit("Status: ■■■■□□□□□□ 29%: Hacking is almost ready...");
client.function.sleep(80);
utils.sleep(80);
msg.edit("Status: ■■■□□□□□□□□ 31%");
client.function.sleep(80);
utils.sleep(80);
msg.edit("Status: ■■■■□□□□□□□ 36%");
client.function.sleep(40);
utils.sleep(40);
msg.edit("Status: ■■■■■□□□□□□ 41%");
client.function.sleep(60);
utils.sleep(60);
msg.edit("Status: ■■■■□□□□□□□ 47%");
client.function.sleep(50);
utils.sleep(50);
msg.edit("Status: ■■■■■■□□□□□ 53%");
client.function.sleep(3000);
utils.sleep(3000);
msg.edit(
`Status: ■■■■■■■□□□□ 58%: Email password changed so ${taggedUser.user.username} can not login`
);
client.function.sleep(500);
utils.sleep(500);
msg.edit("Status: ■■■■■■□□□□□ 66%");
client.function.sleep(60);
utils.sleep(60);
msg.edit("Status: ■■■■■□□□□□□ 74%");
client.function.sleep(20);
utils.sleep(20);
msg.edit(`Status: ■■■■■□□□□□□ 79%: IP address found: ${ip}`);
client.function.sleep(83);
utils.sleep(83);
msg.edit("Status: ■■■■■■□□□□ 80%");
client.function.sleep(50);
utils.sleep(50);
msg.edit("Status: ■■■■■■■□□□ 85%");
client.function.sleep(14);
utils.sleep(14);
msg.edit("Status: ■■■■■■■■■□□ 93%");
client.function.sleep(70);
utils.sleep(70);
msg.edit("Status: ■■■■■■■■■■□ 97%");
client.function.sleep(90);
utils.sleep(90);
msg.edit("Status: ■■■■■■■■■■■ 100%");
const embed = new MessageEmbed()
.setDescription(`${taggedUser} has been hacked!`)
.addField("Email", `${taggedUser.user.username}${answer}`)
.addField("Password", `${passwrd}`)
.addField("IP address", `${ip}`)
.setFooter(`Made by ${client.author}`)
.setColor("02023a");
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setColor(client.color);
await msg.edit({ embeds: [embed] });
});
},

View file

@ -5,12 +5,13 @@ module.exports = {
name: "hangman",
description: "Play a hangman game",
category: "Fun",
run: async (client, interaction, args) => {
run: async (client, interaction) => {
await interaction.deleteReply();
if (playing.has(interaction.channel.id))
if (playing.has(interaction.channel.id)) {
return interaction.followUp({
content: "Only one game may be occurring per channel.",
});
}
playing.add(interaction.channel.id);
try {
const data = await axios
@ -26,10 +27,7 @@ module.exports = {
while (word.length !== confirmation.length && points < 6) {
const embed = new MessageEmbed()
.setColor(client.color)
.setFooter(
interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setTitle("Hangman game").setDescription(`
${displayText === null ? "Here we go!" : displayText ? "Good job!" : "Nope!"}
@ -46,7 +44,7 @@ module.exports = {
=============
\`\`\`
`);
let m = await interaction.channel.send({ embeds: [embed] });
await interaction.channel.send({ embeds: [embed] });
const filter = res => {
const choice = res.content.toLowerCase();
return (
@ -60,7 +58,6 @@ module.exports = {
max: 1,
time: 30000,
});
//m.delete();
if (!guess.size) {
await interaction.channel.send({ content: "Sorry, time is up!" });
break;
@ -84,10 +81,11 @@ module.exports = {
}
}
playing.delete(interaction.channel.id);
if (word.length === confirmation.length || guessed)
if (word.length === confirmation.length || guessed) {
return interaction.channel.send({
content: `You won. The word is **${word}**!`,
});
}
return interaction.channel.send({
content: `You lost. The word is **${word}**.`,
});

63
command/Fun/image.js Normal file
View file

@ -0,0 +1,63 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "image",
description: "Generate images",
options: [
{
type: 1,
name: "meme",
description: "Get a meme from reddit",
},
{
type: 1,
name: "cat",
description: "Get a cat from reddit",
},
],
run: async (client, interaction, args) => {
if (args[0] == "meme") {
const subreddits = ["comedyheaven", "dank", "meme", "memes"];
const subreddit =
subreddits[Math.floor(Math.random() * subreddits.length)];
const data = await getreddit(subreddit);
interaction.followUp({
embeds: [
new MessageEmbed({
title: data.title,
url: data.url,
image: { url: data.image },
timestamp: Date.now(),
footer: { text: data.footer },
color: client.color,
author: {
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
},
}),
],
});
} else if (args[0] === "cat") {
const subreddits = ["cat", "cats"];
const subreddit =
subreddits[Math.floor(Math.random() * subreddits.length)];
const data = await getreddit(subreddit);
interaction.followUp({
embeds: [
new MessageEmbed({
title: data.title,
url: data.url,
image: { url: data.image },
timestamp: Date.now(),
footer: { text: data.footer },
color: client.color,
author: {
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
},
}),
],
});
}
},
};

View file

@ -23,7 +23,7 @@ module.exports = {
const user = interaction.guild.members.cache.get(args[0]);
words = args[1];
if (user.id === interaction.user.id) {
return await interaction.followUp("You can't kiss yourself");
return interaction.followUp("You can't kiss yourself");
}
const embed = new MessageEmbed()
.setDescription(`${interaction.user} **kisses** ${user}`)
@ -32,9 +32,9 @@ module.exports = {
)
.setColor(client.color)
.setTimestamp()
.setFooter(`Made by ${client.author}`);
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL());
if (words) {
embed.addField("Words:", reason);
embed.addField("Words:", words);
}
await interaction
.followUp({ embeds: [embed] })

View file

@ -1,28 +0,0 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "meme",
category: "Fun",
description: "Get a meme from reddit",
run: async (client, interaction, args) => {
let subreddits = ["comedyheaven", "dank", "meme", "memes"];
let subreddit = subreddits[Math.floor(Math.random() * subreddits.length)];
const data = await getreddit(subreddit);
await interaction.followUp({
embeds: [
new MessageEmbed({
title: data.title,
url: data.url,
image: { url: data.image },
timestamp: Date.now(),
footer: { text: data.footer },
color: client.color,
author: {
name: interaction.member.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
},
}),
],
});
},
};

View file

@ -1,32 +0,0 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "pp",
description: "Check how long is the user",
usage: "(User)",
category: "Fun",
options: [
{
type: 6,
name: "user",
description: "The user you want to see",
required: false,
},
],
type: "CHAT_INPUT",
run: async (client, interaction, args) => {
const { user } =
interaction.guild.members.cache.get(args[0]) || interaction.member;
let embed = new MessageEmbed()
.addField(
`${user.username}\'s peepee`,
`8${"=".repeat(Math.floor(Math.random() * 20))}D`
)
.setColor(client.color)
.setTitle("Peepee size machine")
.setTimestamp()
.setFooter(`Made by ${client.author}`);
await interaction.followUp({
embeds: [embed],
});
},
};

View file

@ -1,22 +0,0 @@
const { MessageAttachment } = require("discord.js");
module.exports = {
name: "rickroll",
description: "Rickroll?",
category: "Fun",
run: async (client, interaction, 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"
);
await interaction.followUp({ content: `**${rick}**`, files: [rickroll] });
},
};

View file

@ -15,19 +15,19 @@ module.exports = {
],
type: "CHAT_INPUT",
run: async (client, interaction, args, utils) => {
let user = interaction.guild.members.cache.get(args[0]);
if (user.user.id == interaction.user.id)
return await interaction.followUp("You can't play with yourself");
if (user.user.bot)
return await interaction.followUp("You can't play with bots");
const user = interaction.guild.members.cache.get(args[0]);
if (user.user.id == interaction.user.id) {
return interaction.followUp("You can't play with yourself");
}
if (user.user.bot) return interaction.followUp("You can't play with bots");
let embed = new Discord.MessageEmbed()
const embed = new Discord.MessageEmbed()
.setDescription(`Wait for **${user.user.username}** to accept your game`)
.setColor(client.color)
.setTimestamp()
.setFooter(`Made by ${client.author}`);
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL());
let confirm = new Discord.MessageActionRow().addComponents(
const confirm = new Discord.MessageActionRow().addComponents(
new Discord.MessageButton()
.setLabel("Accept")
.setStyle("SUCCESS")
@ -46,7 +46,7 @@ module.exports = {
components: [confirm],
})
.then(async m => {
let filter = button => button.user.id == user.user.id;
const filter = button => button.user.id == user.user.id;
const collector = m.createMessageComponentCollector({
filter,
type: "BUTTON",
@ -58,12 +58,12 @@ module.exports = {
return collector.stop("decline");
}
button.deferUpdate();
let pick = new Discord.MessageEmbed()
const pick = new Discord.MessageEmbed()
.setTitle(`${interaction.user.username} VS ${user.user.username}`)
.setColor(client.color)
.setDescription("Choose either 🪨, 📄, or ✂️")
.setTimestamp();
let choices = new Discord.MessageActionRow().addComponents(
const choices = new Discord.MessageActionRow().addComponents(
new Discord.MessageButton()
.setCustomId("rock")
.setStyle("SECONDARY")
@ -82,11 +82,11 @@ module.exports = {
components: [choices],
});
collector.stop();
let users = new Set();
const users = new Set();
users.add(interaction.user.id);
users.add(user.user.id);
let ping, pong;
let filter = b => users.has(b.user.id);
const filter = b => users.has(b.user.id);
const collect = m.createMessageComponentCollector({
filter,
type: "BUTTON",
@ -112,7 +112,7 @@ module.exports = {
});
collect.on("end", (c, reason) => {
if (reason == "time") {
let timeout = new Discord.MessageEmbed()
const timeout = new Discord.MessageEmbed()
.setTitle("Timeout")
.setColor("RED")
.setDescription(
@ -129,10 +129,13 @@ module.exports = {
const sit5 = ping == "paper" && pong == "rock";
const sit6 = ping == "rock" && pong == "paper";
if (sit1 || sit3 || sit5) {
let embed = new Discord.MessageEmbed()
const embed = new Discord.MessageEmbed()
.setTitle(`${user.user.username} wins!`)
.setColor("GREEN")
.setFooter(`Made by ${client.author}`)
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.addField(
`${user.user.username} choice`,
`${utils.format(ping)}`
@ -147,10 +150,13 @@ module.exports = {
components: [],
});
} else if (sit2 || sit4 || sit6) {
let embed = new Discord.MessageEmbed()
const embed = new Discord.MessageEmbed()
.setTitle(`${interaction.user.username} wins!`)
.setColor("GREEN")
.setFooter(`Made by ${client.author}`)
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.addField(
`${interaction.user.username} choice`,
`${utils.format(pong)}`
@ -165,10 +171,13 @@ module.exports = {
components: [],
});
} else {
let embed = new Discord.MessageEmbed()
const embed = new Discord.MessageEmbed()
.setTitle(`Tie!`)
.setColor("GREY")
.setFooter(`Made by ${client.author}`)
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.addField(
`${interaction.user.username} choice`,
`${utils.format(pong)}`
@ -185,7 +194,7 @@ module.exports = {
});
collector.on("end", (collected, reason) => {
if (reason == "time") {
let embed = new Discord.MessageEmbed()
const embed = new Discord.MessageEmbed()
.setTitle("Timeout")
.setColor("RED")
.setDescription(
@ -197,7 +206,7 @@ module.exports = {
});
}
if (reason == "decline") {
let embed = new Discord.MessageEmbed()
const embed = new Discord.MessageEmbed()
.setTitle("Declined")
.setColor("RED")
.setDescription(

View file

@ -1,6 +1,6 @@
const { MessageEmbed } = require("discord.js");
block = "⬛";
heart = "🟥";
const block = "⬛";
const heart = "🟥";
module.exports = {
name: "ship",
@ -25,13 +25,13 @@ module.exports = {
run: async (client, interaction, args) => {
const user1 = interaction.guild.members.cache.get(args[0]).user.username;
const user2 = interaction.guild.members.cache.get(args[1]).user.username;
let loveEmbed = new MessageEmbed()
const loveEmbed = new MessageEmbed()
.setColor("dd2e44")
.setFooter(`Shipped by ${interaction.member.user.tag}`)
.setFooter(`Shipped by ${interaction.user.tag}`)
.setTimestamp()
.setTitle(`💘 | Shipping ${user1} and ${user2} | 💘`)
.setDescription(`🔻 | ${user1} \n${ship()}\n🔺 | ${user2}`);
await interaction.followUp({ embeds: [loveEmbed] });
interaction.followUp({ embeds: [loveEmbed] });
},
};
function ship() {

View file

@ -14,20 +14,16 @@ module.exports = {
},
],
run: async (client, interaction, args) => {
let simp = Math.floor(Math.random() * 100);
let user = interaction.guild.members.cache.get(args[0]);
const simp = Math.floor(Math.random() * 100);
const user = interaction.guild.members.cache.get(args[0]);
interaction.followUp({
embeds: [
new MessageEmbed()
.setTitle(`${user.user.username}'s simp rate`)
.setDescription(`${user.user.username} is a ${simp}% simp`)
.setColor(client.color)
.setFooter(`Made by ${client.author}`)
.setTimestamp()
.setAuthor(
`Requested by ${interaction.user.tag}`,
interaction.user.displayAvatarURL({ dynamic: true })
),
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp(),
],
});
},

View file

@ -1,28 +0,0 @@
const axios = require("axios");
module.exports = {
name: "superscript",
description: "Superscript your text",
usage: "(text)",
category: "Fun",
type: "CHAT_INPUT",
options: [
{
type: 3,
name: "text",
description: "The text you want to convert",
required: true,
},
],
run: async (client, interaction, args) => {
const text = args[0];
if (text.includes("@"))
return await interaction.followUp({
content: "Text cannot includes '@'",
});
const data = await axios
.get(`${process.env.api}/api/v1/fun/superscript?text=${text}`)
.then(res => res.data.text);
await interaction.followUp({ content: data });
},
};

View file

@ -1,25 +0,0 @@
const { Canvas } = require("canvacord");
const { MessageAttachment } = require("discord.js");
module.exports = {
name: "triggered",
usage: "{User}",
description: "Have a trigger effect on a user's avatar",
category: "Fun",
options: [
{
type: 6,
name: "user",
description: "The user you want to use the effect",
required: true,
},
],
type: "CHAT_INPUT",
run: async (client, interaction, args) => {
const user = interaction.guild.members.cache.get(args[0]);
const ava = user.user.displayAvatarURL({ format: "png", size: 2048 });
const imga = await Canvas.trigger(ava);
await interaction.followUp({
files: [new MessageAttachment(imga, "image.gif")],
});
},
};

19
command/Fun/truth.js Normal file
View file

@ -0,0 +1,19 @@
const { MessageEmbed } = require("discord.js");
const truth = require("../../util/Data/truth.json");
module.exports = {
name: "truth",
description: "Gives a random question that has to be answered truthfully",
run: async (client, interaction, args) => {
const embed = new MessageEmbed()
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dyamic: true })
)
.setTitle(truth[Math.round(Math.random() * truth.length)])
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
},
};

29
command/Fun/wyr.js Normal file
View file

@ -0,0 +1,29 @@
const { MessageEmbed } = require("discord.js");
const questions = require("../../util/Data/wyr.json");
module.exports = {
name: "wyr",
description: "Send some would-you rather questions",
run: async (client, interaction, args) => {
const messagetext = questions[Math.floor(Math.random() * questions.length)];
const question = messagetext.split("Would you rather ")[1];
const q = question.split(" or ");
const Option1 = q[0];
const Option2 = q[1];
const embed = new MessageEmbed()
.setTitle("Would You Rather")
.setDescription(
`🇦 ${Option1} \n\n **OR** \n\n :regional_indicator_b: ${Option2}`
)
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
wyrmessage = await interaction.followUp({ embeds: [embed] });
wyrmessage.react("🇦");
wyrmessage.react("🇧");
},
};

View file

@ -0,0 +1,144 @@
const GiveawaysClient = require("../../client/GiveawaysClient");
module.exports = {
name: "giveaway",
description: "Giveaway",
UserPerms: ["MANAGE_MESSAGES"],
options: [
{
type: "SUB_COMMAND",
name: "start",
description: "Start a giveaway",
options: [
{
type: 3,
name: "prize",
description: "The prize of the giveaway",
required: true,
choices: [],
},
{
type: 4,
name: "winners",
description: "The amount of winners of the giveaway",
required: true,
},
{
type: 3,
name: "time",
description: "The amount of time of the giveaway",
required: true,
},
{
type: 7,
name: "channel",
description: "The channel of the giveaway",
required: true,
channelTypes: ["GUILD_TEXT"],
},
{
type: 8,
name: "role1",
description: "The required role to join the giveaway",
},
{
type: 8,
name: "role2",
description: "The required role to join the giveaway",
},
{
type: 8,
name: "role3",
description: "The required role to join the giveaway",
},
],
},
{
type: "SUB_COMMAND",
name: "reroll",
description: "Reroll a giveaway",
options: [
{
type: 3,
name: "message",
description: "The message ID of the giveaway",
required: true,
choices: [],
},
],
},
{
type: "SUB_COMMAND",
name: "end",
description: "End a giveaway",
options: [
{
type: 3,
name: "message",
description: "The message ID of the giveaway",
required: true,
choices: [],
},
],
},
],
run: async (client, interaction, args, utils) => {
if (args[0] == "start") {
const [, prize, winners, time, channel, roles1, roles2, roles3] = args;
if (!utils.ms(time)) {
interaction.followUp({
content: "Time must be a valid time to parse (Example: 10m, 100s)",
});
}
await GiveawaysClient.create(client, {
prize,
host: interaction.user.id,
winners,
endAfter: time,
requirements: roles1
? {
Enabled: true,
Roles: [roles1],
}
: roles2 && roles1
? {
Enabled: true,
Roles: [roles1, roles2],
}
: roles1 && roles2 && roles3
? {
Enabled: true,
Roles: [roles1, roles2, roles3],
}
: { Enabled: false },
Channel: channel,
});
interaction.followUp({
content: `Giveaway is started in ${interaction.guild.channels.cache.get(
channel
)}`,
});
} else if (args[0] == "reroll") {
const giveaway = await GiveawaysClient.getByMessage(args[1]);
const m = await client.guilds.cache
.get(giveaway.Guild)
.channels.cache.get(giveaway.Channel)
.messages.fetch(args[1]);
if (!m) {
interaction.followUp({ content: "Unable to find the giveaway ⚠" });
} else {
await GiveawaysClient.end(m, giveaway, m);
}
} else {
const giveaway = await GiveawaysClient.getByMessage(args[1]);
const m = await client.guilds.cache
.get(giveaway.Guild)
.channels.cache.get(giveaway.Channel)
.messages.fetch(args[1]);
if (!m) {
interaction.followUp({ content: "Unable to find the giveaway ⚠" });
} else {
await GiveawaysClient.end(m, giveaway, m);
}
}
},
};

View file

@ -30,21 +30,20 @@ module.exports = {
})}) | [jpg](${member.user.displayAvatarURL({
format: "jpg",
size: 2048,
})}) | [gif](${member.user.displayAvatarURL({
format: "gif",
size: 2048,
dynamic: true,
})}) | [webp](${member.user.displayAvatarURL({
format: "webp",
size: 2048,
})}) | [gif](${member.user.displayAvatarURL({
format: "gif",
size: 2048,
})})**`
)
.setImage(
member.user.avatarURL({ size: 2048, dynamic: true, format: "png" })
)
.setFooter(`Made by ${client.author}`)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setURL(client.web)
.setTimestamp();
await interaction.followUp({ embeds: [embed] });
interaction.followUp({ embeds: [embed] });
},
};

View file

@ -1,6 +1,4 @@
const { MessageEmbed } = require("discord.js");
const axios = require("axios");
module.exports = {
name: "banner",
description: "Show user's banner",
@ -18,40 +16,37 @@ module.exports = {
run: async (client, interaction, args) => {
const { user } =
interaction.guild.members.cache.get(args[0]) || interaction.member;
axios
.get(`https://discord.com/api/v9/users/${user.id}`, {
headers: {
Authorization: `Bot ${client.token}`,
},
})
.then(async res => {
const { banner, accent_color } = res.data;
const data = await user.fetch();
if (data?.banner) {
const extension = data.banner.startsWith("a_") ? ".gif" : ".png";
const url = `https://cdn.discordapp.com/banners/${user.id}/${data.banner}${extension}?size=2048`;
if (banner) {
const extension = banner.startsWith("a_") ? ".gif" : ".png";
const url = `https://cdn.discordapp.com/banners/${user.id}/${banner}${extension}?size=2048`;
const embed = new MessageEmbed()
.setTitle(`${user.tag}'s Banner`)
.setImage(url)
.setColor(accent_color || "BLUE");
await interaction.followUp({ embeds: [embed] });
} else {
if (accent_color) {
const embed = new MessageEmbed()
.setDescription(
`**${user.tag}** does not have a banner but they have an accent color`
)
.setColor(accent_color);
await interaction.followUp({ embeds: [embed] });
} else {
await interaction.followUp({
content: `**${user.tag}** does not have a banner nor do they have an accent color.`,
});
}
}
});
const embed = new MessageEmbed()
.setDescription(`[Link to Banner](${url})`)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setTitle(`${user.tag}'s Banner`)
.setImage(url)
.setColor(data?.hexAccentColor || client.color);
interaction.followUp({ embeds: [embed] });
} else if (data?.hexAccentColor) {
const embed = new MessageEmbed()
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setDescription(
`**${user.tag}** does not have a banner but they have an accent color`
)
.setColor(data?.hexAccentColor);
interaction.followUp({ embeds: [embed] });
} else {
const embed = new MessageEmbed()
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setDescription(
`Seems like **${user.username}** doesn't have a banner or an accent color.`
)
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
}
},
};

View file

@ -10,37 +10,68 @@ module.exports = {
run: async (client, interaction, args, utils) => {
const core = os.cpus()[0];
const embed = new MessageEmbed()
.setURL(client.web)
.setThumbnail(client.user.displayAvatarURL())
.setColor(interaction.guild.me.displayHexColor || client.color)
.addField(
"General",
`** Client:** ${client.user.tag} (${client.user.id})
** Commands:** ${client.commands.size}
** Servers:** ${client.guilds.cache.size.toLocaleString()}
** Users:** ${client.guilds.cache
.reduce((a, b) => a + b.memberCount, 0)
.toLocaleString()}
** Channels:** ${client.channels.cache.size.toLocaleString()}
** Creation Date:** ${utc(client.user.createdTimestamp).format(
"Do MMMM YYYY HH:mm:ss"
)}
** Node.js:** ${process.version}
** Version:** v${version}
** Discord.js:** v${djsversion}
\u200b`
.setTitle(`NYX - CODM Gunsmith Bot`)
.setURL(
`https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=4231314550&scope=bot%20applications.commands`
)
.setThumbnail(
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
)
.setColor(client.color)
.addField(
"System",
`** Platform:** ${process.platform}
** Uptime:** ${utils.timer(os.uptime() * 1000, { long: true })}
** CPU:**
\u3000 Cores: ${os.cpus().length}
\u3000 Model: ${core.model}
\u3000 Speed: ${core.speed}MHz`
.addFields(
{
name: `General`,
value: `
<:nyx_owner:897418259433943120> Owner <@452076196419600394>
Bot ${client.user.tag}
Bot ID \`${client.user.id}\`
Created on \`${utc(client.user.createdTimestamp).format(
"MMMM Do YYYY"
)}\``,
inline: true,
},
{
name: `Bot Stats`,
value: `
Servers ${client.guilds.cache.size.toLocaleString()}
Users ${client.guilds.cache
.reduce((a, b) => a + b.memberCount, 0)
.toLocaleString()}
Channels \`${client.channels.cache.size.toLocaleString()}\`
Commands \`${client.commands.size}\`
`,
inline: true,
}
)
.addFields(
{
name: `Platform`,
value: `
NYX \`v${version}\`
Discord.js \`v${djsversion}\`
Node.js \`${process.version}\``,
},
{
name: `Hardware`,
value: `
Uptime:** ${utils.timer(os.uptime() * 1000, { long: true })}
Platform:** ${process.platform}
CPU:**
\u3000 Cores: ${os.cpus().length}
\u3000 Model: ${core.model}
\u3000 Speed: ${core.speed}MHz
**`,
inline: true,
}
)
.addFields({
name: `**${client.author}**`,
value: `**Development Management**\n\u3000Ń1ght#0001\n\u3000Cat drinking a cat#0795\n\u3000mightyful#6536\n\u3000Thunder#2128\n\u3000mobo#9277\n
**Research & Documentation**\n\u3000𝔔𝓻𝔦𝔁𝔖𝔦ӄø#0690\n\u3000Thunder#2128\n
**Website**\n\u3000Chunchunmaru#8570`,
})
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
await interaction.followUp({ embeds: [embed] });
interaction.followUp({ embeds: [embed] });
},
};

View file

@ -16,15 +16,16 @@ module.exports = {
if (!args[0]) {
await interaction.deleteReply();
const emoji = {
CODM: "<a:AA99_codm_logo:840231960441257995>",
Config: "<:staff:840231971526803467>",
CODM: "<a:codm:897030768793104385>",
Config: "<a:config:896990033561669762>",
Economy: client.currency,
Fun: "<a:lollll:804325253265621012>",
Moderation: "🔨",
Utilities: "⚙",
Music: "<a:music:840231980692144130>",
Giveaway: "<a:DankCat:798963811902160896>",
Information: "",
Fun: "<a:fun:896889821816053790>",
Moderation: "<:discordmod:897364105730617364>",
Information: "<a:information:894962394932064346>",
Utilities: "<a:utilites:897233087941988392>",
Music: "<a:music:897017864085712936>",
Giveaway: "<a:confetti:896763534682226758>",
NSFW: "🍑",
};
const directories = [
...new Set(client.slashCommands.map(cmd => cmd.directory)),
@ -44,27 +45,41 @@ module.exports = {
};
});
const embed = new Discord.MessageEmbed()
.setTitle(`**${client.user.username} commands**`)
.setTitle(`**NYX's Commands**`)
.setDescription(`Please choose a category in the dropdown menu`)
.setColor(client.color)
.setTimestamp()
.setAuthor(
`Requested by ${interaction.user.tag}`,
interaction.user.displayAvatarURL({ dynamic: true })
.addFields(
{
name: ":link: **Invite Me**",
value: `[Click Here](https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=4231314550&scope=bot%20applications.commands)`,
inline: true,
},
{
name: "<:support1:867093614403256350> **Need Help ?**",
value: `[Support Server](https://discord.gg/SbQHChmGcp)`,
inline: true,
},
{
name: "<:YouTube:841186450497339412> **Video Guide**",
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
inline: true,
},
{
name: `<:nyx_description:897379659665264650> Documentation`,
value: `[Click here](${client.docs})`,
inline: true,
},
{
name: "<a:booster:896527475063025704> **Premium**",
value: `You can either boost support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team.`,
inline: false,
}
)
.addField(
"**Invite Link**",
`**Invite me to your server by clicking [here](https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=4231314550&scope=bot%20applications.commands)**`
.setURL(client.docs)
.setThumbnail(
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
)
.addField(
"**Support Server Invite**",
"**Join the support server by clicking [here](https://discord.gg/SbQHChmGcp)**"
)
.addField(
"**Premium**",
"**You can either boost support server or subscribe to developer's team [Ko-fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team **"
)
.setURL(client.web)
.setFooter(
`Requested by ${interaction.user.tag}`,
interaction.user.displayAvatarURL({ dynamic: true })
@ -103,11 +118,7 @@ module.exports = {
const category = categories.find(u => u.directory === directory);
const newembed = new Discord.MessageEmbed()
.setTitle(
`${emoji[directory]}${directory} Commands${emoji[directory]}`
)
.setAuthor(
`Requested by ${interaction.user.tag}`,
interaction.user.displayAvatarURL({ dynamic: true })
`${emoji[directory]} ${directory} Commands ${emoji[directory]}`
)
.setTimestamp()
.setColor(client.color)
@ -125,16 +136,20 @@ module.exports = {
} else {
const command = client.slashCommands.get(args[0].toLowerCase());
if (!command) {
await interaction.followUp({
interaction.followUp({
content: `There isn't any command or category named "${args[0]}"`,
});
} else {
if (command.UserPerms && Array.isArray(command.UserPerms)) {
UserPermissions = command.UserPerms;
} else UserPermissions = [command.UserPerms ? command.UserPerms : ""];
} else {
UserPermissions = [command.UserPerms ? command.UserPerms : ""];
}
if (command.BotPerms && Array.isArray(command.BotPerms)) {
BotPermissions = command.BotPerms;
} else BotPermissions = [command.BotPerms ? command.BotPerms : ""];
} else {
BotPermissions = [command.BotPerms ? command.BotPerms : ""];
}
const BotPerms = BotPermissions.map(x =>
x
.split("_")
@ -167,7 +182,7 @@ module.exports = {
if (command.UserPerms) {
embed.addField("**Required User Permission**:", UserPerms);
}
if (command.BotPerm) {
if (command.BotPerms) {
embed.addField("**Required Bot Permission**:", BotPerms);
}
embed
@ -178,7 +193,7 @@ module.exports = {
.setTimestamp()
.setURL(client.web)
.setColor(client.color);
await interaction.followUp({ embeds: [embed] });
interaction.followUp({ embeds: [embed] });
}
}
},

View file

@ -9,16 +9,17 @@ module.exports = {
const messageping = msg.createdTimestamp - interaction.createdTimestamp;
await msg.delete();
const Embed = new MessageEmbed()
.setTitle("🏓 Pong!")
.setTitle("<a:pong:897383314405605436> Pong!")
.setAuthor(
`${interaction.user.username}`,
interaction.user.displayAvatarURL()
)
.setDescription(
`📨 • **Message Latency** \`${Math.floor(
messageping
)}ms\`\n🛰️ • **Bot Latency** \`${Math.round(client.ws.ping)}ms\``
`\n 📨 • **Message Latency** \`${Math.floor(messageping)}ms\`
\n🛰 **Bot Latency** \`${Math.round(client.ws.ping)}ms\``
)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setColor(
messageping < 350
? "GREEN"
@ -26,6 +27,6 @@ module.exports = {
? "YELLOW"
: "RED"
);
await interaction.followUp({ embeds: [Embed] });
interaction.followUp({ embeds: [Embed] });
},
};

View file

@ -1,17 +0,0 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "servericon",
description: "View the icon of the server",
category: "Information",
type: "CHAT_INPUT",
run: async (client, interaction, args) => {
const Embed = new MessageEmbed()
.setTitle(`Icon of ${interaction.guild.name}`)
.setURL(client.web)
.setTimestamp()
.setFooter(`Requested by ${interaction.user.tag}`)
.setImage(interaction.guild.iconURL({ dynamic: true, size: 2048 }));
await interaction.followUp({ embeds: [Embed] });
},
};

View file

@ -68,86 +68,116 @@ module.exports = {
.setTitle("**Server Information**")
.setAuthor(`${g.name}`, g.iconURL({ dynamic: true }))
.setColor(client.color)
.setDescription(g.description || "No Description")
.setThumbnail(g.iconURL({ dynamic: true, size: 1024 }))
.addField(`🎫 Name of server:`, g.name, true)
.addField(`🆔 ID of server`, g.id, true)
.addField(`🔗 Vanity Link`, `${vanityInvite}`, true)
.addField("👩‍💻 Owner", `${owner}`, true)
.addField("👩‍💻 Owner ID", `\`${owner.id}\``, true)
.addField(`👥 No. of Members`, g.memberCount.toString(), true)
.addField(
`🤖 No. of Bots:`,
members.filter(member => member.user.bot).size.toString(),
true
)
.addField(
`🚶 Humans:`,
members.filter(member => !member.user.bot).size.toString(),
true
)
.addField(
"🧷 Channels",
`#️⃣ ${textChannel} **Text** Channels\n 🔊 ${voiceChannel} **Voice** Channels\n 📁 ${categoryChannel} **Categories**`,
true
)
.addField(`😗 Emojis:`, g.emojis.cache.size.toString(), true)
.addField(
`👻 Animated Emoji\'s:`,
g.emojis.cache.filter(emoji => emoji.animated).size.toString(),
true
)
.addField(
`👔 Roles [${roles.length}]`,
roles.length < 10
? roles.join(" **|** ")
: roles.length > 10
? `${roles.slice(0, 10).join(" **|** ")}\n+${
roles.length - 10
} roles...`
: "None",
true
)
.addField(`📃 Description`, g.description || "No Description", true)
.addField(
`♨ Boost`,
`Tier: ${
.addFields(
{
name: `<:nyx_owner:897418259433943120> Owner Info`,
value: `
**Owner ** ${owner}
🆔 **Owner ID ** \`${owner.id}\`
`,
inline: true,
},
{
name: `Misc Info`,
value: `
**🆔 Server ID ** \`${g.id}\`
**🌐 Region ** ${regions[g.regions]}
**🔗 Vanity Link ** [${vanityCode}](${vanityInvite})
`,
inline: true,
},
{
name: `<a:nyx_last_update:897381474330873887> Creation Date`,
value: `
${moment(g.createdTimestamp).format("LL")} ${moment(
g.createdTimestamp
).format("LTS")} (${moment(g.createdTimestamp).fromNow()})`,
inline: true,
},
// Row 2
{
name: `<:4chanluv:836623612689121320> Emojies ${g.emojis.cache}`,
value: `
**Static ** ${g.emojis.cache.size.toString()}
**Animated ** ${g.emojis.cache
.filter(emoji => emoji.animated)
.size.toString()}`,
inline: true,
},
{
name: `Member Statistics`,
value: `
👥 **Total** ${g.memberCount.toString()}
🚶 **Users** ${members
.filter(member => !member.user.bot)
.size.toString()}
🤖 **Bots** ${members
.filter(member => member.user.bot)
.size.toString()}`,
inline: true,
},
{
name: `Channel Info`,
value: `
📁 **Categories ** ${categoryChannel}
# **Text** ${textChannel}
🔊 **Voice** ${voiceChannel}`,
inline: true,
},
// Row 3
{
name: `Server Specification`,
value: `
**<:partner:840231939944480829> Partnered ** ${
g.partnered
? "<a:nyx_checkmark:897240322411724841>"
: "<a:nyx_cross:897244999211696198>"
}
**<:verifiedserver:897410018234728449> Verified ** ${
g.verified
? "<a:nyx_checkmark:897240322411724841>"
: "<a:nyx_cross:897244999211696198>"
}
**🚥 Verification Level ** ${verificationLevels[g.verificationLevel]}
**💢 Explicit Filter ** ${filterLevels[g.explicitContentFilter]}
**Tier ** ${
g.premiumTier == "TIER_3"
? "3"
? "3 <:nyx_tier3:897406181511946261>"
: g.premiumTier == "TIER_2"
? "2"
? "2 <:nyx_tier2:897406181541281792>"
: g.premiumTier == "TIER_1"
? "1"
? "1 <:nyx_tier1:897406181558067210>"
: "0"
}\nCount: ${g.premiumSubscriptionCount || "0"}`,
true
}
**Count ** ${g.premiumSubscriptionCount || "0"}`,
inline: true,
},
{
name: `<a:nyx_community:897419330478825512> Community Features`,
value: `${
utils.fixFeatures(g.features) || "No Community Features"
}`,
inline: true,
},
{
name: `👔 Role Info [${roles.length}]`,
value: `${
roles.length < 10
? roles.join(" **|** ")
: roles.length > 10
? `${roles.slice(0, 10).join(" **|** ")}\n+${
roles.length - 10
} roles...`
: "None"
}`,
inline: true,
}
)
.addField(
"💢 Explicit Filter",
filterLevels[g.explicitContentFilter],
true
)
.addField(
`🚧 Verification Level`,
verificationLevels[g.verificationLevel],
true
)
.addField(
"🗺 Community Features",
utils.fixFeatures(g.features) || "No Community Features",
true
)
.addField("👨🏻‍🤝‍👨🏻 Partnered", g.partnered ? "Yes" : "No", true)
.addField("✅ Verified", g.verified ? "Yes" : "No", true)
.addField(
`📅 Created at`,
`${moment(g.createdTimestamp).format("LL")} ${moment(
g.createdTimestamp
).format("LTS")} (${moment(g.createdTimestamp).fromNow()})`,
true
)
.setURL(client.web)
.setFooter(`Made by ${client.author}`);
await interaction.followUp({ embeds: [embed] });
.setURL(vanityCode ? vanityInvite : "https://cath.gq/")
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL());
interaction.followUp({ embeds: [embed] });
} catch (e) {
console.log(e);
}

View file

@ -36,27 +36,27 @@ module.exports = {
"Early Verified Bot Developer<:discord_bot_dev:840231906200387666>",
DISCORD_CERTIFIED_MODERATOR: "Discord Certified Moderator",
};
let status;
switch (member.presence.status) {
case "online":
status = "<:online:840231921123721237>Online";
break;
case "dnd":
status = "<:do_not_disturb:840231907715448842>Do Not Disturb";
break;
case "idle":
status = "<:idle:840231935485149184>Idle";
break;
case "offline":
status = "<:offline:840231954897305620>Offline";
break;
}
let x = Date.now() - member.user.createdAt;
let y =
// let status;
// switch (member.presence.status) {
// case "online":
// status = "<:online:840231921123721237>Online";
// break;
// case "dnd":
// status = "<:do_not_disturb:840231907715448842>Do Not Disturb";
// break;
// case "idle":
// status = "<:idle:840231935485149184>Idle";
// break;
// case "offline":
// status = "<:offline:840231954897305620>Offline";
// break;
// }
const x = Date.now() - member.user.createdAt;
const y =
Date.now() - interaction.guild.members.cache.get(member.id).joinedAt;
let created = Math.floor(x / 86400000);
let joined = Math.floor(y / 86400000);
let nickname =
const created = Math.floor(x / 86400000);
const joined = Math.floor(y / 86400000);
const nickname =
member.nickname !== undefined && member.nickname !== null
? member.nickname
: "None";
@ -66,39 +66,39 @@ module.exports = {
.map(role => role.toString())
.slice(0, -1);
const userFlags = member.user.flags.toArray();
let createdate = moment(member.user.createdAt).format(
const createdate = moment(member.user.createdAt).format(
"dddd, MMMM Do YYYY, HH:mm:ss"
);
let joindate = moment(member.joinedAt).format(
const joindate = moment(member.joinedAt).format(
"dddd, MMMM Do YYYY, HH:mm:ss"
);
let activities;
if (member.presence.activities[0] && member.presence.activities[1]) {
activities = member.presence.activities[1].name;
} else if (
member.presence.activities[0] &&
!member.presence.activities[1]
) {
activities = "None";
} else activities = "None";
// let activities;
// if (member.presence.activities[0] && member.presence.activities[1]) {
// activities = member.presence.activities[1].name;
// } else if (
// member.presence.activities[0] &&
// !member.presence.activities[1]
// ) {
// activities = "None";
// } else activities = "None";
const embed = new MessageEmbed()
.setAuthor(
member.user.tag,
member.user.displayAvatarURL({ dynamic: true, size: 2048 })
)
.setTimestamp()
.setColor(client.color)
.setColor(member.displayHexColor || client.color)
.setURL(client.web)
.setFooter(`Made by ${client.author}`)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setThumbnail(member.user.displayAvatarURL({ dynamic: true, size: 512 }))
.setColor(member.displayHexColor || "02023a")
.setColor(member.displayHexColor || client.color)
.addField(
"User",
`** Username:** ${member.user.username}
** Discriminator:** ${member.user.discriminator}
** Nickname:** ${nickname}
** ID:** ${member.id}
** Flags:** ${
** User ID:** ${member.id}
** Badge:** ${
userFlags.length
? userFlags.map(flag => flags[flag]).join(" **|** ")
: "None"
@ -108,10 +108,8 @@ module.exports = {
size: 2048,
})})
** Time Created:** ${createdate} \nSince ${created} day(s) ago
** Status:** ${status}
** Game:** ${activities}
\u200b`
)
) //* * Status:** ${status}* * Game:** ${activities}
.addField(
"Member",
`** Highest Role:** ${
@ -129,6 +127,6 @@ module.exports = {
}
\u200b`
);
await interaction.followUp({ embeds: [embed] });
interaction.followUp({ embeds: [embed] });
},
};

View file

@ -1,60 +0,0 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "announce",
UserPerm: ["MANAGE_MESSAGES"],
BotPerm: ["MANAGE_MESSAGES"],
usage: "{Channel} (Message)",
description: "Announce a message to a channel.",
category: "Moderation",
options: [
{
type: 7,
name: "channel",
description: "The channel to announce",
required: true,
},
{
type: 3,
name: "message",
description: "The message to announce",
required: true,
},
],
run: async (client, interaction, args) => {
const channel = interaction.guild.channels.cache.get(args[0]);
if (channel.type !== "GUILD_TEXT") {
return interaction.followUp({
content: "Please provide a text channel",
});
}
try {
channel.send({
embeds: [
new MessageEmbed()
.setAuthor(
`Sent by ${interaction.member.displayName}`,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setDescription(args[1])
.setTimestamp()
.setColor(client.color),
],
});
interaction.followUp({
embeds: [
new MessageEmbed()
.setTitle(`Message Announced`)
.addField("**Moderator**", interaction.user.tag, true)
.setTimestamp()
.setFooter(
interaction.member.displayName,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setColor(client.color),
],
});
} catch (e) {
console.log(e);
}
},
};

106
command/Moderation/ban.js Normal file
View file

@ -0,0 +1,106 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "ban",
description: "Ban an user",
BotPerms: ["BAN_MEMBERS"],
UserPerms: ["BAN_MEMBERS"],
usage: "(User) {Reason}",
category: "Moderation",
options: [
{
type: 6,
name: "user",
description: "The user you want to ban",
required: true,
},
{
type: 3,
name: "reason",
description: "The reason you want to ban",
required: false,
},
{
type: 4,
name: "messages",
description:
"Number of days of messages to delete, must be between 0 and 7, inclusive",
required: false,
},
],
run: async (client, interaction, args) => {
const target = interaction.guild.members.cache.get(args[0]);
let reason = args[1] || "No reason provided";
const days = args[2] || 0;
if (days > 7 || days < 0) {
interaction.followUp({
content:
"Number of days of messages to delete must be between 0 and 7, inclusive",
});
} else if (!target) {
try {
const one = await client.users.fetch(args[0]);
if (one.id === interaction.user.id) {
interaction.followUp({ content: "You can't ban yourself" });
}
if (reason.length > 1024) reason = reason.slice(0, 1021) + "...";
const embed = new MessageEmbed()
.setTitle("User Banned")
.addField("**Moderator**", interaction.user.tag, true)
.addField("**User**", one.tag, true)
.addField("**Reason**", reason, true)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
await interaction.guild.members.ban(one.id, {
reason,
days,
});
} catch (e) {
console.log(e);
}
} else {
if (target.id === interaction.user.id) {
interaction.followUp({ content: "You can't ban yourself" });
}
if (
interaction.member.roles.highest.position <
target.roles.highest.position
) {
interaction.followUp({ content: "You don't have enough hierarchy" });
}
if (
interaction.guild.me.roles.highest.position <
target.roles.highest.position
) {
interaction.followUp({ content: "Bot doesn't have enough hierarchy" });
}
if (reason.length > 1024) reason = reason.slice(0, 1021) + "...";
try {
const embed = new MessageEmbed()
.setTitle("User Banned")
.addField("**Moderator**", interaction.user.tag, true)
.addField("**User**", target.user.tag, true)
.addField("**Reason**", reason, true)
.addField(
"Number of days of messages to delete",
days.toString(),
true
)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
await interaction.guild.members.ban(target.id, {
reason,
days,
});
} catch (e) {
console.log(e);
interaction.followUp({ content: `**Error**: ${e.message}` });
}
}
},
};

View file

@ -0,0 +1,58 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "kick",
description: "Kick an user",
UserPerms: ["KICK_MEMBERS"],
BotPems: ["KICK_MEMBERS"],
usage: "(User) {Reason}",
category: "Moderation",
options: [
{
type: 6,
name: "user",
description: "The user you want to kick",
required: true,
},
{
type: 3,
name: "reason",
description: "The reason you want to kick",
required: false,
},
],
run: async (client, interaction, args) => {
const target = interaction.guild.members.cache.get(args[0]);
let reason = args[1] || "No reason provided";
if (target.id === interaction.user.id) {
interaction.followUp({ content: "You can't kick yourself" });
}
if (
interaction.member.roles.highest.position < target.roles.highest.position
) {
interaction.followUp({ content: "You don't have enough hierarchy" });
}
if (
interaction.guild.me.roles.highest.position <
target.roles.highest.position
) {
interaction.followUp({ content: "Bot doesn't have enough hierarchy" });
}
if (reason.length > 1024) reason = reason.slice(0, 1021) + "...";
try {
const embed = new MessageEmbed()
.setTitle("User Kicked")
.addField("**Moderator**", interaction.user.tag, true)
.addField("**User**", target.user.tag, true)
.addField("**Reason**", reason, true)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
await target.kick(reason);
} catch (e) {
console.log(e);
interaction.followUp({ content: `**Error**: ${e.message}` });
}
},
};

View file

@ -0,0 +1,53 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "lockdown",
description: "Lock a channel",
UserPerms: ["MANAGE_CHANNELS"],
BotPerms: ["MANAGE_CHANNELS"],
category: "Moderation",
options: [
{
type: 5,
name: "choice",
description: "Whether lock or unlock the channel",
required: true,
},
],
run: async (client, interaction, args) => {
if (args[0]) {
interaction.channel.permissionOverwrites
.create(interaction.guild.id, { SEND_MESSAGES: false })
.then(() => {
const embed = new MessageEmbed()
.setTitle("Channel Locked")
.addField("**Moderator**", interaction.user.tag, true)
.addField("**Channel**", `<#${interaction.channel.id}>`, true)
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
});
} else {
interaction.channel.permissionOverwrites
.create(interaction.guild.id, { SEND_MESSAGES: true })
.then(() => {
const embed = new MessageEmbed()
.setTitle("Channel Unlocked")
.addField("**Moderator**", interaction.user.tag, true)
.addField("**Channel**", `<#${interaction.channel.id}>`, true)
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
});
}
},
};

119
command/Moderation/mute.js Normal file
View file

@ -0,0 +1,119 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "mute",
description: "Mute an user.",
usage: "(User) (Time) {Reason}",
UserPerms: ["MANAGE_MESSAGES"],
BotPerms: ["MANAGE_ROLES"],
category: "Moderation",
options: [
{
type: 6,
name: "user",
description: "The user you want to mute",
required: true,
},
{
type: 3,
name: "reason",
description: "The reason you want to mute",
required: true,
},
{
type: 3,
name: "time",
description: "The time you want to mute",
required: false,
},
],
run: async (client, interaction, args, utils, data) => {
try {
const user = interaction.guild.members.cache.get(args[0]);
const reason = args[1];
const time = args[2] || "gg";
const mutedrole = interaction.guild.roles.cache.get(data.Guild.Muterole);
if (user.id === interaction.user.id) {
interaction.followUp({ content: "You can't mute yourself" });
}
if (
interaction.member.roles.highest.position < user.roles.highest.position
) {
interaction.followUp({ content: "You don't have enough hierarchy" });
}
if (
interaction.guild.me.roles.highest.position <
user.roles.highest.position
) {
interaction.followUp({ content: "Bot doesn't have enough hierarchy" });
}
if (reason.length > 1024) reason = reason.slice(0, 1021) + "...";
if (!utils.ms(time)) {
if (!mutedrole) {
const newrole = await interaction.guild.roles.create({
name: "Muted",
reason: "For muted people",
permissions: [],
});
await client.data.setMuterole(interaction.guild.id, newrole.id);
interaction.guild.channels.cache
.filter(c => c.type === "GUILD_TEXT")
.forEach(async channel => {
await channel.permissionOverwrites.create(newrole, {
SEND_MESSAGES: false,
ADD_REACTIONS: false,
});
});
} else {
await user.roles.add(mutedrole.id);
const embed = new MessageEmbed()
.setTitle("User Muted")
.addField("**Moderator**", interaction.user.tag, true)
.addField("**User**", user.user.tag, true)
.addField("**Reason**", reason, true)
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
}
} else if (!mutedrole) {
const newrole = await interaction.guild.roles.create({
name: "Muted",
reason: "For muted people",
permissions: [],
});
await client.data.setMuterole(interaction.guild.id, newrole.id);
interaction.guild.channels.cache
.filter(c => c.type === "GUILD_TEXT")
.forEach(async channel => {
await channel.permissionOverwrites.create(newrole, {
SEND_MESSAGES: false,
ADD_REACTIONS: false,
});
});
} else {
await user.roles.add(mutedrole.id);
const embed = new MessageEmbed()
.setTitle("User Muted")
.addField("**Moderator**", interaction.user.tag, true)
.addField("**User**", user.user.tag, true)
.addField("**Time**", utils.ms(utils.ms(time), { long: true }), true)
.addField("**Reason**", reason, true)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
setTimeout(async () => {
await user.roles.remove(mutedrole.id);
}, utils.ms(time));
}
} catch (e) {
console.log(e);
interaction.followUp({ content: `**Error**: ${e.message}` });
}
},
};

View file

@ -0,0 +1,67 @@
const { MessageAttachment } = require("discord.js");
module.exports = {
name: "nuke",
description: "Destroy a channel and create a new one",
usage: "{Channel}",
UserPerms: ["MANAGE_CHANNELS"],
BotPerms: ["MANAGE_CHANNELS"],
category: "Moderation",
run: async (client, interaction, args) => {
try {
const filter = m => m.author.id === interaction.user.id;
interaction.followUp({
content: "Do you want to nuke this channel?\n (Type `Yes` or `no`)",
});
interaction.channel
.awaitMessages({
filter,
max: 1,
time: 99999,
errors: ["time"],
})
.then(msg => {
const message = msg.first();
if (
message.content.toLowerCase() == "yes" ||
message.content.toLowerCase() == "y"
) {
const channel = message.guild.channels.cache.get(
message.channel.id
);
channel.clone().then(ch => {
if (channel.parent) {
ch.setParent(channel.parent.id);
} else {
}
ch.setPosition(channel.position);
channel.delete();
ch.send({
files: [
new MessageAttachment(
"https://i.pinimg.com/originals/06/c3/92/06c392b847166a9a671bfcd590d8fff7.gif"
),
],
content: "\nFriendly nuke has been launched.",
});
});
} else if (
message.content.toLowerCase() == "no" ||
message.content.toLowerCase() == "n"
) {
message.delete();
return message.channel.send({
content: "The process has been cancelled",
});
} else {
message.delete();
return message.channel.send({
content: `The process has been cancelled due to invalid response`,
});
}
});
} catch (e) {
console.log(e);
interaction.followUp({ content: `**Error**: ${e.message}` });
}
},
};

View file

@ -5,25 +5,25 @@ module.exports = {
description: "Clear messages in a specific channel",
options: [
{
name: 7,
name: "channel",
description: "Channel where the messages to be deleted",
type: "CHANNEL",
type: 7,
required: true,
channelTypes: ["GUILD_TEXT"],
},
{
name: 4,
name: "amount",
description: "Amount of message in range of 1-100 to be deleted",
type: "NUMBER",
type: 4,
required: true,
},
],
type: "CHAT_INPUT",
run: async (client, interaction, args) => {
try {
let query = interaction.options.get("amount");
let ch = interaction.options.get("channel");
let channel = interaction.guild.channels.cache.get(ch.value);
if (query.value > 100) {
const query = args[1];
const channel = interaction.guild.channels.cache.get(args[0]);
if (query > 100) {
return interaction.followUp({
content: "The amount of messages must be in range of 1-100",
});
@ -34,7 +34,7 @@ module.exports = {
});
}
const limit = await interaction.channel.messages.fetch({
limit: query.value,
limit: query,
});
await channel.bulkDelete(limit, true).then(async m => {
const results = {};
@ -57,11 +57,7 @@ module.exports = {
}`,
true
)
.addField(
"Amount of Message Deleted",
`${m.size}/${query.value}`,
true
)
.addField("Amount of Message Deleted", `${m.size}/${query}`, true)
.addField(
"Authors",
`${userMessageMap
@ -69,11 +65,12 @@ module.exports = {
.join("\n")}`,
false
)
.setTimestamp()
.setFooter(
interaction.member.nickname
? interaction.member.nickname
: interaction.user.username,
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.setTimestamp()
.setThumbnail(
interaction.user.displayAvatarURL({ dynamic: true })
)
.setColor(client.color),
@ -82,6 +79,7 @@ module.exports = {
});
} catch (e) {
console.log(e);
interaction.followUp({ content: `**Error**: ${e.message}` });
}
},
};

View file

@ -0,0 +1,59 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "role",
UserPerms: ["MANAGE_ROLES"],
BotPerms: ["MANAGE_ROLES"],
usage: "(Role) (User)",
description: "Add/Remove a role for an user",
category: "Moderation",
options: [
{
type: 6,
name: "user",
description: "The person you want to add/remove role",
required: true,
},
{
type: 8,
name: "role",
description: "The role you want to add/remove",
required: true,
},
],
run: async (client, interaction, args) => {
try {
const target = interaction.guild.members.cache.get(args[0]);
const role = interaction.guild.roles.cache.get(args[1]);
if (role.managed) {
interaction.followUp({ content: "You must provide a non bot role" });
} else if (target.roles.cache.has(role.id)) {
const embed = new MessageEmbed()
.setTitle("Role Removed")
.addField("**Moderator**", interaction.user.tag, true)
.addField("**User**", target.user.tag, true)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
.setColor(client.color);
interaction
.followUp({ embeds: [embed] })
.then(await target.roles.remove(role.id));
} else {
const embed = new MessageEmbed()
.setTitle("Role Added")
.addField("**Moderator**", interaction.user.tag, true)
.addField("**User**", target.user.tag, true)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
.setColor(client.color);
interaction
.followUp({ embeds: [embed] })
.then(await target.roles.add(role.id));
}
} catch (e) {
console.log(e);
interaction.followUp({ content: `**Error**: ${e.message}` });
}
},
};

View file

@ -3,7 +3,7 @@ module.exports = {
name: "slowmode",
UserPerms: ["MANAGE_CHANNELS"],
description: "Set slowmode at a specific channel",
BotPerm: "MANAGE_CHANNELS",
BotPerms: ["MANAGE_CHANNELS"],
usage: "(Time)",
category: "Moderation",
run: async (client, interaction, args, utils) => {
@ -31,7 +31,7 @@ module.exports = {
const slowmoEmbed = new Discord.MessageEmbed()
.setColor(client.color)
.setTitle("Slowmode")
.setFooter(`Made by ${client.author}`)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setAuthor(
`Requested by ${interaction.user.tag}`,

View file

@ -0,0 +1,34 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "unban",
description: "Unban an user",
UserPerms: ["BAN_MEMBERS"],
BotPerms: ["BAN_MEMBERS"],
usage: "(User)",
category: "Moderation",
options: [
{
type: 6,
name: "user",
description: "The person you want to unban",
required: true,
},
],
run: async (client, interaction, args) => {
try {
const user = await interaction.guild.members.unban(args[0]);
const embed = new MessageEmbed()
.setTitle("User Unbanned")
.addField("**Moderator**", interaction.user.tag, true)
.addField("**User**", user.tag, true)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
} catch (e) {
console.log(e);
interaction.followUp({ content: `**Error**: ${e.message}` });
}
},
};

View file

@ -0,0 +1,39 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "unmute",
UserPerms: ["MANAGE_MESSAGES"],
BotPerms: ["MANAGE_ROLES"],
usage: "(User)",
description: "Unmute an user",
category: "Moderation",
options: [
{
type: 6,
name: "user",
description: "The user you want to unmute",
required: true,
},
],
run: async (client, interaction, args, utils, data) => {
try {
const user = interaction.guild.members.cache.get(args[0]);
const mutedrole = interaction.guild.roles.cache.get(data.Guild.Muterole);
if (!mutedrole) {
interaction.followUp({ content: "Mute role not found in database" });
}
await user.roles.remove(mutedrole);
const embed = new MessageEmbed()
.setTitle("User Unmuted")
.addField("**Moderator**", interaction.user.tag, true)
.addField("**User**", user.user.tag, true)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
} catch (e) {
console.log(e);
interaction.followUp({ content: `**Error**: ${e.message}` });
}
},
};

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