Compare commits

..

No commits in common. "main" and "rock-dev" have entirely different histories.

226 changed files with 26474 additions and 27395 deletions

View file

@ -2,4 +2,9 @@ TOKEN =
MONGO = mongodb://127.0.0.1:27017/test MONGO = mongodb://127.0.0.1:27017/test
mongo = mongo =
cathmongo = cathmongo =
SPOTIFY_ID =
SPOTIFY_SECRET =
host = lavalink.darrennathanael.com
port = 2095
password = whatwasthelastingyousaid
api = http://api.cath.gq api = http://api.cath.gq

2
.gitattributes vendored Normal file
View file

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

View file

@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our Examples of behavior that contributes to a positive environment for our
community include: community include:
- Demonstrating empathy and kindness toward other people * Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences * Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback * Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, * Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience and learning from the experience
- Focusing on what is best not just for us as individuals, but for the * Focusing on what is best not just for us as individuals, but for the
overall community overall community
Examples of unacceptable behavior include: Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or * The use of sexualized language or imagery, and sexual attention or
advances of any kind advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks * Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment * Public or private harassment
- Publishing others' private information, such as a physical or email * Publishing others' private information, such as a physical or email
address, without their explicit permission address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a * Other conduct which could reasonably be considered inappropriate in a
professional setting professional setting
## Enforcement Responsibilities ## Enforcement Responsibilities
@ -59,7 +59,7 @@ representative at an online or offline event.
## Enforcement ## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at our [Discord Server](https://discord.gg/SbQHChmGcp) to **Night** or **Thunder**. reported to the community leaders responsible for enforcement at our [Discord Server](https://discord.com/invite/SR7TeNJG67) to **Night** or **Thunder**.
All complaints will be reviewed and investigated promptly and fairly. All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the All community leaders are obligated to respect the privacy and security of the
@ -105,7 +105,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban ### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community **Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals. individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within **Consequence**: A permanent ban from any sort of public interaction within

View file

@ -1,5 +1,5 @@
<h1 align="center">Contributing</h1> <h1 align="center">Contributing</h1>
When contributing to this repository, please first discuss the change you wish to make via issue or on our [discord server](https://discord.gg/SbQHChmGcp). When contributing to this repository, please first discuss the change you wish to make via issue or on our [discord server](https://discord.com/invite/SR7TeNJG67).
Please note we have a [code of conduct](/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project. Please note we have a [code of conduct](/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.

View file

@ -1,5 +0,0 @@
We know that users take their privacy seriously, so are us, therefore please read our **Privacy Policy**
We only collect data that is necessary for the bot to function properly, such as the user's ID and server's ID. We do not collect any other data, such as messages, voice data, or any other data that is not necessary for the bot to function properly. All your data is collected legally and stored securely in our database. You can also request to delete the data but we will not be able to delete the data that is necessary for the bot to function properly.
**We do not share or sell your personal data to any third party.**

50
.github/README.md vendored
View file

@ -1,14 +1,17 @@
<h1 align="center"> NYX [Cath.exe] </h1> <h1 align="center"> NYX [Cath.exe] </h1>
<!-- header --> <!-- header -->
<p align="center"> <p align="center">
<a href="https://discord.gg/SbQHChmGcp" target="_blank"><img alt="NYX_banner" src = "https://media.discordapp.net/attachments/896078559293104128/896091759157858394/nyx_banner_3d.png?width=1341&height=447"></a> <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> <br>
<a href="https://discord.com/oauth2/authorize?client_id=1071021943484055563&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://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://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://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> <br> <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&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> <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>
<img src ="https://forthebadge.com/images/badges/built-with-love.svg" width = "122">
</p> </p>
<p align = "center"> <p align = "center">
@ -18,9 +21,7 @@
<!-- description --> <!-- description -->
**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> **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 **Stats on Duty** & **Round Table**<br> The Call of Duty Stats are courtesy of **Round Table** by Cygnoux Familia.<br><br>
🔺 **Apex Legends Commands** will be added soon, the player stats command will be added after the global launch when the API supports it.
<br><br>
If you like this bot, feel free to :star: **Star** this repository.<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 > ⚠ The Verifed bot instance is current called Cath.exe, we are working on getting it changed
@ -42,31 +43,24 @@ If you like this bot, feel free to :star: **Star** this repository.<br>
## <img height="18px" src="../util/assets/images/cod_logo.svg"> **Call of Duty Mobile** ## <img height="18px" src="../util/assets/images/cod_logo.svg"> **Call of Duty Mobile**
- **Weapon Statistics** courtesy of **Round Table** & **Stats On Duty** - **Weapon Statistics** courtesy of **Lighthouse v2.1**
- **Currated Gunsmith Builds** by various content creators like Jokesta, dHitman, Path.exe, Stats On Duty and more comming soon. > Will soon be using stats provided by **Stats On Duty**.
- **Currated Gunsmith Builds** by various content creators like Jokesta, dHitman, Path.exe and more comming soon.
- **Perks** detailed info about the perks. - **Perks** detailed info about the perks.
- **Scorestreak** detailed info about scorestreak with preview videos. - **Scorestreak** detailed info about scorestreak with preview videos.
- **Randomly Generated Class** Wanna try something challenging? try our Randomly Generated Gunsmith builds. - **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. > 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.
## <img height="16px" src="../util/assets/images/apex/apex-legends-logo-white.svg"> **Apex Legends Mobile**
> ⚠ _Coming Soon™_
- **Player Stats** view your in-game stats. <!-- if they support mobile for the stats api -->
- **Legends** detailed info about legends & their abilities.
- **Guns** detailed info about guns.
- **Random Combos** Wanna try something challenging? try to win a game with a random selected legend & Gun combination
- _& many more, coming soon!_
## 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) [![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.exe/badge?s=57e6f566f73892f4303edbfeb2fe3ea0b849c876&style=for-the-badge)](https://www.codefactor.io/repository/github/night0721/cath.exe) [![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)
[YouTube Deployment video](https://www.youtube.com/watch?v=9Dmtuv6tlTE) <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>
<details> A detailed Deployment guide can be found [here](https://thunder75.gitbook.io/cath-bot/deployment).
<!-- <details>
<summary>Made With</summary> <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) [![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)
@ -79,10 +73,13 @@ If you like this bot, feel free to :star: **Star** this repository.<br>
<details> <details>
<summary>Github Stats</summary> <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) ![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) [![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> </details> -->
<h1 align = "center"> Support, Feature Request & Bug Reports </h1> <h1 align = "center"> Support, Feature Request & Bug Reports </h1>
@ -105,5 +102,12 @@ Contributions are always welcomed, but make sure to read [Contributing.md](/CONT
![Contributors](https://badges.pufler.dev/contributors/night0721/cath.exe?bots=false) ![Contributors](https://badges.pufler.dev/contributors/night0721/cath.exe?bots=false)
<!-- ## Special Thanks to The Roound Table from Cygnoux Familia.
<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"> <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"> -->

5
.github/TOS.md vendored
View file

@ -1,5 +0,0 @@
**Terms of Service**
Please make sure you follow Discord's Terms of Service when using this bot. If you do not follow the ToS, you will be blacklisted and banned from using the bot. You could appeal to the action but it is not guaranteed that you will be unbanned.
For privacy policy, please check out our privacy policy.

2
.replit Normal file
View file

@ -0,0 +1,2 @@
"language"="nodejs"
"run"="node_modules/.bin/node index.js"

View file

@ -1,4 +1,4 @@
const { EmbedBuilder } = require("discord.js"); //@night0721 You need to make this const { MessageEmbed } = require("discord.js"); //@night0721 You need to make this
const items = require("../../util/Data/loadout.json"); const items = require("../../util/Data/loadout.json");
module.exports = { module.exports = {
name: "class", name: "class",
@ -21,13 +21,13 @@ module.exports = {
// slot_3 = slots.next().value, // slot_3 = slots.next().value,
// slot_4 = slots.next().value, // slot_4 = slots.next().value,
// slot_5 = slots.next().value; // slot_5 = slots.next().value;
const result = new EmbedBuilder() const result = new MessageEmbed()
.setColor(client.color) .setColor(client.color)
.setFooter({ text: `Made by ${client.author}` }) .setFooter(`Made by ${client.author}`)
.setURL(client.web) .setURL(client.web)
.setTitle(`🎲 A Randomly Generated Loadout 🎲`) .setTitle(`🎲 A Randomly Generated Loadout 🎲`)
.setDescription( .setDescription(
`This loadout is a randomly generated, Also try, \`/class\` to get a randomally generated primary weapon gunsmith build` `This loadout is a randomly generated, Also try, \`\`\`\`/gun\`\`\`\` to get a randomally generated primary weapon gunsmith build`
) )
.addFields( .addFields(
{ {
@ -46,17 +46,17 @@ module.exports = {
inline: true, inline: true,
}, },
{ {
name: `🔴 Red Perk`, name: `Red Perk`,
value: ``, value: ``,
inline: true, inline: true,
}, },
{ {
name: `🟢 Green Perk`, name: `Green Perk`,
value: ``, value: ``,
inline: true, inline: true,
}, },
{ {
name: `🔵 Blue Perk`, name: `Blue Perk`,
value: ``, value: ``,
inline: true, inline: true,
} }

View file

@ -1,4 +1,5 @@
const { EmbedBuilder } = require("discord.js"); const { MessageEmbed } = require("discord.js");
const moment = require("moment");
const axios = require("axios"); const axios = require("axios");
module.exports = { module.exports = {
name: "stats", name: "stats",
@ -7,7 +8,7 @@ module.exports = {
category: "CODM", category: "CODM",
options: [ options: [
{ {
type: 1, type: "SUB_COMMAND",
name: "assault_rifle", name: "assault_rifle",
description: "Get a Stats for Assault Rifle", description: "Get a Stats for Assault Rifle",
options: [ options: [
@ -106,7 +107,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "sub_machine_gun", name: "sub_machine_gun",
description: "Get a Stats for Sub Machine Gun", description: "Get a Stats for Sub Machine Gun",
options: [ options: [
@ -189,7 +190,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "sniper_rifle", name: "sniper_rifle",
description: "Get a Stats for Sniper Rifle", description: "Get a Stats for Sniper Rifle",
options: [ options: [
@ -240,7 +241,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "light_machine_gun", name: "light_machine_gun",
description: "Get a Stats for Light Machine Gun", description: "Get a Stats for Light Machine Gun",
options: [ options: [
@ -287,7 +288,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "shotgun", name: "shotgun",
description: "Get a Stats for Shotgun", description: "Get a Stats for Shotgun",
options: [ options: [
@ -325,16 +326,12 @@ module.exports = {
name: "R9-0", name: "R9-0",
value: "E07", value: "E07",
}, },
{
name: "JAK-12",
value: "E08",
},
], ],
}, },
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "marksman_rifle", name: "marksman_rifle",
description: "Get a Stats for Marksman Rifle", description: "Get a Stats for Marksman Rifle",
options: [ options: [
@ -365,7 +362,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "pistol", name: "pistol",
description: "Get a Stats for Pistol", description: "Get a Stats for Pistol",
options: [ options: [
@ -405,7 +402,7 @@ module.exports = {
}, },
], ],
// It's not complete, Still work in progress. // It's not complete, Still work in progress.
run: async (client, interaction, args, utils) => { run: async (client, interaction, args) => {
const cwts = args[1]; const cwts = args[1];
const data = await axios const data = await axios
.get(`${process.env.api}/api/v1/codm/builds?cwts=${cwts}`, { .get(`${process.env.api}/api/v1/codm/builds?cwts=${cwts}`, {
@ -413,22 +410,26 @@ module.exports = {
Authorization: process.env.CODM_API_KEY, Authorization: process.env.CODM_API_KEY,
}, },
}) })
.then(res => res.data) .then((res) => res.data)
.catch(e => null); .catch((e) => null);
if (!data?.ID) { if (!data?.ID) {
const embed = new EmbedBuilder() const embed = new MessageEmbed()
.setDescription( .setDescription(
`<:nyx_not_available:897378400031879188> Sorry, We currently don't have Stats for this Weapon` `<:nyx_not_available:897378400031879188> Sorry, We currently don't have Stats for this Weapon`
) )
.setColor(client.color); .setColor(client.color);
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
} else { } else {
const embed = new EmbedBuilder() const embed = new MessageEmbed()
.setTitle(`${data.author} Statistical Breakdown`) .setTitle(
`${data.author} Statistical Breakdown`
)
.setColor(16580400) .setColor(16580400)
.setImage(data.imageUrl) .setImage(data.imageUrl)
.setFooter({ text: `Stats Curtosy of Round Table` }) .setFooter(
`Stats Curtosy of Round Table`,
)
// .setFooter( // .setFooter(
// `Stats Curtosy of Stats on Duty`, // `Stats Curtosy of Stats on Duty`,
// ) // )
@ -443,8 +444,8 @@ module.exports = {
}, },
{ {
name: "<a:lastupdate:897381474330873887> Last Updated:", name: "<a:lastupdate:897381474330873887> Last Updated:",
value: `\`\`\`\n${utils.parseShortDate( value: `\`\`\`\n${moment(Date.parse(data.lastUpdate)).format(
new Date(data.lastUpdate) "MMMM Do YYYY"
)}\n\`\`\``, )}\n\`\`\``,
inline: true, inline: true,
}, },
@ -500,6 +501,8 @@ module.exports = {
// @night0721 Damage profile will be avalable by different command // @night0721 Damage profile will be avalable by different command
// recoilAvailable = false; // recoilAvailable = false;
// hasError = false; // hasError = false;
// console.log(args); // console.log(args);
@ -520,6 +523,7 @@ module.exports = {
// }, // },
// } // }
// run: async (client, interaction, args) => { // run: async (client, interaction, args) => {
// recoilAvailable = false; // recoilAvailable = false;
// hasError = false; // hasError = false;

View file

@ -1,6 +1,6 @@
const common = require("../../util/functions/common"); const common = require("../util/functions/common");
const data = require("../../util/Data/data.json"); const data = require("../util/Data/data.json");
const { EmbedBuilder } = require("discord.js"); const Discord = require("discord.js");
let currGun, let currGun,
currStats, currStats,
@ -11,68 +11,35 @@ let currGun,
recoilAvailable, recoilAvailable,
chart, chart,
hasError; hasError;
const errMsg = "*Generic placeholder error message*";
module.exports = { module.exports = {
name: "stats", name: "stats",
description: "Check gun statistics", description: "Check gun stats",
usage: "(Gun)", usage: "(Gun)",
category: "CODM", category: "CODM",
options: [ /**
{ * @param {Client} client
type: 3, * @param {Message} message
name: "gun_name", * @param {String[]} args
description: "Name of the gun", */
required: true, run: async (client, message, args) => {
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) => {
repEmb = null;
recoilAvailable = false; recoilAvailable = false;
hasError = false; hasError = false;
if (args.length == 1) const repEmb = statsHandler(args.join(" ").replace("\n", " "));
repEmb = statsHandler(args.join(" ").replace("\n", " "));
else repEmb = statsHandler(args.join(" + ").replace("\n", " "));
if (hasError) { if (hasError) {
interaction.followUp({ message.reply({ embeds: [repEmb] });
content: `**${repEmb || "An error has occured"}**`,
});
} else {
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: [new EmbedBuilder(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] });
}, },
}; };
@ -82,38 +49,38 @@ function inpHandler(inpmsg) {
function statsHandler(inpmsg) { function statsHandler(inpmsg) {
let statsNames = [ let statsNames = [
"Pellets", //0 "Pellets",
"Detonation Range", //1 "Detonation Range",
"Explosion Radius", //2 "Explosion Radius",
"Explosion Damage", //3 "Explosion Damage",
"Firing Mode", //4 "Firing Mode",
"Rate of Fire", //5 "Rate of Fire",
"Bullet in Burst", //6 "Bullet in Burst",
"Time Between Burst", //7 "Time Between Burst",
"Bullet Speed", //8 "Bullet Speed",
"Penetration Level", //9 "Penetration Level",
"Bullet Spread", //10 "Bullet Spread",
"Idle Sway", //11 "Idle Sway",
"Hipfire Pellet Spread", //12 "Hipfire Pellet Spread",
"ADS Pellet Spread", //13 "ADS Pellet Spread",
"ADS Time", //14 "ADS Time",
"Sprint-to-Fire Time", //15 "Sprint-to-Fire Time",
"ADS Zoom", //16 "ADS Zoom",
"Magazine", //17 "Magazine",
"Reserve", //18 "Reserve",
"Reload Type", //19 "Reload Type",
"Cancel Reload Time", //20 "Cancel Reload Time",
"Reload Time", //21 "Reload Time",
"Full Reload Time", //22 "Full Reload Time",
"Drop Time", //23 "Drop Time",
"Raise Time", //24 "Raise Time",
"Sprinting Speed", //25 "Sprinting Speed",
"Walking Speed", //26 "Walking Speed",
"Straifing Speed", //27 "Straifing Speed",
"Damage per Tick", //28 "Damage per Tick",
"Number of Ticks", //29 "Number of Ticks",
"Time Between Ticks", //30 "Time Between Ticks",
"Breath Hold Time", //31 "Breath Hold Time",
"shouldNeverHappen0", "shouldNeverHappen0",
"shouldNeverHappen1", "shouldNeverHappen1",
"shouldNeverHappen2", "shouldNeverHappen2",
@ -128,7 +95,7 @@ function statsHandler(inpmsg) {
return currGun; return currGun;
} }
currStats = currGun.stats; currStats = currGun.stats;
currDRM = currGun.drm[0]; // base mag. currGun.drm[1] for more vairents currDRM = currGun.drm[0];
currAttachments = []; currAttachments = [];
currAttachments = common.attachmentsIdentifier(inpmsg, currGun); currAttachments = common.attachmentsIdentifier(inpmsg, currGun);
if (typeof currAttachments == "string") { if (typeof currAttachments == "string") {
@ -188,8 +155,8 @@ function statsHandler(inpmsg) {
inpIndx = inpIndx.filter(x => outReady[x]); inpIndx = inpIndx.filter(x => outReady[x]);
return inpIndx.length return inpIndx.length
? { ? {
name: `**${inpName}**`, name: "**" + inpName + "**",
value: `\`\`\`\n${inpIndx.map(x => outReady[x]).join("\n")}\`\`\``, value: "```\n" + inpIndx.map(x => outReady[x]).join("\n") + "```",
} }
: ""; : "";
} }
@ -220,17 +187,17 @@ function statsHandler(inpmsg) {
function addUnit(j) { function addUnit(j) {
switch (j) { switch (j) {
case 7: case 07:
case 14: case 14:
case 15: case 15:
case 23: case 23:
case 24: case 24:
case 31: case 31:
return " ms"; return " ms";
case 25:
case 26:
case 27: case 27:
case 28: case 28:
case 25:
case 26:
return " m/s"; return " m/s";
case 20: case 20:
case 21: case 21:
@ -238,9 +205,9 @@ function statsHandler(inpmsg) {
return " s"; return " s";
case 16: case 16:
return "%"; return "%";
case 6: case 06:
return " Rounds"; return " Rounds";
case 5: case 05:
return " RPM"; return " RPM";
default: default:
return ""; return "";
@ -257,11 +224,16 @@ function statsHandler(inpmsg) {
currRecoilArr[2] currRecoilArr[2]
); );
recoilAvailable = true; recoilAvailable = true;
} else recoilAvailable = false; } else {
recoilAvailable = false;
if (chart == "none") recoilAvailable = false; }
if (chart == "err") hasError = true; if (chart == "none") {
recoilAvailable = false;
}
if (chart == "err" || currAttachments == "err") {
hasError = true;
return "Cocaineeee";
}
const dmg = const dmg =
common.damageHandler( common.damageHandler(
currDRM.damage, currDRM.damage,
@ -277,7 +249,7 @@ function statsHandler(inpmsg) {
currGun.description currGun.description
? { ? {
name: "**Description:**", name: "**Description:**",
value: `\`\`\`\n${currGun.description}\`\`\``, value: "```\n" + currGun.description + "```",
} }
: {}, : {},
{ name: "**Damage Profile:**", value: dmg }, { name: "**Damage Profile:**", value: dmg },
@ -289,9 +261,10 @@ function statsHandler(inpmsg) {
color: 5814783, color: 5814783,
fields: out, fields: out,
footer: { footer: {
text: "[OUTDATED] All data courtesy of Project Lighthouse 2.0 and CoDM Research Crew", text: "All data courtesy of Project Lighthouse and CoDM Research Crew",
icon_url: icon_url:
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png", "https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
}, },
}; };
} }
// console.log(statsHandler("Holger").fields);

1111
LICENSE

File diff suppressed because it is too large Load diff

1
Procfile Normal file
View file

@ -0,0 +1 @@
worker: node index.js

21
app.json Normal file
View file

@ -0,0 +1,21 @@
{
"name": "NYX - CODM Bot",
"description": "Host cath.exe through Heroku",
"keywords": ["bot", "nyx", "codm", "discord", "gunsmith"],
"repository": "https://github.com/night0721/cath.exe",
"env": {
"TOKEN": {
"description": "Bot Token from https://discord.com/developers/applications",
"value": ""
},
"MONGO": {
"description": "MongoDB URI from https://mongodb.com/",
"value": ""
}
},
"buildpacks": [
{
"url": "heroku/nodejs"
}
]
}

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

View file

@ -1,11 +1,8 @@
const { const { Client, Collection, MessageEmbed } = require("discord.js");
Client, const { Manager } = require("erela.js");
Collection,
EmbedBuilder,
GatewayIntentBits,
Partials,
} = require("discord.js");
const config = require("../config"); const config = require("../config");
const Spotify = require("erela.js-spotify");
const utils = require("../util/functions/function");
require("dotenv").config(); require("dotenv").config();
class NYX extends Client { class NYX extends Client {
@ -18,31 +15,23 @@ class NYX extends Client {
activities: [ activities: [
{ {
name: `/help`, name: `/help`,
type: 1, type: "STREAMING",
url: "https://www.youtube.com/watch?v=YSKDu1gKntY", url: "https://www.youtube.com/watch?v=YSKDu1gKntY",
}, },
], ],
}, },
shards: "auto", shard: "auto",
partials: [ restTimeOffset: 0,
Partials.Message, restRequestTimeout: 99999,
Partials.Channel, partials: ["MESSAGE", "CHANNEL", "REACTION", "GUILD_MEMBER"],
Partials.Reaction, intents: 24207,
Partials.GuildMember,
],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
// GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.DirectMessageTyping,
GatewayIntentBits.DirectMessages,
],
} }
) { ) {
super(options); super(options);
this.slashCommands = new Collection(); this.slashCommands = new Collection();
this.hide = new Collection(); this.hide = new Collection();
this.esnipes = new Collection();
this.snipes = new Collection();
this.config = config; this.config = config;
this.data = require("../util/functions/mongoose"); this.data = require("../util/functions/mongoose");
this.color = config.color; this.color = config.color;
@ -55,47 +44,105 @@ class NYX extends Client {
"534027706325532694", // Cat drinking a cat "534027706325532694", // Cat drinking a cat
"381442059111759883", // Thunder "381442059111759883", // Thunder
"556808365574193194", // chunchunmaru "556808365574193194", // chunchunmaru
"687622268037365774", // Tac Shadow "746753527338238115", // mightyful
"309681798957498368", // Sideload
"707177879984668673", // Random rock
"757530324686340197", // Madhav
"804712098625486848", // hcs
"1078015817184182414", // gaba
"774390900411465769", // Alphaus
]; ];
this.currency = "<:nyx_currency:918584872333893703>"; this.currency = "<:nyx_currency:918584872333893703>";
this.xp = "<:nyx_xp:900309007472926720>"; this.xp = "<:nyx_xp:900309007472926720>";
this.dev = "<:discord_bot_dev:840231906200387666>";
this.path = [ this.path = [
"614423108388126731", // Camper on Duty "614423108388126731", // Camper on Duty
"767173194943168542", // Dark Bonker "767173194943168542", // Dark Bonker
"718762019586572341", // NYX Nation "718762019586572341", // NYX Nation
"840225563193114624", // Command Test "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() { start() {
require("../util/dist/handler")(this); require("../util/dist/handler")(this);
this.login(
process.argv[2] == "--dev" ? process.env.DEV : process.env.TOKEN
);
this.data this.data
.connect(process.env.MONGO) .connect(process.env.MONGO)
.then(() => console.log("Connected to MongoDB ✅")) .then(() => console.log("Connected to MongoDB ✅"))
.catch(e => console.log(e)); .catch(e => console.log(e));
this.login(process.env.TOKEN);
} }
err(interaction, error) { err(c, e) {
const embed = new EmbedBuilder() const embed = new MessageEmbed()
.setTitle("An Error Occured") .setTitle("An Error Occured")
.setColor("Red") .setColor("RED")
.setDescription(`❌ | ${error}`) .setDescription(`❌ | ${e}`)
.setTimestamp() .setTimestamp()
.setFooter({ .setFooter(`Made by ${this.author}`, this.user.displayAvatarURL());
text: `Made by ${this.author}`, c.followUp({ embeds: [embed] });
iconURL: this.user.displayAvatarURL({ dynamic: true }), }
}); se(c, e) {
interaction.channel.send({ embeds: [embed] }); const embed = new MessageEmbed()
this.channels.cache.get(this.config.ErrorLog).send({ embeds: [embed] }); .setColor(this.color)
.setDescription(e)
.setTimestamp();
c.followUp({ embeds: [embed] });
} }
} }

View file

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

2
client/URLClient.js Normal file
View file

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

View file

@ -1,13 +1,15 @@
const { Client, CommandInteraction, EmbedBuilder } = require("discord.js"); const { MessageEmbed } = require("discord.js");
const moment = require("moment");
const axios = require("axios"); const axios = require("axios");
module.exports = { module.exports = {
name: "build", name: "build",
description: "Get gunsmith builds", description: "Get gunsmith builds",
usage: "[Weapon Name] [Author] [Tag]", usage: "[Weapon Name] [Author] [Tag]",
type: "CHAT_INPUT",
category: "CODM", category: "CODM",
options: [ options: [
{ {
type: 1, type: "SUB_COMMAND",
name: "assault_rifle", name: "assault_rifle",
description: "Get a gunsmith build for a Assault Rifle", description: "Get a gunsmith build for a Assault Rifle",
options: [ options: [
@ -115,11 +117,11 @@ module.exports = {
}, },
{ {
name: "Jokesta", name: "Jokesta",
value: "Jokesta", value: "jokesta",
}, },
// { // {
// name: "Stats On Duty", // name: "Stats On Duty",
// value: "Stats On Duty", // value: "sod",
// }, // },
], ],
}, },
@ -131,11 +133,11 @@ module.exports = {
choices: [ choices: [
{ {
name: "Aggressive", name: "Aggressive",
value: "Aggressive", value: "aggressive",
}, },
{ {
name: "Passive", name: "Passive",
value: "Passive", value: "passive",
}, },
{ {
name: "Search And Destroy", name: "Search And Destroy",
@ -143,14 +145,14 @@ module.exports = {
}, },
{ {
name: "Respawn", name: "Respawn",
value: "Respawn", value: "respawn",
}, },
], ],
}, },
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "sub_machine_gun", name: "sub_machine_gun",
description: "Get a gunsmith build for a Sub Machine Gun", description: "Get a gunsmith build for a Sub Machine Gun",
options: [ options: [
@ -242,7 +244,7 @@ module.exports = {
}, },
{ {
name: "Jokesta", name: "Jokesta",
value: "Jokesta", value: "jokesta",
}, },
], ],
}, },
@ -254,11 +256,11 @@ module.exports = {
choices: [ choices: [
{ {
name: "Aggressive", name: "Aggressive",
value: "Aggressive", value: "aggressive",
}, },
{ {
name: "Passive", name: "Passive",
value: "Passive", value: "passive",
}, },
{ {
name: "Search And Destroy", name: "Search And Destroy",
@ -266,14 +268,14 @@ module.exports = {
}, },
{ {
name: "Respawn", name: "Respawn",
value: "Respawn", value: "respawn",
}, },
], ],
}, },
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "sniper_rifle", name: "sniper_rifle",
description: "Get a gunsmith build for a Sniper Rifle", description: "Get a gunsmith build for a Sniper Rifle",
options: [ options: [
@ -341,11 +343,11 @@ module.exports = {
choices: [ choices: [
{ {
name: "Aggressive", name: "Aggressive",
value: "Aggressive", value: "aggressive",
}, },
{ {
name: "Passive", name: "Passive",
value: "Passive", value: "passive",
}, },
{ {
name: "Search And Destroy", name: "Search And Destroy",
@ -353,14 +355,14 @@ module.exports = {
}, },
{ {
name: "Respawn", name: "Respawn",
value: "Respawn", value: "respawn",
}, },
], ],
}, },
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "light_machine_gun", name: "light_machine_gun",
description: "Get a gunsmith build for a Light Machine Gun", description: "Get a gunsmith build for a Light Machine Gun",
options: [ options: [
@ -424,11 +426,11 @@ module.exports = {
choices: [ choices: [
{ {
name: "Aggressive", name: "Aggressive",
value: "Aggressive", value: "aggressive",
}, },
{ {
name: "Passive", name: "Passive",
value: "Passive", value: "passive",
}, },
{ {
name: "Search And Destroy", name: "Search And Destroy",
@ -436,14 +438,14 @@ module.exports = {
}, },
{ {
name: "Respawn", name: "Respawn",
value: "Respawn", value: "respawn",
}, },
], ],
}, },
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "shotgun", name: "shotgun",
description: "Get a gunsmith build for a Shotgun", description: "Get a gunsmith build for a Shotgun",
options: [ options: [
@ -481,10 +483,6 @@ module.exports = {
name: "R9-0", name: "R9-0",
value: "E07", value: "E07",
}, },
{
name: "JAK-12",
value: "E08",
},
], ],
}, },
{ {
@ -511,18 +509,18 @@ module.exports = {
choices: [ choices: [
{ {
name: "ADS", name: "ADS",
value: "ADS", value: "ads",
}, },
{ {
name: "Hipfire", name: "Hipfire",
value: "Hipfire", value: "hipfire",
}, },
], ],
}, },
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "marksman_rifle", name: "marksman_rifle",
description: "Get a gunsmith build for a Marksman Rifle", description: "Get a gunsmith build for a Marksman Rifle",
options: [ options: [
@ -560,10 +558,10 @@ module.exports = {
name: "path.exe", name: "path.exe",
value: "path.exe", value: "path.exe",
}, },
{ // {
name: "Stats On Duty", // name: "Stats On Duty",
value: "Stats On Duty", // value: "sod",
}, // },
], ],
}, },
{ {
@ -574,22 +572,22 @@ module.exports = {
choices: [ choices: [
{ {
name: "Aggressive", name: "Aggressive",
value: "Aggressive", value: "aggressive",
}, },
{ {
name: "Passive", name: "Passive",
value: "Passive", value: "passive",
}, },
{ {
name: "Respawn", name: "Respawn",
value: "Respawn", value: "respawn",
}, },
], ],
}, },
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "pistol", name: "pistol",
description: "Get a gunsmith build for a Pistol", description: "Get a gunsmith build for a Pistol",
options: [ options: [
@ -637,7 +635,7 @@ module.exports = {
}, },
// { // {
// name: "Stats On Duty", // name: "Stats On Duty",
// value: "Stats On Duty", // value: "sod",
// }, // },
], ],
}, },
@ -649,20 +647,14 @@ module.exports = {
choices: [ choices: [
{ {
name: "Respawn", name: "Respawn",
value: "Respawn", value: "respawn",
}, },
], ],
}, },
], ],
}, },
], ],
/** run: async (client, interaction, args) => {
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
*/
run: async (client, interaction, args, utils) => {
const cwts = args[1]; const cwts = args[1];
const cc = args[2]; const cc = args[2];
const tag = args[3]; const tag = args[3];
@ -677,33 +669,44 @@ module.exports = {
) )
.then(res => res.data) .then(res => res.data)
.catch(e => null); .catch(e => null);
console.log(data); var all = {
"path.exe": "path.exe",
dhitman: "dHitman",
jokesta: "Jokesta",
// littleb:"Little B",
aggressive: "Aggressive",
passive: "Passive",
"Search And Destroy": "Search And Destroy",
respawn: "respawn",
ads: "ADS",
hipfire: "Hipfire",
};
if (!data?.cwts) { if (!data?.cwts) {
const embed = new EmbedBuilder() const embed = new MessageEmbed()
.setDescription( .setDescription(
`<:nyx_not_available:897378400031879188> We don't have a **${tag}** gunsmith build for the gun with **CWTS 🆔 ${cwts}** by **${cc}**, Please try another tag or a differnt content creator` `<:nyx_not_available:897378400031879188> We don't have a **${all[tag]}** gunsmith build for the gun with **CWTS ${cwts}** by **${all[cc]}**, Please try another tag or a differnt content creator`
) )
.setColor(client.color); .setColor(client.color);
try { interaction.followUp({ embeds: [embed] });
interaction.followUp({ embeds: [embed] });
} catch (e) {
interaction.editReply({ embeds: [embed] });
}
} else { } else {
const arr = []; const arr = [];
data.attachments.map((e, i) => { data.attachments.map((e, i) => {
return arr.push(`**${i + 1}:** ${e}`); return arr.push(`**${i + 1}:** ${e}`);
}); });
const embed = new EmbedBuilder() const embed = new MessageEmbed()
.setTitle(`${tag} build for ${data.weaponName} from ${data.author}`) .setTitle(
`${all[tag]} build for ${data.weaponName} from ${data.author}`
)
.setDescription( .setDescription(
`<:nyx_description:897379659665264650> **Description** \`\`\`\n${data.notes}\n \`\`\`` `<:nyx_description:897379659665264650> **Description** \`\`\`\n${data.notes} \n\`\`\``
) )
.setColor(16580400) .setColor(16580400)
.setImage(data.imageUrl ? data.imageUrl : null) .setImage(data.imageUrl)
.setFooter({ .setFooter({
text: `Builds Aggregated by ${client.author}`, text: `Builds Aggregated by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }), iconURL: client.user.displayAvatarURL(),
}) })
.setTimestamp() .setTimestamp()
.addFields( .addFields(
@ -714,8 +717,8 @@ module.exports = {
}, },
{ {
name: "<a:lastupdate:897381474330873887> Last Updated:", name: "<a:lastupdate:897381474330873887> Last Updated:",
value: `\`\`\`\n${utils.parseShortDate( value: `\`\`\`\n${moment(Date.parse(data.lastUpdate)).format(
new Date(data.lastUpdate) "MMMM Do YYYY"
)}\n\`\`\``, )}\n\`\`\``,
inline: true, inline: true,
}, },
@ -734,13 +737,9 @@ module.exports = {
} }
) )
.setURL(client.web); .setURL(client.web);
try { interaction.followUp({
interaction.followUp({ embeds: [embed],
embeds: [embed], });
});
} catch (e) {
interaction.editReply({ embeds: [embed] });
}
} }
}, },
}; };

View file

@ -1,4 +1,4 @@
const { EmbedBuilder } = require("discord.js"); const { MessageEmbed } = require("discord.js");
const model = require("../../models/weapons"); const model = require("../../models/weapons");
const Attachments = require("../../util/Data/attachments.json"); const Attachments = require("../../util/Data/attachments.json");
module.exports = { module.exports = {
@ -8,8 +8,11 @@ module.exports = {
run: async (client, interaction) => { run: async (client, interaction) => {
const data = async () => { const data = async () => {
const d = await model.findOne({}); const d = await model.findOne({});
const weapons = d.Primary[0][d.Categories.random()]; const types = d.Categories;
return `${weapons.random()}`; 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_weapon = await data();
const primary = primary_weapon.replace(/[ -]/g, "_").replace(/\./g, ""); const primary = primary_weapon.replace(/[ -]/g, "_").replace(/\./g, "");
@ -19,7 +22,7 @@ module.exports = {
slot_3 = slots.next().value, slot_3 = slots.next().value,
slot_4 = slots.next().value, slot_4 = slots.next().value,
slot_5 = slots.next().value; slot_5 = slots.next().value;
const result = new EmbedBuilder() const result = new MessageEmbed()
.setColor(client.color) .setColor(client.color)
.setTitle(`🎲 A Randomly Generated Class for ${primary_weapon} 🎲`) .setTitle(`🎲 A Randomly Generated Class for ${primary_weapon} 🎲`)
.setDescription( .setDescription(
@ -35,10 +38,7 @@ module.exports = {
)}**` )}**`
) )
.setURL(client.web) .setURL(client.web)
.setFooter({ .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp(); .setTimestamp();
interaction.followUp({ embeds: [result] }); interaction.followUp({ embeds: [result] });
function* shuffle(array) { function* shuffle(array) {
@ -49,7 +49,7 @@ module.exports = {
} }
function getAttachment(gun, slot) { function getAttachment(gun, slot) {
const ca = Attachments[gun][0][slot]; const ca = Attachments[gun][0][slot];
return ca.random(); return ca[Math.floor(Math.random() * ca.length)];
} }
}, },
}; };

View file

@ -1,74 +0,0 @@
const { EmbedBuilder } = require("discord.js"); //@night0721 You need to make this
const items = require("../../util/Data/loadout.json");
module.exports = {
name: "loadout",
description: "Generate A Random Loadout",
category: "CODM",
run: async (client, interaction) => {
const secondary =
items.secondary[Math.floor(Math.random() * items.secondary.length)];
const red = items.perk_1[Math.floor(Math.random() * items.perk_1.length)];
const green = items.perk_2[Math.floor(Math.random() * items.perk_2.length)];
const blue = items.perk_3[Math.floor(Math.random() * items.perk_3.length)];
const operator =
items.operator_skill[
Math.floor(Math.random() * items.operator_skill.length)
];
const slots = shuffle(items.scorestreak);
const slot_1 = slots.next().value,
slot_2 = slots.next().value,
slot_3 = slots.next().value;
const result = new EmbedBuilder()
.setColor(client.color)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setURL(client.web)
.setTitle(`🎲 A Randomly Generated Loadout 🎲`)
.setDescription(
`This loadout is a randomly generated, Also try, \`\`\`/class\`\`\` to get a randomally generated primary weapon gunsmith build`
)
.addFields(
{
name: "Secondary Weapon",
value: secondary,
inline: true,
},
{
name: "Operator Skill",
value: operator,
inline: true,
},
{
name: "Scorestreak",
value: `${slot_1}\n${slot_2}\n${slot_3}`,
inline: true,
},
{
name: "Red Perk",
value: red,
inline: true,
},
{
name: "Green Perk",
value: green,
inline: true,
},
{
name: "Blue Perk",
value: blue,
inline: true,
}
)
.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];
}
}
},
};

View file

@ -1,14 +1,14 @@
const { EmbedBuilder } = require("discord.js"); const { MessageEmbed } = require("discord.js");
const c = require("../../client/CODMClient"); const c = require("../../client/CODMClient");
module.exports = { module.exports = {
name: "perk", name: "perk",
description: "Get perk stats", description: "Get perk stats",
type: "CHAT_INPUT",
usage: "{Perk}", usage: "{Perk}",
category: "CODM", category: "CODM",
options: [ options: [
{ {
type: 1, type: "SUB_COMMAND",
name: "red", name: "red",
description: "Red Perk", description: "Red Perk",
options: [ options: [
@ -67,7 +67,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "green", name: "green",
description: "Green Perk", description: "Green Perk",
options: [ options: [
@ -122,7 +122,7 @@ module.exports = {
], ],
}, },
{ {
type: 1, type: "SUB_COMMAND",
name: "blue", name: "blue",
description: "Blue Perk", description: "Blue Perk",
options: [ options: [
@ -176,7 +176,7 @@ module.exports = {
run: async (client, interaction, args) => { run: async (client, interaction, args) => {
const val = args[1]; const val = args[1];
const d = await c.getperk(val); const d = await c.getperk(val);
const embed = new EmbedBuilder() const embed = new MessageEmbed()
.setColor( .setColor(
d.type == "green" d.type == "green"
? "09654a" ? "09654a"
@ -186,13 +186,10 @@ module.exports = {
? "1047a4" ? "1047a4"
: client.color : client.color
) )
.setFooter({ .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp() .setTimestamp()
.setTitle(d.perk) .setTitle(d.perk)
.addFields({ name: "Effects", value: d.effects }); .addField("Effects", d.effects);
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
}, },
}; };

View file

@ -1,8 +1,9 @@
const { EmbedBuilder } = require("discord.js"); const { MessageEmbed } = require("discord.js");
const c = require("../../client/CODMClient"); const c = require("../../client/CODMClient");
module.exports = { module.exports = {
name: "scorestreak", name: "scorestreak",
description: "Get Scorestreak stats", description: "Get Scorestreak stats",
type: "CHAT_INPUT",
usage: "{Scorestreak}", usage: "{Scorestreak}",
category: "CODM", category: "CODM",
options: [ options: [
@ -128,7 +129,7 @@ module.exports = {
run: async (client, interaction, args) => { run: async (client, interaction, args) => {
const val = args[1]; const val = args[1];
const d = await c.getscorestreak(val); const d = await c.getscorestreak(val);
const embed = new EmbedBuilder() const embed = new MessageEmbed()
.setTitle(d.name) .setTitle(d.name)
.setURL(d.preview_video) .setURL(d.preview_video)
.setDescription( .setDescription(
@ -154,7 +155,7 @@ module.exports = {
.setThumbnail(d.preview) .setThumbnail(d.preview)
.setFooter({ .setFooter({
text: `Made by ${client.author}`, text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }), iconURL: client.user.displayAvatarURL(),
}) })
.setColor( .setColor(
d.type == "lethal" d.type == "lethal"

View file

@ -1,6 +1,6 @@
const common = require("../../util/functions/common"); const common = require("../../util/functions/common");
const data = require("../../util/Data/data.json"); const data = require("../../util/Data/data.json");
const { EmbedBuilder } = require("discord.js"); const { MessageEmbed } = require("discord.js");
let currGun, let currGun,
currStats, currStats,
@ -11,6 +11,7 @@ let currGun,
recoilAvailable, recoilAvailable,
chart, chart,
hasError; hasError;
const errMsg = "*Generic placeholder error message*";
module.exports = { module.exports = {
name: "stats", name: "stats",
description: "Check gun stats", description: "Check gun stats",
@ -57,22 +58,20 @@ module.exports = {
if (args.length == 1) if (args.length == 1)
repEmb = statsHandler(args.join(" ").replace("\n", " ")); repEmb = statsHandler(args.join(" ").replace("\n", " "));
else repEmb = statsHandler(args.join(" + ").replace("\n", " ")); else repEmb = statsHandler(args.join(" + ").replace("\n", " "));
if (hasError) { if (hasError) {
interaction.followUp({ interaction.followUp({ embeds: [new MessageEmbed(repEmb)] });
content: `**${repEmb || "An error has occured"}**`,
});
} else {
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: [new EmbedBuilder(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: [new MessageEmbed(repEmb)] });
}, },
}; };
@ -82,38 +81,38 @@ function inpHandler(inpmsg) {
function statsHandler(inpmsg) { function statsHandler(inpmsg) {
let statsNames = [ let statsNames = [
"Pellets", //0 "Pellets",
"Detonation Range", //1 "Detonation Range",
"Explosion Radius", //2 "Explosion Radius",
"Explosion Damage", //3 "Explosion Damage",
"Firing Mode", //4 "Firing Mode",
"Rate of Fire", //5 "Rate of Fire",
"Bullet in Burst", //6 "Bullet in Burst",
"Time Between Burst", //7 "Time Between Burst",
"Bullet Speed", //8 "Bullet Speed",
"Penetration Level", //9 "Penetration Level",
"Bullet Spread", //10 "Bullet Spread",
"Idle Sway", //11 "Idle Sway",
"Hipfire Pellet Spread", //12 "Hipfire Pellet Spread",
"ADS Pellet Spread", //13 "ADS Pellet Spread",
"ADS Time", //14 "ADS Time",
"Sprint-to-Fire Time", //15 "Sprint-to-Fire Time",
"ADS Zoom", //16 "ADS Zoom",
"Magazine", //17 "Magazine",
"Reserve", //18 "Reserve",
"Reload Type", //19 "Reload Type",
"Cancel Reload Time", //20 "Cancel Reload Time",
"Reload Time", //21 "Reload Time",
"Full Reload Time", //22 "Full Reload Time",
"Drop Time", //23 "Drop Time",
"Raise Time", //24 "Raise Time",
"Sprinting Speed", //25 "Sprinting Speed",
"Walking Speed", //26 "Walking Speed",
"Straifing Speed", //27 "Straifing Speed",
"Damage per Tick", //28 "Damage per Tick",
"Number of Ticks", //29 "Number of Ticks",
"Time Between Ticks", //30 "Time Between Ticks",
"Breath Hold Time", //31 "Breath Hold Time",
"shouldNeverHappen0", "shouldNeverHappen0",
"shouldNeverHappen1", "shouldNeverHappen1",
"shouldNeverHappen2", "shouldNeverHappen2",
@ -188,8 +187,8 @@ function statsHandler(inpmsg) {
inpIndx = inpIndx.filter(x => outReady[x]); inpIndx = inpIndx.filter(x => outReady[x]);
return inpIndx.length return inpIndx.length
? { ? {
name: `**${inpName}**`, name: "**" + inpName + "**",
value: `\`\`\`\n${inpIndx.map(x => outReady[x]).join("\n")}\`\`\``, value: "```\n" + inpIndx.map(x => outReady[x]).join("\n") + "```",
} }
: ""; : "";
} }
@ -220,17 +219,17 @@ function statsHandler(inpmsg) {
function addUnit(j) { function addUnit(j) {
switch (j) { switch (j) {
case 7: case 07:
case 14: case 14:
case 15: case 15:
case 23: case 23:
case 24: case 24:
case 31: case 31:
return " ms"; return " ms";
case 25:
case 26:
case 27: case 27:
case 28: case 28:
case 25:
case 26:
return " m/s"; return " m/s";
case 20: case 20:
case 21: case 21:
@ -238,9 +237,9 @@ function statsHandler(inpmsg) {
return " s"; return " s";
case 16: case 16:
return "%"; return "%";
case 6: case 06:
return " Rounds"; return " Rounds";
case 5: case 05:
return " RPM"; return " RPM";
default: default:
return ""; return "";
@ -257,11 +256,16 @@ function statsHandler(inpmsg) {
currRecoilArr[2] currRecoilArr[2]
); );
recoilAvailable = true; recoilAvailable = true;
} else recoilAvailable = false; } else {
recoilAvailable = false;
if (chart == "none") recoilAvailable = false; }
if (chart == "err") hasError = true; if (chart == "none") {
recoilAvailable = false;
}
if (chart == "err" || currAttachments == "err") {
hasError = true;
return "Cocaineeee";
}
const dmg = const dmg =
common.damageHandler( common.damageHandler(
currDRM.damage, currDRM.damage,
@ -277,7 +281,7 @@ function statsHandler(inpmsg) {
currGun.description currGun.description
? { ? {
name: "**Description:**", name: "**Description:**",
value: `\`\`\`\n${currGun.description}\`\`\``, value: "```\n" + currGun.description + "```",
} }
: {}, : {},
{ name: "**Damage Profile:**", value: dmg }, { name: "**Damage Profile:**", value: dmg },

106
command/CODM/watermark.js Normal file
View file

@ -0,0 +1,106 @@
const axios = require("axios");
const { MessageAttachment } = require("discord.js");
module.exports = {
name: "watermark",
description: "Add a water to leaks",
options: [
{
type: 3,
name: "photo",
description: "Link of photo",
required: true,
},
{
type: 3,
name: "position",
description: "Where you want to place the water mark",
required: true,
choices: [
{
name: "Middle",
value: "middle",
},
{
name: "ButtomRight",
value: "buttomright",
},
],
},
{
type: 3,
name: "opacity",
description:
"Opacity of watermark(50 - 100) Lower or higher will be ignored",
required: true,
},
{
type: 3,
name: "logo",
description: "The Logo you want to use",
required: true,
choices: [
{
name: "Discord Nicecat",
value: "discord_nicecat",
},
{
name: "NoLink Leakers",
value: "nolink_leakers",
},
{
name: "Discord Leakers",
value: "discord_leakers",
},
{
name: "DogeBeanie",
value: "doge",
},
{
name: "CODM N3W3",
value: "n3w3",
},
{
name: "Alyan Gaming",
value: "alyan",
},
{
name: "Murdablast",
value: "murdablast",
},
{
name: "Sasha",
value: "sasha",
},
{
name: "Umair Gamer",
value: "umair",
},
],
},
{
type: 3,
name: "password",
description: "The password in order to use this command",
required: true,
},
],
run: async (client, interaction, args) => {
const data = await axios
.get(
`${process.env.api}/api/v1/codm/watermark?photo=${args[0]}&position=${args[1]}&opacity=${args[2]}&logo=${args[3]}&password=${args[4]}`
)
.then(res => res.data)
.catch();
if (!data) {
interaction.followUp({
content: "You have either wrong input or you are unauthorized",
});
} else {
const ima = new MessageAttachment(
`${process.env.api}/api/v1/codm/watermark?photo=${args[0]}&position=${args[1]}&opacity=${args[2]}&logo=${args[3]}&password=${args[4]}`,
`${args[2]}.png`
);
interaction.followUp({ files: [ima] });
}
},
};

View file

@ -1,4 +1,4 @@
const { EmbedBuilder } = require("discord.js"); const { MessageEmbed } = require("discord.js");
module.exports = { module.exports = {
name: "premiumserver", name: "premiumserver",
category: "Config", category: "Config",
@ -16,11 +16,9 @@ module.exports = {
try { try {
const user = await client.data.getUser(interaction.user.id); const user = await client.data.getUser(interaction.user.id);
const guild = await client.data.getGuild(interaction.guild.id); const guild = await client.data.getGuild(interaction.guild.id);
if (interaction.options.getBoolean("choice")) { if (interaction.options.getBoolean("choice") == true) {
if (guild.Premium) { if (guild.Premium == true) {
return interaction.followUp({ interaction.followUp({ content: "This server is already premium" });
content: "This server is already premium",
});
} }
if ( if (
(user.Tier == 1 && user.PremiumServers.length >= 5) || (user.Tier == 1 && user.PremiumServers.length >= 5) ||
@ -40,44 +38,42 @@ module.exports = {
); );
interaction.followUp({ interaction.followUp({
embeds: [ embeds: [
new EmbedBuilder() new MessageEmbed()
.setTitle("Success!") .setTitle("Success!")
.setDescription( .setDescription(
`Premium added to **${interaction.guild.name}**! \n` `Premium added to **${interaction.guild.name}**! \n`
) )
.setFooter({ text: "Thank you for supporting Cath!" }) .setFooter("Thank you for supporting Cath!")
.setColor("Green") .setColor("GREEN")
.setTimestamp() .setTimestamp()
.setAuthor({ .setAuthor(
name: interaction.user.tag, interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }), interaction.user.displayAvatarURL({ dynamic: true })
}), ),
], ],
}); });
client.channels.cache.get(client.config.ServerLog).send({ client.channels.cache.get(client.config.ServerLog).send({
embeds: [ embeds: [
new EmbedBuilder() new MessageEmbed()
.setTitle("New Premium Server") .setTitle("New Premium Server")
.addFields({ .addField(
name: "Server Info", "Server Info",
value: `**>Server Name**: \n${interaction.guild.name} `**>Server Name**: \n${interaction.guild.name}
**>Server ID**: \n${interaction.guild.id} **>Server ID**: \n${interaction.guild.id}
**>Server Member Count**: \n${interaction.guild.memberCount}`, **>Server Member Count**: \n${interaction.guild.memberCount}`
}) )
.setTimestamp() .setTimestamp()
.setThumbnail(interaction.guild.iconURL({ dynamic: true })) .setThumbnail(interaction.guild.iconURL({ dynamic: true }))
.setColor("Green"), .setColor("GREEN"),
], ],
}); });
} }
} else { } else {
if (!guild.Premium) { if (guild.Premium == false) {
return interaction.followUp({ interaction.followUp({ content: "This server isn't premium yet" });
content: "This server isn't premium yet",
});
} }
if (!user.PremiumServers.includes(interaction.guild.id)) { if (!user.PremiumServers.includes(interaction.guild.id)) {
return interaction.followUp({ interaction.followUp({
content: content:
"You can't remove due to you aren't the person who made the server premium", "You can't remove due to you aren't the person who made the server premium",
}); });
@ -90,32 +86,32 @@ module.exports = {
); );
interaction.followUp({ interaction.followUp({
embeds: [ embeds: [
new EmbedBuilder() new MessageEmbed()
.setTitle("Removed!") .setTitle("Removed!")
.setDescription( .setDescription(
`Premium removed from **${interaction.guild.name}**! \n` `Premium removed from **${interaction.guild.name}**! \n`
) )
.setColor("Red") .setColor("RED")
.setTimestamp() .setTimestamp()
.setAuthor({ .setAuthor(
name: interaction.user.tag, interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }), interaction.user.displayAvatarURL({ dynamic: true })
}), ),
], ],
}); });
client.channels.cache.get(client.config.ServerLog).send({ client.channels.cache.get(client.config.ServerLog).send({
embeds: [ embeds: [
new EmbedBuilder() new MessageEmbed()
.setTitle("Premium Server Removed") .setTitle("Premium Server Removed")
.addFields({ .addField(
name: "Server Info", "Server Info",
value: `**>Server Name**: \n${interaction.guild.name} `**>Server Name**: \n${interaction.guild.name}
**>Server ID**: \n${interaction.guild.id} **>Server ID**: \n${interaction.guild.id}
**>Server Member Count**: \n${interaction.guild.memberCount}`, **>Server Member Count**: \n${interaction.guild.memberCount}`
}) )
.setTimestamp() .setTimestamp()
.setThumbnail(interaction.guild.iconURL({ dynamic: true })) .setThumbnail(interaction.guild.iconURL({ dynamic: true }))
.setColor("Red"), .setColor("RED"),
], ],
}); });
} }

View file

@ -1,4 +1,5 @@
const { EmbedBuilder } = require("discord.js"); const starboardClient = require("../../client/StarboardClient");
const { MessageEmbed } = require("discord.js");
const fs = require("fs"); const fs = require("fs");
module.exports = { module.exports = {
name: "settings", name: "settings",
@ -6,6 +7,109 @@ module.exports = {
UserPerms: ["ADMINISTRATOR"], UserPerms: ["ADMINISTRATOR"],
category: "Config", category: "Config",
options: [ 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, type: 2,
name: "enable", name: "enable",
@ -43,10 +147,22 @@ module.exports = {
name: "config", name: "config",
value: "Config", value: "Config",
}, },
{
name: "economy",
value: "Economy",
},
{
name: "fun",
value: "Fun",
},
{ {
name: "information", name: "information",
value: "Information", value: "Information",
}, },
{
name: "moderation",
value: "Moderation",
},
{ {
name: "utilities", name: "utilities",
value: "Utilities", value: "Utilities",
@ -94,11 +210,22 @@ module.exports = {
name: "config", name: "config",
value: "Config", value: "Config",
}, },
{
name: "economy",
value: "Economy",
},
{
name: "fun",
value: "Fun",
},
{ {
name: "information", name: "information",
value: "Information", value: "Information",
}, },
{
name: "moderation",
value: "Moderation",
},
{ {
name: "utilities", name: "utilities",
value: "Utilities", value: "Utilities",
@ -109,6 +236,32 @@ module.exports = {
}, },
], ],
}, },
{
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, type: 1,
name: "tips", name: "tips",
@ -130,7 +283,116 @@ module.exports = {
}, },
], ],
run: async (client, interaction, args, utils, data) => { run: async (client, interaction, args, utils, data) => {
if (args[0].toLowerCase() === "tips") { 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]) { if (args[1]) {
await client.data.setTips(interaction.guild.id, "true"); await client.data.setTips(interaction.guild.id, "true");
interaction.followUp({ interaction.followUp({
@ -222,7 +484,39 @@ module.exports = {
} }
} else { } else {
const d = ` 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."} **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"} **Tips**: ${data.Guild.Tips ? "Enable" : "Disabled"}
**Disabled Commands**: ${ **Disabled Commands**: ${
data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None" data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None"
@ -231,13 +525,10 @@ module.exports = {
data.Guild.Category.length ? data.Guilds.Category.join(",") : "None" data.Guild.Category.length ? data.Guilds.Category.join(",") : "None"
} }
`; `;
const embed = new EmbedBuilder() const embed = new MessageEmbed()
.setTitle(`**${interaction.guild.name}** Settings`) .setTitle(`**${interaction.guild.name}** Settings`)
.setColor(client.color) .setColor(client.color)
.setFooter({ .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp() .setTimestamp()
.setDescription(d); .setDescription(d);
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });

29
command/Economy/bal.js Normal file
View file

@ -0,0 +1,29 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "balance",
description: "Show an user's balance",
usage: "(User)",
category: "Economy",
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;
const bal = await client.bal(user.id);
const embed = new MessageEmbed()
.setTitle(`${user.displayName}'s Balance`)
.setDescription(`**${bal}** ${client.currency}`)
.setColor(client.color)
.setURL(client.web)
.setTimestamp()
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL());
interaction.followUp({ embeds: [embed] });
},
};

81
command/Economy/bet.js Normal file
View file

@ -0,0 +1,81 @@
const { MessageEmbed } = require("discord.js");
const { bool } = require("cath");
module.exports = {
name: "bet",
usage: "(Number)",
timeout: 5000,
description: "Win double amount of coins or lose all coins",
category: "Economy",
options: [
{
type: 4,
name: "cp",
description: "The number of CP you want to bet",
required: true,
},
],
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`)
.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,
}
);
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`)
.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: [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);
}
}
},
};

43
command/Economy/daily.js Normal file
View file

@ -0,0 +1,43 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "daily",
description: "Earns daily money",
category: "Economy",
timeout: 1000 * 60 * 60 * 24,
run: async (client, interaction, args) => {
let money;
const user = await client.data.getUser(interaction.user.id);
if (user) {
if (user.Premium == true) {
money = 20000;
const pre_embed = new MessageEmbed()
.setTitle(`${user.username}'s profile`)
.setDescription(
`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}`, client.user.displayAvatarURL())
.setTimestamp();
await client.add(interaction.user.id, money, interaction);
return interaction.followUp({ embeds: [pre_embed] });
} else {
money = 10000;
const norm_embed = new MessageEmbed()
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dyanmic: true })
)
.setDescription(
`Here is your daily ${money}${client.currency}!\nBe [premium](https://discord.gg/SbQHChmGcp) user, you can get more coins everyday!`
)
.setURL(client.web)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
await client.add(interaction.user.id, money, interaction);
return interaction.followUp({ embeds: [norm_embed] });
}
}
},
};

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

67
command/Economy/inv.js Normal file
View file

@ -0,0 +1,67 @@
const { MessageEmbed } = require("discord.js");
const inv = require("../../models/econ");
const { Pagination } = require("cath");
const items = require("../../util/Data/item.json");
module.exports = {
name: "inventory",
description: "Check the inventory of an user",
usage: "{User}",
category: "Economy",
timeout: 5000,
options: [
{
type: 6,
name: "user",
description: "The user you want to see",
required: false,
},
],
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) {
return interaction.followUp({
content: `User doesn't have any data`,
});
}
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`,
});
}
const c = util.chunk(mappedData, 5).map(x => x.join("\n"));
const embed = new MessageEmbed()
.setTimestamp()
.setTitle(`${user.displayName}'s inventory`)
.setColor(client.color)
.setDescription(c[0])
.setFooter(`Page 1 of ${c.length}`);
try {
const msg = await interaction.followUp({ embeds: [embed] });
if (mappedData.length > 5) {
await util.pagination(msg, interaction.user, c);
}
} catch (e) {
console.log(e);
}
} else {
return interaction.followUp({ content: `User doesn't have any data` });
}
});
},
};

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

@ -0,0 +1,49 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "profile",
usage: "(User)",
description: "Check an user economy profile",
type: "CHAT_INPUT",
options: [
{
type: 6,
name: "user",
description: "The user you want to see",
required: false,
},
],
run: async (client, interaction, args) => {
const user =
interaction.guild.members.cache.get(args[0]) || interaction.member;
const bjwin = await client.bjWin(user.user.id);
const swin = await client.sWin(user.user.id);
const bwin = await client.bWin(user.user.id);
const cmdused = await client.cmdsUSED(user.user.id);
const bal = await client.bal(user.user.id);
const multi = await client.multi(interaction);
const game = new MessageEmbed()
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setColor("7196ef")
.setTitle(`${user.displayName}'s profile`)
.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,
}
);
interaction.followUp({ embeds: [game] });
},
};

47
command/Economy/rich.js Normal file
View file

@ -0,0 +1,47 @@
const { Collection, MessageEmbed } = require("discord.js");
module.exports = {
name: "rich",
description: "Displaying top 10 richest users.",
category: "Economy",
timeout: 4000,
run: async (client, interaction) => {
const collection = new Collection();
await Promise.all(
interaction.guild.members.cache.map(async member => {
const id = member.id;
const bal = await client.bal(id);
if (!bal) return;
return bal !== 0
? collection.set(id, {
id,
bal,
})
: null;
})
);
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);
interaction.followUp({
embeds: [
new MessageEmbed()
.setTitle(`Richest users in ${interaction.guild.name}`)
.setDescription(
ata
.map((v, i) => {
return `**${i + 1}** ${
interaction.guild.members.cache.get(v.id).user.tag
} = **${v.bal} ${client.currency}**`;
})
.join("\n")
)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setColor(client.color),
],
});
},
};

78
command/Economy/shop.js Normal file
View file

@ -0,0 +1,78 @@
const { MessageEmbed } = require("discord.js");
const { Pagination } = require("cath");
const items = require("../../util/Data/item.json");
module.exports = {
name: "shop",
description: "Check the items from the shop",
category: "Economy",
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] });
}
}
},
};

124
command/Economy/slots.js Normal file
View file

@ -0,0 +1,124 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "slots",
usage: "(Number)",
timeout: 5000,
description: "Win more coins by slots",
category: "Economy",
options: [
{
type: 4,
name: "cp",
description: "The number of CP you want to slots",
required: true,
},
],
run: async (client, interaction, args) => {
const max = 100000;
const slots = [
"<:blushca:852174555513618502>",
"<:abusecat:853501068074942464>",
"<:dumbcat:855462498550415362>",
];
const slotOne = slots[Math.floor(Math.random() * slots.length)];
const slotTwo = slots[Math.floor(Math.random() * slots.length)];
const slotThree = slots[Math.floor(Math.random() * slots.length)];
const slotfour = slots[Math.floor(Math.random() * slots.length)];
const slotfive = slots[Math.floor(Math.random() * slots.length)];
const slotsix = slots[Math.floor(Math.random() * slots.length)];
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 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.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}`, client.user.displayAvatarURL())
.setTimestamp()
.addField(
"|-----|-----|----|",
`| ${slotfour} | ${slotfive} | ${slotsix} |`
)
.addField(
"|-----|-----|----|",
`| ${slotOne} | ${slotTwo} | ${slotThree} |`
)
.addField(
"|-----|-----|----|",
`| ${slotseven} | ${sloteight} | ${slotnine} |`
)
.setTitle(`${interaction.user.username} wins a slots game`)
.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}`, client.user.displayAvatarURL())
.setTimestamp()
.addField(
"|-----|-----|----|",
`| ${slotfour} | ${slotfive} | ${slotsix} |`
)
.addField(
"|-----|-----|----|",
`| ${slotOne} | ${slotTwo} | ${slotThree} |`
)
.addField(
"|-----|-----|----|",
`| ${slotseven} | ${sloteight} | ${slotnine} |`
)
.setTitle(`${interaction.user.username} loses a slots game`)
.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" });
}
});
}
},
};

37
command/Economy/work.js Normal file
View file

@ -0,0 +1,37 @@
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 jobs = [
"Software engineer",
"Programmer",
"Teacher",
"YouTuber",
"Student",
"Desginer",
"Editor",
"Banker",
];
const earning = utils.rndint(5000, 3000);
const job = jobs[Math.floor(Math.random() * jobs.length)];
await client.add(interaction.user.id, earning, interaction);
interaction.followUp({
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),
],
});
},
};

23
command/Fun/ascii.js Normal file
View file

@ -0,0 +1,23 @@
const axios = require("axios");
module.exports = {
name: "ascii",
description: "Converts text into ASCII art",
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 data = await axios
.get(
`https://artii.herokuapp.com/make?text=${encodeURIComponent(args[0])}`
)
.then(res => res.data);
interaction.followUp(`\`\`\`${data}\`\`\``);
},
};

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

@ -0,0 +1,21 @@
const { MessageEmbed } = require("discord.js");
const tnd = require("../../util/Data/tnd.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({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dyamic: true }),
})
.setTitle(dares[Math.round(Math.random() * tnd.dare.length - 1)])
.setColor(client.color)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
.setTimestamp();
interaction.followUp({ embeds: [embed] });
},
};

97
command/Fun/hangman.js Normal file
View file

@ -0,0 +1,97 @@
const axios = require("axios");
const { MessageEmbed } = require("discord.js");
const playing = new Set();
module.exports = {
name: "hangman",
description: "Play a hangman game",
category: "Fun",
run: async (client, interaction) => {
await interaction.deleteReply();
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
.get(`${process.env.api}/api/v1/fun/hangman`)
.then(res => res.data);
const word = data.word;
let points = 0;
let displayText = null;
let guessed = false;
const confirmation = [];
const incorrect = [];
const display = new Array(word.length).fill("◯");
while (word.length !== confirmation.length && points < 6) {
const embed = new MessageEmbed()
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setTitle("Hangman game").setDescription(`
${displayText === null ? "Here we go!" : displayText ? "Good job!" : "Nope!"}
\`${display.join(" ")}\`. Which letter do you choose?
Incorrect Tries: ${incorrect.join(", ") || "None"}
\`\`\`
.
.
. ${points > 0 ? "O" : ""}
. ${points > 2 ? "/" : " "}${points > 1 ? "|" : ""}${
points > 3 ? "\\" : ""
}
. ${points > 4 ? "/" : ""}${points > 5 ? "\\" : ""}
=============
\`\`\`
`);
await interaction.channel.send({ embeds: [embed] });
const filter = res => {
const choice = res.content.toLowerCase();
return (
res.author.id === interaction.user.id &&
!confirmation.includes(choice) &&
!incorrect.includes(choice)
);
};
const guess = await interaction.channel.awaitMessages({
filter,
max: 1,
time: 30000,
});
if (!guess.size) {
await interaction.channel.send({ content: "Sorry, time is up!" });
break;
}
const choice = guess.first().content.toLowerCase();
if (choice === "end") break;
if (choice.length > 1 && choice === word) {
guessed = true;
break;
} else if (word.includes(choice)) {
displayText = true;
for (let i = 0; i < word.length; i++) {
if (word.charAt(i) !== choice) continue; // eslint-disable-line max-depth
confirmation.push(word.charAt(i));
display[i] = word.charAt(i);
}
} else {
displayText = false;
if (choice.length === 1) incorrect.push(choice);
points++;
}
}
playing.delete(interaction.channel.id);
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}**.`,
});
} catch (err) {
console.log(err);
playing.delete(interaction.channel.id);
}
},
};

20
command/Fun/say.js Normal file
View file

@ -0,0 +1,20 @@
const { Util } = require("discord.js");
module.exports = {
name: "say",
description: "Pretend a bot to say",
usage: "(Words)",
category: "Fun",
type: "CHAT_INPUT",
options: [
{
type: 3,
name: "words",
description: "The words to say",
required: true,
},
],
run: async (client, interaction, args) => {
await interaction.deleteReply();
interaction.channel.send(Util.cleanContent(args[0], interaction.channel));
},
};

42
command/Fun/ship.js Normal file
View file

@ -0,0 +1,42 @@
const { MessageEmbed } = require("discord.js");
const block = "⬛";
const heart = "🟥";
module.exports = {
name: "ship",
description: "Ship an user to an user",
usage: "(User) (User)",
category: "Fun",
options: [
{
type: 6,
name: "1stuser",
description: "The user you want to ship",
required: true,
},
{
type: 6,
name: "2nduser",
description: "The user you want to ship",
required: true,
},
],
type: "CHAT_INPUT",
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;
const loveEmbed = new MessageEmbed()
.setColor("dd2e44")
.setFooter(`Shipped by ${interaction.user.tag}`)
.setTimestamp()
.setTitle(`💘 | Shipping ${user1} and ${user2} | 💘`)
.setDescription(`🔻 | ${user1} \n${ship()}\n🔺 | ${user2}`);
interaction.followUp({ embeds: [loveEmbed] });
},
};
function ship() {
const hearts = Math.floor(Math.random() * 100);
const hearte = hearts / 10;
const str = `${heart.repeat(hearte)}${block.repeat(10 - hearte)} ${hearts}%`;
return str;
}

30
command/Fun/simprate.js Normal file
View file

@ -0,0 +1,30 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "simprate",
description: "Check how simp is the user",
usage: "(@User)",
category: "Fun",
options: [
{
type: 6,
name: "user",
description: "The user you want to see",
required: true,
},
],
run: async (client, interaction, args) => {
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}`, client.user.displayAvatarURL())
.setTimestamp(),
],
});
},
};

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

@ -0,0 +1,21 @@
const { MessageEmbed } = require("discord.js");
const tnd = require("../../util/Data/tnd.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({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dyamic: true }),
})
.setTitle(truth[Math.round(Math.random() * tnd.truth.length)])
.setColor(client.color)
.setFooter({
text: `Made by ${client.author}`,
iconURL: 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

@ -1,12 +1,8 @@
const { const { MessageEmbed } = require("discord.js");
Client,
CommandInteraction,
EmbedBuilder,
ImageFormat,
} = require("discord.js");
module.exports = { module.exports = {
name: "avatar", name: "avatar",
description: "Show user's avatar in different formats", description: "Show user's avatar in different formats",
type: "CHAT_INPUT",
usage: "{User}", usage: "{User}",
category: "Information", category: "Information",
options: [ options: [
@ -17,32 +13,35 @@ module.exports = {
required: false, required: false,
}, },
], ],
/** run: async (client, interaction, args) => {
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
*/ run: async (client, interaction, args) => {
const member = const member =
interaction.guild.members.cache.get(args[0]) || interaction.member; interaction.guild.members.cache.get(args[0]) || interaction.member;
const embed = new EmbedBuilder() const embed = new MessageEmbed()
.setAuthor({ .setAuthor(
name: member.user.tag, member.user.tag,
iconURL: member.user.displayAvatarURL({ dynamic: true, size: 1024 }), member.user.displayAvatarURL({ dynamic: true, size: 1024 })
}) )
.setColor(client.color) .setColor(client.color)
.setTitle(`${member.user.username}'s Avatar`) .setTitle(`${member.user.username}'s Avatar`)
.setImage( .setDescription(
member.user.displayAvatarURL({ `\`Links:\` **[png](${member.user.displayAvatarURL({
size: 2048,
dynamic: true,
format: "png", format: "png",
}) size: 2048,
})}) | [jpg](${member.user.displayAvatarURL({
format: "jpg",
size: 2048,
})}) | [webp](${member.user.displayAvatarURL({
format: "webp",
size: 2048,
})}) | [gif](${member.user.displayAvatarURL({
format: "gif",
size: 2048,
})})**`
) )
.setFooter({ .setImage(
text: `Made by ${client.author}`, member.user.avatarURL({ size: 2048, dynamic: true, format: "png" })
iconURL: client.user.displayAvatarURL({ dynamic: true }), )
}) .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setURL(client.web) .setURL(client.web)
.setTimestamp(); .setTimestamp();
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });

View file

@ -1,60 +0,0 @@
const { EmbedBuilder, version: djsversion } = require("discord.js");
const version = require("../../package.json").version;
module.exports = {
name: "botinfo",
description: "Check the info of the bot",
category: "Information",
run: async (client, interaction, args, utils) => {
const embed = new EmbedBuilder()
.setTitle(`NYX - CODM Gunsmith Bot`)
.setURL(utils.inviteLink(client.user.id))
.setThumbnail(
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
)
.setColor(client.color)
.addFields([
{
name: `General`,
value: `
<:nyx_owner:897418259433943120> Owner <@452076196419600394>
Bot ${client.user.tag}
Bot ID \`${client.user.id}\`
Created on \`${utils.botDate(
new Date(client.user.createdTimestamp)
)}\``,
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.slashCommands.size}\`
`,
inline: true,
},
{
name: `Platform`,
value: `
NYX \`v${version}\`
Discord.js \`v${djsversion}\`
Node.js \`${process.version}\``,
},
{
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\u3000Thunder#2128\n
**Website**\n\u3000Chunchunmaru#8570`,
},
])
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp();
interaction.followUp({ embeds: [embed] });
},
};

View file

@ -1,12 +1,4 @@
const { const Discord = require("discord.js");
EmbedBuilder,
Client,
CommandInteraction,
ActionRowBuilder,
StringSelectMenuBuilder,
ComponentType,
} = require("discord.js");
const Utils = require("../../util/functions/function");
module.exports = { module.exports = {
name: "help", name: "help",
usage: "(Command/Category)", usage: "(Command/Category)",
@ -20,22 +12,20 @@ module.exports = {
required: false, required: false,
}, },
], ],
/**
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
* @param {Utils} utils
*/
run: async (client, interaction, args, utils) => { run: async (client, interaction, args, utils) => {
if (!args[0]) { if (!args[0]) {
await interaction.deleteReply(); await interaction.deleteReply();
const emoji = { const emoji = {
CODM: "<a:codm:897030768793104385>", CODM: "<a:codm:897030768793104385>",
APEX: "🎆",
Config: "<a:config:896990033561669762>", Config: "<a:config:896990033561669762>",
Economy: client.currency,
Fun: "<a:fun:896889821816053790>",
Moderation: "<:discordmod:897364105730617364>",
Information: "<a:information:894962394932064346>", Information: "<a:information:894962394932064346>",
Utilities: "<a:utilites:897233087941988392>", Utilities: "<a:utilites:897233087941988392>",
Music: "<a:music:897017864085712936>",
Giveaway: "<a:confetti:896763534682226758>",
NSFW: "🍑",
}; };
const directories = [ const directories = [
...new Set(client.slashCommands.map(cmd => cmd.directory)), ...new Set(client.slashCommands.map(cmd => cmd.directory)),
@ -54,7 +44,7 @@ module.exports = {
commands: getCmds, commands: getCmds,
}; };
}); });
const embed = new EmbedBuilder() const embed = new Discord.MessageEmbed()
.setTitle(`**NYX's Commands**`) .setTitle(`**NYX's Commands**`)
.setDescription(`Please choose a category in the dropdown menu`) .setDescription(`Please choose a category in the dropdown menu`)
.setColor(client.color) .setColor(client.color)
@ -62,12 +52,12 @@ module.exports = {
.addFields( .addFields(
{ {
name: ":link: **Invite Me**", name: ":link: **Invite Me**",
value: `[Click Here](${utils.inviteLink(client.user.id)})`, value: `[Click Here](https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=4231314550&scope=bot%20applications.commands)`,
inline: true, inline: true,
}, },
{ {
name: "<:support1:867093614403256350> **Need Help ?**", name: "<:support1:867093614403256350> **Need Help ?**",
value: `[Support Server](${client.invite})`, value: `[Support Server](https://discord.gg/SbQHChmGcp)`,
inline: true, inline: true,
}, },
{ {
@ -90,13 +80,13 @@ module.exports = {
.setThumbnail( .setThumbnail(
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp" "https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
) )
.setFooter({ .setFooter(
text: `Requested by ${interaction.user.tag}`, `Requested by ${interaction.user.tag}`,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }), interaction.user.displayAvatarURL({ dynamic: true })
}); );
const components = state => [ const components = state => [
new ActionRowBuilder().addComponents( new Discord.MessageActionRow().addComponents(
new StringSelectMenuBuilder() new Discord.MessageSelectMenu()
.setCustomId("help-menu") .setCustomId("help-menu")
.setPlaceholder(`Please select a category`) .setPlaceholder(`Please select a category`)
.setDisabled(state) .setDisabled(state)
@ -120,21 +110,19 @@ module.exports = {
const filter = m => m.user.id === interaction.user.id; const filter = m => m.user.id === interaction.user.id;
const collector = interaction.channel.createMessageComponentCollector({ const collector = interaction.channel.createMessageComponentCollector({
filter, filter,
componentType: ComponentType.StringSelect, componentType: "SELECT_MENU",
time: 60000, time: 60000,
}); });
collector.on("collect", async interaction => { collector.on("collect", async interaction => {
const [directory] = interaction.values; const [directory] = interaction.values;
const category = categories.find(u => u.directory === directory); const category = categories.find(u => u.directory === directory);
const newembed = new EmbedBuilder() const newembed = new Discord.MessageEmbed()
.setTitle( .setTitle(
`${emoji[directory]} ${directory} Commands ${emoji[directory]}` `${emoji[directory]} ${directory} Commands ${emoji[directory]}`
) )
.setTimestamp() .setTimestamp()
.setColor(client.color) .setColor(client.color)
.setFooter({ .setFooter(`Please use /help (Command Name) for more details`)
text: `Please use /help (Command Name) for more details`,
})
.setDescription( .setDescription(
category.commands category.commands
.map(cmd => { .map(cmd => {
@ -148,8 +136,8 @@ module.exports = {
} else { } else {
const command = client.slashCommands.get(args[0].toLowerCase()); const command = client.slashCommands.get(args[0].toLowerCase());
if (!command) { if (!command) {
interaction.editReply({ interaction.followUp({
content: `There isn't any command named "${args[0]}"`, content: `There isn't any command or category named "${args[0]}"`,
}); });
} else { } else {
if (command.UserPerms && Array.isArray(command.UserPerms)) { if (command.UserPerms && Array.isArray(command.UserPerms)) {
@ -157,44 +145,52 @@ module.exports = {
} else { } else {
UserPermissions = [command.UserPerms ? command.UserPerms : ""]; UserPermissions = [command.UserPerms ? command.UserPerms : ""];
} }
const fields = []; if (command.BotPerms && Array.isArray(command.BotPerms)) {
const embed = new EmbedBuilder() BotPermissions = command.BotPerms;
} else {
BotPermissions = [command.BotPerms ? command.BotPerms : ""];
}
const BotPerms = BotPermissions.map(x =>
x
.split("_")
.map(y => y[0] + y.substring(1, y.length).toLowerCase())
.join(" ")
).join(", ");
const UserPerms = UserPermissions.map(x =>
x
.split("_")
.map(y => y[0] + y.substring(1, y.length).toLowerCase())
.join(" ")
).join(", ");
const embed = new Discord.MessageEmbed()
.setTitle(`"${command.name}" command details`) .setTitle(`"${command.name}" command details`)
.addFields([ .addField(
{ "**Command**:",
name: "**Command**:", command.name ? `\`${command.name}\`` : "N/A"
value: command.name ? `\`${command.name}\`` : "N/A", );
}, if (command.usage) {
]); embed.addField("**Usage**:", `\`/${command.name} ${command.usage}\``);
if (command.usage) } else {
fields.push({ embed.addField("**Usage**:", `\`/${command.name}\``);
name: "**Usage**:", }
value: `\`/${command.name} ${command.usage}\``, if (command.description) {
}); embed.addField("**Description**:", command.description);
else }
fields.push({ if (command.timeout) {
name: "**Usage**:", embed.addField("**Cooldown**:", utils.timer(command.timeout));
value: `\`/${command.name}\``, }
}); if (command.UserPerms) {
embed.addField("**Required User Permission**:", UserPerms);
if (command.description) }
fields.push({ if (command.BotPerms) {
name: "**Description**:", embed.addField("**Required Bot Permission**:", BotPerms);
value: command.description, }
});
if (command.timeout)
fields.push({
name: "**Cooldown**:",
value: utils.timer(command.timeout),
});
embed embed
.setFooter({ .setFooter(
text: `Requested by ${interaction.user.tag}`, `Requested by ${interaction.user.tag}`,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }), interaction.user.displayAvatarURL({ dynamic: true })
}) )
.setTimestamp() .setTimestamp()
.addFields(fields)
.setURL(client.web) .setURL(client.web)
.setColor(client.color); .setColor(client.color);
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });

View file

@ -1,33 +1,31 @@
const { EmbedBuilder } = require("discord.js"); const { MessageEmbed } = require("discord.js");
module.exports = { module.exports = {
name: "ping", name: "ping",
description: "Check bot latency to Discord API", description: "Check bot latency to Discord API",
type: "CHAT_INPUT",
category: "Information", category: "Information",
run: async (client, interaction, args) => { run: async (client, interaction, args) => {
const msg = await interaction.channel.send(`Pinging...`); const msg = await interaction.channel.send(`Pinging...`);
const messageping = msg.createdTimestamp - interaction.createdTimestamp; const messageping = msg.createdTimestamp - interaction.createdTimestamp;
await msg.delete(); await msg.delete();
const Embed = new EmbedBuilder() const Embed = new MessageEmbed()
.setTitle("<a:pong:897383314405605436> Pong!") .setTitle("<a:pong:897383314405605436> Pong!")
.setAuthor({ .setAuthor(
name: interaction.user.username, `${interaction.user.username}`,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }), interaction.user.displayAvatarURL()
}) )
.setDescription( .setDescription(
`\n 📨 • **Message Latency** \`${Math.floor(messageping)}ms\` `\n 📨 • **Message Latency** \`${Math.floor(messageping)}ms\`
\n🛰 **Bot Latency** \`${Math.round(client.ws.ping)}ms\`` \n🛰 **Bot Latency** \`${Math.round(client.ws.ping)}ms\``
) )
.setFooter({ .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp() .setTimestamp()
.setColor( .setColor(
messageping < 350 messageping < 350
? "#008000" ? "GREEN"
: messageping < 500 && messageping > 350 : messageping < 500 && messageping > 350
? "#ffff31" ? "YELLOW"
: "#ff0000" : "RED"
); );
interaction.followUp({ embeds: [Embed] }); interaction.followUp({ embeds: [Embed] });
}, },

View file

@ -1,5 +1,6 @@
const { Client, CommandInteraction, EmbedBuilder } = require("discord.js"); const { MessageEmbed } = require("discord.js");
const Utils = require("../../util/functions/function"); const moment = require("moment");
module.exports = { module.exports = {
name: "userinfo", name: "userinfo",
description: "Check the info of a user", description: "Check the info of a user",
@ -13,77 +14,119 @@ module.exports = {
required: false, required: false,
}, },
], ],
/** type: "CHAT_INPUT",
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
* @param {Utils} utils
*/
run: async (client, interaction, args, utils) => { run: async (client, interaction, args, utils) => {
const member = const member =
interaction.guild.members.cache.get(args[0]) || interaction.member; interaction.guild.members.cache.get(args[0]) || interaction.member;
const flags = {
DISCORD_EMPLOYEE: "Discord Staff<:staff:840231971526803467>",
PARTNERED_SERVER_OWNER:
"Partnered Server Owner<:partner:840231939944480829>",
BUGHUNTER_LEVEL_1: "Discord Bug Hunter<:bughunter:840231967600803920>",
BUGHUNTER_LEVEL_2: "Discord Bug Hunter<:bughunterlv2:840231970017771571>",
HYPESQUAD_EVENTS: "HypeSquad Events<:HypeSquad:840231908599922721>",
HOUSE_BRAVERY: "HypeSquad Bravery<:bravery:840231941974655007>",
HOUSE_BRILLIANCE: "HypeSquad Brilliance<:brilliance:840231943764443136>",
HOUSE_BALANCE: "HypeSquad Balance<:balance:840231925876523018>",
EARLY_SUPPORTER: "Early Supporter<:earlysupporter:840231983216984085>",
TEAM_USER: "Team User",
SYSTEM: "System",
VERIFIED_BOT: "Verified Bot<:VerifiedBot:840231982054375425>",
EARLY_VERIFIED_BOT_DEVELOPER:
"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;
// }
const x = Date.now() - member.user.createdAt; const x = Date.now() - member.user.createdAt;
const y = const y =
Date.now() - interaction.guild.members.cache.get(member.id).joinedAt; Date.now() - interaction.guild.members.cache.get(member.id).joinedAt;
const created = Math.floor(x / 86400000); const created = Math.floor(x / 86400000);
const joined = Math.floor(y / 86400000); const joined = Math.floor(y / 86400000);
const nickname = member.nickname || "None"; const nickname =
member.nickname !== undefined && member.nickname !== null
? member.nickname
: "None";
const roles = member.roles.cache const roles = member.roles.cache
.filter(r => r.id != interaction.guild.id) .filter(r => r.id != interaction.guild.id)
.sort((a, b) => b.position - a.position) .sort((a, b) => b.position - a.position)
.map(role => role.toString()); .map(role => role.toString())
const createDateFormatted = utils.parseDate( .slice(0, -1);
new Date(member.user.createdAt) const userFlags = member.user.flags.toArray();
const createdate = moment(member.user.createdAt).format(
"dddd, MMMM Do YYYY, HH:mm:ss"
); );
const joinDateFormatted = utils.parseDate(new Date(member.joinedAt)); const joindate = moment(member.joinedAt).format(
const embed = new EmbedBuilder() "dddd, MMMM Do YYYY, HH:mm:ss"
.setAuthor({ );
name: member.user.tag, // let activities;
iconURL: member.user.displayAvatarURL({ dynamic: true, size: 4096 }), // 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() .setTimestamp()
.setColor(member.displayHexColor || client.color) .setColor(member.displayHexColor || client.color)
.setURL(client.web) .setURL(client.web)
.setFooter({ .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
text: `Made by ${client.author}`, .setThumbnail(member.user.displayAvatarURL({ dynamic: true, size: 512 }))
iconURL: client.user.displayAvatarURL({ dynamic: true, size: 4096 }), .setColor(member.displayHexColor || client.color)
}) .addField(
.setThumbnail(member.user.displayAvatarURL({ dynamic: true, size: 4096 })) "User",
.addFields([ `** Username:** ${member.user.username}
{
name: "User",
value: `** User Tag:** ${member.user.tag} ${client.owners.includes(member.id) ? client.dev : ""}
** Username:** ${member.user.username}
** Discriminator:** ${member.user.discriminator} ** Discriminator:** ${member.user.discriminator}
** Nickname:** ${nickname} ** Nickname:** ${nickname}
** User ID:** ${member.id} ** User ID:** ${member.id}
** Badge:** ${
userFlags.length
? userFlags.map(flag => flags[flag]).join(" **|** ")
: "None"
}
** Avatar:** [Link to avatar](${member.user.displayAvatarURL({ ** Avatar:** [Link to avatar](${member.user.displayAvatarURL({
dynamic: true, dynamic: true,
size: 2048, size: 2048,
})}) })})
** Time Created:** ${createDateFormatted} \nSince ${created} day${created <= 1 ? "" : "s"} ago ** Time Created:** ${createdate} \nSince ${created} day(s) ago
\u200b`, \u200b`
}, ) //* * Status:** ${status}* * Game:** ${activities}
{ .addField(
name: "Member", "Member",
value: `** Highest Role:** ${ `** Highest Role:** ${
member.roles.highest.id === interaction.guild.id member.roles.highest.id === interaction.guild.id
? "None" ? "None"
: member.roles.highest.name : member.roles.highest.name
} }
** Server Join Date:** ${joinDateFormatted} \nSince ${joined} day${joined <= 1 ? "" : "s"} ago ** Server Join Date:** ${joindate} \nSince ${joined} day(s) ago
** Roles [${roles.length}]:** ${ ** Roles [${roles.length}]:** ${
roles.length < 10 && roles.length > 0 roles.length < 10
? roles.join(" **|** ") ? roles.join(" **|** ")
: roles.length > 0 : roles.length > 10
? utils.trimArray(roles) ? utils.trimArray(roles)
: "None" : "None"
} }
\u200b`, \u200b`
}, );
]);
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
}, },
}; };

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

@ -0,0 +1,85 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "clear",
description: "Clear messages in a specific channel",
options: [
{
name: "channel",
description: "Channel where the messages to be deleted",
type: 7,
required: true,
channelTypes: ["GUILD_TEXT"],
},
{
name: "amount",
description: "Amount of message in range of 1-100 to be deleted",
type: 4,
required: true,
},
],
type: "CHAT_INPUT",
run: async (client, interaction, args) => {
try {
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",
});
}
if (channel.type !== "GUILD_TEXT") {
return interaction.followUp({
content: "Please provide a text channel",
});
}
const limit = await interaction.channel.messages.fetch({
limit: query,
});
await channel.bulkDelete(limit, true).then(async m => {
const results = {};
for (const [, deleted] of m) {
const user = `${deleted.author.username}#${deleted.author.discriminator}`;
if (!results[user]) results[user] = 0;
results[user]++;
}
const userMessageMap = Object.entries(results);
channel.send({
embeds: [
new MessageEmbed()
.setTitle(`Message Cleared`)
.addField(
"**Moderator**",
`${
interaction.member.nickname
? interaction.member.nickname
: interaction.user.username
}`,
true
)
.addField("Amount of Message Deleted", `${m.size}/${query}`, true)
.addField(
"Authors",
`${userMessageMap
.map(([user, messages]) => `**${user}** : ${messages}`)
.join("\n")}`,
false
)
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.setTimestamp()
.setThumbnail(
interaction.user.displayAvatarURL({ dynamic: true })
)
.setColor(client.color),
],
});
});
} 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

@ -0,0 +1,102 @@
const Discord = require("discord.js");
module.exports = {
name: "slowmode",
UserPerms: ["MANAGE_CHANNELS"],
description: "Set slowmode at a specific channel",
BotPerms: ["MANAGE_CHANNELS"],
usage: "(Time)",
category: "Moderation",
run: async (client, interaction, args, utils) => {
await interaction.deleteReply();
const menu = new Discord.MessageSelectMenu()
.setCustomId("select")
.setPlaceholder("Select a time")
.addOptions([
{ label: "OFF", value: "OFF" },
{ label: "5s", value: "5s" },
{ label: "10s", value: "10s" },
{ label: "15s", value: "15s" },
{ label: "30s", value: "30s" },
{ label: "1m", value: "1m" },
{ label: "2m", value: "2m" },
{ label: "5m", value: "5m" },
{ label: "10m", value: "10m" },
{ label: "15m", value: "15m" },
{ label: "30m", value: "30m" },
{ label: "1h", value: "1h" },
{ label: "2h", value: "2h" },
{ label: "6h", value: "6h" },
]);
let row = new Discord.MessageActionRow().addComponents(menu);
const slowmoEmbed = new Discord.MessageEmbed()
.setColor(client.color)
.setTitle("Slowmode")
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setAuthor(
`Requested by ${interaction.user.tag}`,
interaction.user.displayAvatarURL({ dynmiac: true })
);
interaction.channel
.send({ embeds: [slowmoEmbed], components: [row] })
.then(sent => {
const filter = i => {
i.deferUpdate();
if (i.user.id === interaction.user.id) return true;
return;
};
const collector = sent.createMessageComponentCollector({
filter,
componentType: "SELECT_MENU",
time: 30e3,
});
collector.on("collect", collected => {
collector.resetTimer({ time: 30e3 });
menu.setPlaceholder(`Set to: ${collected.values[0]}`);
row = new Discord.MessageActionRow().addComponents(menu);
if (collected.values[0] !== "OFF") {
const embed = new Discord.MessageEmbed()
.setColor("GREEN")
.setTitle("Slowmode Added")
.addField("**Moderator**", interaction.user.tag, true)
.addField("**Channel**", `<#${interaction.channel.id}>`, true)
.addField(
"**Rate**",
`${utils.ms(utils.ms(collected.values[0]), { long: true })}`,
true
)
.setFooter(
interaction.member.displayName || interaction.user.username,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setThumbnail(client.user.displayAvatarURL());
interaction.channel.setRateLimitPerUser(
utils.ms(collected.values[0]) / 1e3
);
return sent.edit({ embeds: [embed], components: [row] });
} else {
const embed = new Discord.MessageEmbed()
.setColor("RED")
.setTitle("Slowmode Removed")
.addField("**Moderator**", interaction.user.tag, true)
.addField("**Channel**", `<#${interaction.channel.id}>`, true)
.setFooter(
interaction.member.displayName || interaction.user.username,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setThumbnail(client.user.displayAvatarURL())
.setColor("RED");
interaction.channel.setRateLimitPerUser(0);
return sent.edit({ embeds: [embed], components: [row] });
}
});
collector.on("end", () => {
menu.setDisabled(true);
row = new Discord.MessageActionRow().addComponents(menu);
return sent.edit({ components: [row] });
});
});
},
};

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

273
command/Moderation/warn.js Normal file
View file

@ -0,0 +1,273 @@
const db = require("../../models/warns");
const moment = require("moment");
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "warn",
UserPerms: ["MANAGE_MESSAGES"],
description: "Add/remove/show warnings of an user",
category: "Moderation",
options: [
{
type: 1,
name: "add",
description: "Warn a user",
options: [
{
type: 6,
name: "user",
description: "The user you want to warn",
required: true,
},
{
type: 3,
name: "reason",
description: "The reason you want to warn",
required: false,
},
],
},
{
type: 1,
name: "list",
description: "Show a list of warnings of an user",
options: [
{
type: 6,
name: "user",
description: "The user to show the list",
required: true,
},
],
},
{
type: 1,
name: "remove",
description: "Remove a latest warn for an user",
options: [
{
type: 6,
name: "user",
description: "The user to remove warn",
required: true,
},
{
type: 4,
name: "number",
description: "The number of warn",
required: true,
},
],
},
{
type: 1,
name: "clear",
description: "Clear an user's warns",
options: [
{
type: 6,
name: "user",
description: "The user to clear warns",
required: true,
},
],
},
],
run: async (client, interaction, args) => {
try {
if (args[0] == "add") {
const user = interaction.guild.members.cache.get(args[1]);
const reason = args[2] || "No reason provided";
if (user.id === interaction.user.id) {
interaction.followUp({ content: "You can't warn 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) + "...";
db.findOne(
{ Guild: interaction.guild.id, User: user.id },
async (err, data) => {
if (!data) {
data = new db({
Guild: interaction.guild.id,
User: user.id,
Warns: [
{
Reason: reason,
Moderator: interaction.user.id,
Timestamp: Date.now(),
},
],
});
} else {
data.Warns.push({
Reason: reason,
Moderator: interaction.user.id,
Timestamp: Date.now(),
});
}
data.save();
}
);
user
.send({
content: `You have been warned in **${interaction.guild.name}** for **${reason}**`,
})
.catch(e => {});
const embed = new MessageEmbed()
.setTitle("User Warned")
.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 (args[0] == "list") {
const user = interaction.guild.members.cache.get(args[1]);
db.findOne(
{ Guild: interaction.guild.id, User: user.id },
async (err, data) => {
if (data.Warns.map(e => e).length > 0) {
interaction.followUp({
embeds: [
new MessageEmbed()
.setTitle(`${user.user.tag}'s warns`)
.setDescription(
data.Warns.map(
(w, i) =>
`\`${i + 1}\` | Moderator: ${
interaction.guild.members.cache.get(w.Moderator) ||
"Unknown"
}\nReason: ${w.Reason}\nDate: ${moment(
w.Timestamp
).format("MMMM Do YYYY")}`
).join("\n\n")
)
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.setTimestamp()
.setColor(client.color),
],
});
} else {
interaction.followUp({
content: `User doesn't have any warns`,
});
}
}
);
} else if (args[0] == "remove") {
const user = interaction.guild.members.cache.get(args[1]);
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",
});
}
db.findOne(
{ Guild: interaction.guild.id, User: user.id },
async (err, data) => {
if (err) throw err;
if (data) {
const number = args[2] - 1;
data.Warns.splice(number, 1);
const embed = new MessageEmbed()
.setTitle("Warn Removed")
.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] });
data.save();
} else {
interaction.followUp({
content: `User doesn't have any warns`,
});
}
}
);
} else {
const user = interaction.guild.members.cache.get(args[1]);
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",
});
}
db.findOne(
{ Guild: interaction.guild.id, User: user.id },
async (err, data) => {
if (data) {
await db.findOneAndDelete({
Guild: interaction.guild.id,
User: user.id,
});
interaction.followUp({
embeds: [
new MessageEmbed()
.setTitle(`Warns Cleared`)
.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),
],
});
} else {
interaction.followUp({
content: `User doesn't have any warns`,
});
}
}
);
}
} catch (e) {
console.log(e);
interaction.followUp({ content: `**Error**: ${e.message}` });
}
},
};

View file

@ -0,0 +1,53 @@
const levels = {
none: 0.0,
low: 0.2,
medium: 0.3,
high: 0.35,
};
module.exports = {
name: "bassboost",
description: "Set filter/bassboost level",
category: "Music",
usage: "(Number)",
Premium: true,
options: [
{
type: 3,
name: "level",
description: `Please provide a bassboost level`,
required: true,
choices: [
{ name: "low", value: "low" },
{ name: "medium", value: "medium" },
{ name: "high", value: "high" },
{ name: "none", value: "none" },
],
},
],
run: async (client, interaction, args) => {
const player = await client.manager.get(interaction.guild.id);
const channel = interaction.member.voice.channel.id;
if (!channel) {
client.err(
interaction,
"**You must be in a voice channel to use this command.**"
);
}
if (player.voiceChannel !== channel) {
client.err(
interaction,
"**You must be in the same voice channel as me to use this command**"
);
}
if (!player) client.err(interaction, "**Nothing is playing right now**");
player.setEQ(
...new Array(3)
.fill(null)
.map((_, i) => ({ band: i, gain: levels[args[0]] }))
);
client.se(
interaction,
`✅ | **Set the bassboost level to** \`${args[0]}\``
);
},
};

View file

@ -0,0 +1,24 @@
module.exports = {
name: "clear-queue",
description: "Clears the server queue",
category: "Music",
run: async (client, interaction, args) => {
const player = client.manager.get(interaction.guild.id);
const channel = interaction.member.voice.channel.id;
if (!channel) {
client.err(
interaction,
"**You must be in a voice channel to use this command.**"
);
}
if (player.voiceChannel !== channel) {
client.err(
interaction,
"**You must be in the same voice channel as me to use this command**"
);
}
if (!player) client.err(interaction, "**Nothing is playing right now**");
player.queue.clear();
client.se(interaction, "✅ | **Cleared the queue!**");
},
};

View file

@ -0,0 +1,25 @@
module.exports = {
name: "disconnect",
description: "To stop the music and clear the queue",
category: "Music",
run: async (client, interaction, args) => {
const player = await client.manager.get(interaction.guild.id);
const channel = interaction.member.voice.channel.id;
if (!channel) {
return client.err(
interaction,
"**You must be in a voice channel to use this command.**"
);
}
if (player.voiceChannel !== channel) {
return client.err(
interaction,
"**You must be in the same voice channel as me to use this command**"
);
}
if (!player) client.err(interaction, "**Nothing is playing right now**");
player.destroy();
client.se(interaction, "🎶| **Disconnected!**");
},
};

52
command/Music/grab.js Normal file
View file

@ -0,0 +1,52 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "grab",
description: "Saves the current song to your Direct Messages",
run: async (client, interaction, args, utils) => {
const player = await client.manager.get(interaction.guild.id);
const channel = interaction.member.voice.channel.id;
if (!channel) {
client.err(
interaction,
"**You must be in a voice channel to use this command.**"
);
}
if (player.voiceChannel !== channel) {
client.err(
interaction,
"**You must be in the same voice channel as me to use this command**"
);
}
if (!player) client.err(interaction, "**Nothing is playing right now**");
try {
const embed = new MessageEmbed()
.setAuthor(
`Song saved: `,
"https://cdn.discordapp.com/emojis/897017864085712936.gif"
)
.setThumbnail(
`https://img.youtube.com/vi/${player.queue.current.identifier}/mqdefault.jpg`
)
.setURL(player.queue.current.uri)
.setColor(client.color)
.setTimestamp()
.setTitle(`**${player.queue.current.title}**`)
.addField(
`⌛ Duration: `,
`\`${utils.prettyMs(player.queue.current.duration, {
colonNotation: true,
})}\``,
true
)
.addField(`🎵 Author: `, `\`${player.queue.current.author}\``, true)
.addField(`▶ Play it:`, `\`${player.queue.current.uri}\``)
.addField(`🔎 Saved in:`, `<#${interaction.channel.id}>`)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL());
interaction.user.send({ embeds: [embed] });
} catch (e) {
console.log(e);
return client.err(interaction, "**Your DM are disabled**");
}
client.se(interaction, "✅ | **Check your DM**");
},
};

53
command/Music/loop.js Normal file
View file

@ -0,0 +1,53 @@
module.exports = {
name: "loop",
description: "Music loop",
category: "Music",
options: [
{
type: 1,
name: "track",
description: "Loop the track",
options: [],
},
{
type: 1,
name: "queue",
description: "Loop the whole queue",
options: [],
},
],
run: async (client, interaction, args) => {
const player = await client.manager.get(interaction.guild.id);
const channel = interaction.member.voice.channel.id;
if (!channel) {
client.err(
interaction,
"**You must be in a voice channel to use this command.**"
);
}
if (player.voiceChannel !== channel) {
client.err(
interaction,
"**You must be in the same voice channel as me to use this command**"
);
}
if (!player) client.err(interaction, "**Nothing is playing right now**");
if (args[0] === "track") {
player.setTrackRepeat(player.trackRepeat ? false : true);
client.se(
interaction,
`🔂 \`Music loop is now ${
player.trackRepeat ? "enabled" : "disabled"
}\``
);
} else {
player.setQueueRepeat(player.queueRepeat ? false : true);
client.se(
interaction,
`🔂 \`Queue Loop is now ${
player.trackRepeat ? "enabled" : "disabled"
}\``
);
}
},
};

50
command/Music/move.js Normal file
View file

@ -0,0 +1,50 @@
module.exports = {
name: "move",
description: "Moves a track to a specified position",
options: [
{
type: 4,
name: "track",
description: "Track to move.",
required: true,
},
{
type: 4,
name: "position",
description: "Moves selected track to the specified position.",
required: true,
},
],
run: async (client, interaction, args) => {
const player = await client.manager.get(interaction.guild.id);
const channel = interaction.member.voice.channel.id;
if (!channel) {
client.err(
interaction,
"**You must be in a voice channel to use this command.**"
);
}
if (player.voiceChannel !== channel) {
client.err(
interaction,
"**You must be in the same voice channel as me to use this command**"
);
}
if (!player) client.err(interaction, "**Nothing is playing right now**");
const trackNum = args[0] - 1;
const dest = args[1] - 1;
if (trackNum < 0 || trackNum > player.queue.length - 1) {
client.err(interaction, "**Invalid track number**");
} else if (dest < 0 || dest > player.queue.length - 1) {
client.err(interaction, "**Invalid track destination**");
} else {
const track = player.queue[trackNum];
player.queue.splice(trackNum, 1);
player.queue.splice(dest, 0, track);
client.se(
interaction,
`✅ | **${track.title}** has been moved to position ${dest + 1}`
);
}
},
};

View file

@ -0,0 +1,64 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "nowplaying",
description: "Show now playing music info",
category: "Music",
run: async (client, interaction, args, utils) => {
const player = await client.manager.get(interaction.guild.id);
const channel = interaction.member.voice.channel.id;
if (!channel) {
client.err(
interaction,
"**You must be in a voice channel to use this command.**"
);
}
if (player.voiceChannel !== channel) {
client.err(
interaction,
"**You must be in the same voice channel as me to use this command**"
);
}
if (!player) client.err(interaction, "**Nothing is playing right now**");
interaction.followUp({
embeds: [
new MessageEmbed()
.setAuthor(
`Current song playing:`,
client.user.displayAvatarURL({
dynamic: true,
})
)
.addField(
"🕰️ Duration: ",
`${
utils.progressBar(
player.position,
player.queue.current.duration,
15
).Bar
} \`${utils.prettyMs(player.position, {
colonNotation: true,
})} / ${utils.prettyMs(player.queue.current.duration, {
colonNotation: true,
})}\``
)
.setThumbnail(player.queue.current.displayThumbnail())
.setURL(player.queue.current.uri)
.setColor(client.color)
.setTitle(`🎶 **${player.queue.current.title}** 🎶`)
.addField(`🎼 Song By: `, `\`${player.queue.current.author}\``, true)
.addField(
`🔢 Queue length: `,
`\`${player.queue.length} Songs\``,
true
)
.setFooter(
`Requested by: ${player.queue.current.requester.tag}`,
player.queue.current.requester.displayAvatarURL({
dynamic: true,
})
),
],
});
},
};

29
command/Music/pause.js Normal file
View file

@ -0,0 +1,29 @@
module.exports = {
name: "pause",
description: "Pauses the current playing music",
category: "Music",
run: async (client, interaction, args) => {
const player = await client.manager.get(interaction.guild.id);
const channel = interaction.member.voice.channel.id;
if (!channel) {
return client.err(
interaction,
"**You must be in a voice channel to use this command.**"
);
}
if (player.voiceChannel !== channel) {
return client.err(
interaction,
"**You must be in the same voice channel as me to use this command**"
);
}
if (!player) client.err(interaction, "**Nothing is playing right now**");
if (player.paused) {
client.err(interaction, "Music is already paused");
} else {
player.pause(true);
client.se(interaction, "**⏯ Paused!**");
}
},
};

145
command/Music/play.js Normal file
View file

@ -0,0 +1,145 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "play",
description: "Plays your favourite music from YouTube or Spotify",
usage: "(Song/Song URL)",
category: "Music",
options: [
{
type: 3,
name: "song",
description: "Play song or a playlist in the voice channel",
required: true,
},
],
run: async (client, interaction, args, utils) => {
const voiceChannel = interaction.member.voice.channel;
if (!voiceChannel) {
client.err(
interaction,
"**You must be in a voice channel to use this command**"
);
} else {
const player = client.manager.create({
guild: interaction.guild.id,
voiceChannel: voiceChannel.id,
textChannel: interaction.channel.id,
selfDeafen: true,
volume: 100,
});
if (player.state != "CONNECTED") await player.connect();
const search = args[0];
let res;
try {
res = await player.search(search, interaction.user);
if (res.loadType === "LOAD_FAILED") {
if (!player.queue.current) player.destroy();
client.err(interaction, "**There was an error while searching**");
}
} catch {
client.err(interaction, "**There was an error while searching**");
}
switch (res.loadType) {
case "NO_MATCHES":
if (!player.queue.current) player.destroy();
client.err(interaction, "**No results were found**");
break;
case "TRACK_LOADED":
player.queue.add(res.tracks[0]);
if (!player.playing && !player.paused && !player.queue.length) {
player.play();
}
const SongAddedEmbed = new MessageEmbed()
.setAuthor(`Added to queue`, client.user.displayAvatarURL())
.setThumbnail(res.tracks[0].displayThumbnail())
.setColor(client.color)
.setDescription(`[${res.tracks[0].title}](${res.tracks[0].uri})`)
.addField(
"Duration",
`\`${utils.prettyMs(res.tracks[0].duration, {
colonNotation: true,
})}\``,
true
);
if (player.queue.totalSize > 1) {
SongAddedEmbed.addField(
"Position in queue",
`${player.queue.size - 0}`,
true
);
}
interaction.followUp({ embeds: [SongAddedEmbed] });
break;
case "PLAYLIST_LOADED":
player.queue.add(res.tracks);
await player.play();
const SongAdded = new MessageEmbed()
.setAuthor(
`Playlist added to queue`,
client.user.displayAvatarURL()
)
.setThumbnail(res.tracks[0].displayThumbnail())
.setColor(client.color)
.setDescription(`[${res.playlist.name}](${args[0]})`)
.addField("Enqueued", `\`${res.tracks.length}\` songs`, false)
.addField(
"Playlist duration",
`\`${utils.prettyMs(res.playlist.duration, {
colonNotation: true,
})}\``,
false
);
interaction.followUp({ embeds: [SongAdded] });
break;
case "SEARCH_RESULT":
const track = res.tracks[0];
player.queue.add(track);
if (!player.playing && !player.paused && !player.queue.length) {
const SongAddedEmbed = new MessageEmbed()
.setAuthor(`Added to queue`, client.user.displayAvatarURL())
.setThumbnail(track.displayThumbnail())
.setColor(client.color)
.setDescription(`[${track.title}](${track.uri})`)
.addField(
"Duration",
`\`${utils.prettyMs(track.duration, {
colonNotation: true,
})}\``,
true
);
if (player.queue.totalSize > 1) {
SongAddedEmbed.addField(
"Position in queue",
`${player.queue.size - 0}`,
true
);
}
player.play();
interaction.followUp({ embeds: [SongAddedEmbed] });
} else {
const SongAddedEmbed = new MessageEmbed()
.setAuthor(`Added to queue`, client.user.displayAvatarURL())
.setThumbnail(track.displayThumbnail())
.setColor(client.color)
.setDescription(`[${track.title}](${track.uri})`)
.addField(
"Duration",
`\`${utils.prettyMs(track.duration, {
colonNotation: true,
})}\``,
true
);
if (player.queue.totalSize > 1) {
SongAddedEmbed.addField(
"Position in queue",
`${player.queue.size - 0}`,
true
);
}
interaction.followUp({ embeds: [SongAddedEmbed] });
break;
}
}
}
},
};

114
command/Music/queue.js Normal file
View file

@ -0,0 +1,114 @@
const { MessageEmbed } = require("discord.js");
const { Pagination } = require("cath");
module.exports = {
name: "queue",
description: "To show the songs queue",
category: "Music",
run: async (client, interaction, args, utils) => {
const pagination = new Pagination();
const player = await client.manager.get(interaction.guild.id);
const channel = interaction.member.voice.channel.id;
if (!channel) {
client.err(
interaction,
"**You must be in a voice channel to use this command.**"
);
}
if (player.voiceChannel !== channel) {
client.err(
interaction,
"**You must be in the same voice channel as me to use this command**"
);
}
if (!player) client.err(interaction, "**Nothing is playing right now**");
if (!player.queue || !player.queue.length || player.queue === 0) {
const QueueEmbed = new MessageEmbed()
.setAuthor(
"Currently playing",
interaction.user.displayAvatarURL({ dynamic: true })
)
.setColor(client.color)
.setDescription(
`[${player.queue.current.title}](${player.queue.current.uri})`
)
.addField("Requested by", `${player.queue.current.requester}`, true)
.addField(
"Duration",
`${
utils.progressBar(
player.position,
player.queue.current.duration,
15
).Bar
} \`[${utils.prettyMs(player.position, {
colonNotation: true,
})} / ${utils.prettyMs(player.queue.current.duration, {
colonNotation: true,
})}]\``
)
.setTimestamp()
.setThumbnail(player.queue.current.displayThumbnail());
interaction.followUp({ embeds: [QueueEmbed] });
}
const queue = player.queue.map((t, i) => {
t.index = i;
return t;
});
const mapped = queue.map((t, i) => {
if (i == 0) {
return `**Up Next:** \n\`${t.index + 1}:\` [${t.title}](${
t.uri
}) \n\`${utils.prettyMs(t.duration, {
colonNotation: true,
})}\` **|** Requested by: ${t.requester}\n`;
} else {
return `\n\`${t.index + 1}:\` [${t.title}](${
t.uri
}) \n\`${utils.prettyMs(t.duration, {
colonNotation: true,
})}\` **|** Requested by: ${t.requester}\n`;
}
});
const c = pagination.chunk(mapped, 10).map(x => x.join("\n"));
const embed = new MessageEmbed()
.setAuthor(
`Queue for ${interaction.guild.name}`,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setColor(client.color)
.setDescription(c[0])
.addField("Total songs: \n", `\`${player.queue.totalSize - 1}\``, true)
.addField(
"Total length: \n",
`\`${utils.prettyMs(player.queue.duration, {
colonNotation: true,
})}\``,
true
)
.addField("Requested by:", `${player.queue.current.requester}`, true)
.addField(
"Current song duration:",
`${
utils.progressBar(player.position, player.queue.current.duration, 15)
.Bar
} \`[${utils.prettyMs(player.position, {
colonNotation: true,
})} / ${utils.prettyMs(player.queue.current.duration, {
colonNotation: true,
})}]\``
)
.addField(
"**Currently Playing:**",
`[${player.queue.current.title}](${player.queue.current.uri})`,
true
)
.setTimestamp()
.setFooter(`Page 1 of ${c.length}`)
.setThumbnail(player.queue.current.displayThumbnail());
const msg = await interaction.followUp({
embeds: [embed],
});
pagination.pagination(msg, interaction.user, c);
},
};

42
command/Music/remove.js Normal file
View file

@ -0,0 +1,42 @@
module.exports = {
name: "remove",
description: "Remove a song from the queue",
category: "Music",
options: [
{
type: 4,
name: "track",
description: "Remove a song from the queue",
required: true,
},
],
run: async (client, interaction, args) => {
const player = await client.manager.get(interaction.guild.id);
const channel = interaction.member.voice.channel.id;
if (!channel) {
client.err(
interaction,
"**You must be in a voice channel to use this command.**"
);
}
if (player.voiceChannel !== channel) {
client.err(
interaction,
"**You must be in the same voice channel as me to use this command**"
);
}
if (!player) client.err(interaction, "**Nothing is playing right now**");
if (args[0] > player.queue.length) {
client.err(
interaction,
`The queue has only **${player?.queue.length}** songs`
);
} else {
client.se(
interaction,
`✅ | **Removed track** \`${parseInt(args[0])}\` from the queue!`
);
player.queue.remove(parseInt(args[0]) - 1);
}
},
};

28
command/Music/resume.js Normal file
View file

@ -0,0 +1,28 @@
module.exports = {
name: "resume",
description: "Pauses the current playing music",
category: "Music",
run: async (client, interaction) => {
const player = await client.manager.get(interaction.guild.id);
const channel = interaction.member.voice.channel.id;
if (!channel) {
client.err(
interaction,
"**You must be in a voice channel to use this command.**"
);
}
if (player.voiceChannel !== channel) {
client.err(
interaction,
"**You must be in the same voice channel as me to use this command**"
);
}
if (!player) client.err(interaction, "**Nothing is playing right now**");
if (player.playing) {
client.err(interaction, "**Music is already resumed!**");
} else {
player.pause(false);
client.se(interaction, "**⏯ Resumed!**");
}
},
};

53
command/Music/seek.js Normal file
View file

@ -0,0 +1,53 @@
module.exports = {
name: "seek",
description: "seek the current playing music",
category: "Music",
usage: "(Number)",
options: [
{
type: 3,
name: "position",
description: "Enter a timestamp you want to seek to. Example - 2m 10s",
required: true,
},
],
run: async (client, interaction, args, utils) => {
const player = await client.manager.get(interaction.guild.id);
const channel = interaction.member.voice.channel.id;
if (!channel) {
client.err(
interaction,
"**You must be in a voice channel to use this command.**"
);
}
if (player.voiceChannel !== channel) {
client.err(
interaction,
"**You must be in the same voice channel as me to use this command**"
);
}
if (!player) client.err(interaction, "**Nothing is playing right now**");
const SeekTo = utils.parseTimestring(args[0]);
if (SeekTo < 0 || SeekTo >= player.queue.current.duration / 1000) {
client.err(
interaction,
`You may seek from \`0\` - \`${player.queue.current.duration}\`\nExample - 2m 10s`
);
}
if (!player.queue.current.isSeekable) {
client.err(interaction, "**I'm not able to seek this song**");
}
if (!SeekTo) {
client.err(
interaction,
`You may seek from \`0\` - \`${player.queue.current.duration}\`\nExample - 2m 10s`
);
}
player.seek(SeekTo * 1000);
client.se(
interaction,
"✅ | **Successfully moved the song to **",
`\`${SeekTo}\``
);
},
};

27
command/Music/shuffle.js Normal file
View file

@ -0,0 +1,27 @@
module.exports = {
name: "shuffle",
description: "Music shuffle",
category: "Music",
run: async (client, interaction) => {
const player = await client.manager.get(interaction.guild.id);
const channel = interaction.member.voice.channel.id;
if (!channel) {
client.err(
interaction,
"**You must be in a voice channel to use this command.**"
);
}
if (player.voiceChannel !== channel) {
client.err(
interaction,
"**You must be in the same voice channel as me to use this command**"
);
}
if (!player) client.err(interaction, "**Nothing is playing right now**");
if (!player.queue || !player.queue.length || player.queue.length === 0) {
client.err(interaction, "**Not enough songs in the queue to shuffle**");
}
player.queue.shuffle();
client.se(interaction, "✅ | Shuffled the queue");
},
};

38
command/Music/skip.js Normal file
View file

@ -0,0 +1,38 @@
module.exports = {
name: "skip",
description: "Skips to a song in a queue",
category: "Music",
options: [
{
type: 4,
name: "position",
description: "Skips to a specific song in the queue",
required: true,
},
],
run: async (client, interaction, args) => {
const player = await client.manager.get(interaction.guild.id);
const channel = interaction.member.voice.channel.id;
if (!channel) {
client.err(
interaction,
"**You must be in a voice channel to use this command.**"
);
}
if (player.voiceChannel !== channel) {
client.err(
interaction,
"**You must be in the same voice channel as me to use this command**"
);
}
if (!player?.queue?.current) {
client.err(interaction, "**Nothing is playing right now**");
}
const skipTo = args[0];
if (skipTo < 1 || skipTo > player.queue.length) {
client.err(interaction, "❌ | **Invalid number to skip!**");
}
player.stop(skipTo);
client.se(interaction, `⏭ Skipped \`${Number(skipTo)}\` songs`);
},
};

37
command/Music/volume.js Normal file
View file

@ -0,0 +1,37 @@
module.exports = {
name: "volume",
description: "To change the server song queue volume",
category: "Music",
description: "Set volume level of the music",
options: [
{
type: 4,
name: "volume",
description: "The volume of the player. Default is 100",
required: true,
},
],
run: async (client, interaction) => {
const player = await client.manager.get(interaction.guild.id);
const channel = interaction.member.voice.channel.id;
if (!channel) {
client.err(
interaction,
"**You must be in a voice channel to use this command.**"
);
}
if (player.voiceChannel !== channel) {
client.err(
interaction,
"**You must be in the same voice channel as me to use this command**"
);
}
if (!player) client.err(interaction, "**Nothing is playing right now**");
const vol = parseInt(args[0]);
player.setVolume(vol);
client.se(
interaction,
`🔉 | The player's volume has been set to \`${player.volume}\``
);
},
};

40
command/NSFW/ass.js Normal file
View file

@ -0,0 +1,40 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "ass",
description: "Get some ass images",
run: async (client, interaction) => {
if (!interaction.channel.nsfw) {
const embed = new MessageEmbed()
.setTitle(`AYO Calm Yo Cheeks`)
.setDescription("This command only works in NSFW Channels!")
.setImage(
"https://media.discordapp.net/attachments/851761493815853060/893777701599584266/warning.gif"
)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
} else {
const subreddits = ["ass", "BestBooties", "BootyGIFs", "booty_queens"];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
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 }),
},
}),
],
});
}
},
};

48
command/NSFW/blowjob.js Normal file
View file

@ -0,0 +1,48 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "blowjob",
description: "Get some blowjob images",
run: async (client, interaction) => {
if (!interaction.channel.nsfw) {
const embed = new MessageEmbed()
.setTitle(`AYO Calm Yo Cheeks`)
.setDescription("This command only works in NSFW Channels!")
.setImage(
"https://media.discordapp.net/attachments/851761493815853060/893777701599584266/warning.gif"
)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
} else {
const subreddits = [
"BlowJob",
"blowjobs",
"blowjobgifs",
"OralSex",
"PushHerHead",
"ThroatFuck",
];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
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 }),
},
}),
],
});
}
},
};

40
command/NSFW/boobs.js Normal file
View file

@ -0,0 +1,40 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "boobs",
description: "Get some boobie images",
run: async (client, interaction) => {
if (!interaction.channel.nsfw) {
const embed = new MessageEmbed()
.setTitle(`AYO Calm Yo Cheeks`)
.setDescription("This command only works in NSFW Channels!")
.setImage(
"https://media.discordapp.net/attachments/851761493815853060/893777701599584266/warning.gif"
)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
} else {
const subreddits = ["boobs", "GrabHerTitties", "titfuck"];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
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 }),
},
}),
],
});
}
},
};

40
command/NSFW/hentai.js Normal file
View file

@ -0,0 +1,40 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "hentai",
description: "Get some hentai images",
run: async (client, interaction) => {
if (!interaction.channel.nsfw) {
const embed = new MessageEmbed()
.setTitle(`AYO Calm Yo Cheeks`)
.setDescription("This command only works in NSFW Channels!")
.setImage(
"https://media.discordapp.net/attachments/851761493815853060/893777701599584266/warning.gif"
)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
} else {
const subreddits = ["hentai", "HentaiAnime", "nekogirls"];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
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 }),
},
}),
],
});
}
},
};

42
command/NSFW/pussy.js Normal file
View file

@ -0,0 +1,42 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "pussy",
description: "Get some vagina images",
run: async (client, interaction) => {
if (!interaction.channel.nsfw) {
const embed = new MessageEmbed()
.setTitle(`AYO Calm Yo Cheeks`)
.setDescription("This command only works in NSFW Channels!")
.setImage(
"https://media.discordapp.net/attachments/851761493815853060/893777701599584266/warning.gif"
)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
return;
} else {
const subreddits = ["vagina", "GodPussy", "peachlips"];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
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

@ -1,4 +1,4 @@
const { EmbedBuilder } = require("discord.js"); const { MessageEmbed } = require("discord.js");
module.exports = { module.exports = {
name: "accept", name: "accept",
category: "Owner", category: "Owner",
@ -29,10 +29,10 @@ module.exports = {
); );
const suggestEmbed = await suggestionChannel.messages.fetch(MessageID); const suggestEmbed = await suggestionChannel.messages.fetch(MessageID);
const data = suggestEmbed.embeds[0]; const data = suggestEmbed.embeds[0];
const acceptEmbed = new EmbedBuilder() const acceptEmbed = new MessageEmbed()
.setAuthor(data.author.name, data.author.iconURL) .setAuthor(data.author.name, data.author.iconURL)
.setDescription(data.description) .setDescription(data.description)
.setColor("Green") .setColor("GREEN")
.addField("**Status(ACCEPTED)**", acceptQuery); .addField("**Status(ACCEPTED)**", acceptQuery);
suggestEmbed.edit({ embeds: [acceptEmbed] }); suggestEmbed.edit({ embeds: [acceptEmbed] });
const user = await client.users.cache.find( const user = await client.users.cache.find(

68
command/Owner/add.js Normal file
View file

@ -0,0 +1,68 @@
module.exports = {
name: "economy",
category: "Owner",
description: "Add/Remove coins from someone",
Owner: true,
options: [
{
type: 1,
name: "add",
description: "Remove coins from someone",
options: [
{
type: 6,
name: "user",
description: "The user you want to add",
required: true,
},
{
type: 4,
name: "cp",
description: "The amount of CP you want to add",
required: true,
},
],
},
{
type: 1,
name: "rmv",
description: "Remove coins from someone",
options: [
{
type: 6,
name: "user",
description: "The user you want to remove",
required: true,
},
{
type: 4,
name: "cp",
description: "The amount of CP you want to remove",
required: true,
},
],
},
],
run: async (client, interaction, args) => {
if (args[0] === "add") {
await client.add(args[0], args[1], interaction);
interaction.followUp({
content: `<a:nyx_checkmark:897240322411724841> Successfully added **${interaction.options.getInteger(
"cp"
)}** ${client.currency} in **${
interaction.options.getUser("user").username
}**'s balance`,
});
}
if (args[0] === "rmv") {
await client.rmv(args[0], args[1]);
interaction.followUp({
content: `<a:nyx_checkmark:897240322411724841> Successfully removed **${interaction.options.getInteger(
"cp"
)}** ${client.currency} from **${
interaction.options.getUser("user").username
}**'s balance`,
});
}
},
};

View file

@ -30,7 +30,7 @@ module.exports = {
const reason = interaction.options.getString("reason"); const reason = interaction.options.getString("reason");
if (toggle === true) { if (toggle === true) {
await client.data.BK(user.id, toggle, reason); await client.data.BK(user.id, toggle, reason);
const embed = new EmbedBuilder() const embed = new MessageEmbed()
.setTitle( .setTitle(
"<a:nyx_checkmark:897240322411724841> Successfully Blacklisted" "<a:nyx_checkmark:897240322411724841> Successfully Blacklisted"
) )
@ -39,25 +39,19 @@ module.exports = {
) )
.setURL(client.web) .setURL(client.web)
.setColor(client.color) .setColor(client.color)
.setFooter({ .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp(); .setTimestamp();
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
} else { } else {
await client.data.BK(user.id, toggle, reason); await client.data.BK(user.id, toggle, reason);
const embed = new EmbedBuilder() const embed = new MessageEmbed()
.setTitle("<a:nyx_checkmark:897240322411724841> Removed From Blacklist") .setTitle("<a:nyx_checkmark:897240322411724841> Removed From Blacklist")
.setDescription( .setDescription(
`**User:** ${user.user.tag} \`(${user.id})\`\n**Reason:** ${reason} \n**Whitelisted by:** ${interaction.member}` `**User:** ${user.user.tag} \`(${user.id})\`\n**Reason:** ${reason} \n**Whitelisted by:** ${interaction.member}`
) )
.setURL(client.web) .setURL(client.web)
.setColor(client.color) .setColor(client.color)
.setFooter({ .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp(); .setTimestamp();
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
} }

View file

@ -1,4 +1,4 @@
const { EmbedBuilder } = require("discord.js"); const { MessageEmbed } = require("discord.js");
module.exports = { module.exports = {
name: "deny", name: "deny",
category: "Owner", category: "Owner",
@ -28,10 +28,10 @@ module.exports = {
); );
const suggestEmbed = await suggestionChannel.messages.fetch(MessageID); const suggestEmbed = await suggestionChannel.messages.fetch(MessageID);
const data = suggestEmbed.embeds[0]; const data = suggestEmbed.embeds[0];
const denyEmbed = new EmbedBuilder() const denyEmbed = new MessageEmbed()
.setAuthor(data.author.name, data.author.iconURL) .setAuthor(data.author.name, data.author.iconURL)
.setDescription(data.description) .setDescription(data.description)
.setColor("Red") .setColor("RED")
.addField("**Status(DENIED)**", denyQuery); .addField("**Status(DENIED)**", denyQuery);
suggestEmbed.edit({ embeds: [denyEmbed] }); suggestEmbed.edit({ embeds: [denyEmbed] });
const user = await client.users.cache.find( const user = await client.users.cache.find(

View file

@ -5,7 +5,7 @@ module.exports = {
usage: "(Code)", usage: "(Code)",
Owner: true, Owner: true,
description: "Eval something", description: "Eval something",
type: "CHAT_INPUT",
options: [ options: [
{ {
type: 3, type: 3,
@ -47,10 +47,12 @@ module.exports = {
evaled = err; evaled = err;
} }
if (typeof evaled !== "string") evaled = require("util").inspect(evaled); if (typeof evaled !== "string") evaled = require("util").inspect(evaled);
console.log(evaled);
evaled = chunk([evaled], 750); evaled = chunk([evaled], 750);
console.log(evaled);
let reactions = ["❌", "⏪", "◀️", "⏹️", "▶️", "⏩"], let reactions = ["❌", "⏪", "◀️", "⏹️", "▶️", "⏩"],
page = 0, page = 0,
evaledEmbed = new Discord.EmbedBuilder() evaledEmbed = new Discord.MessageEmbed()
.setColor(client.color) .setColor(client.color)
.setDescription(`\`\`\`js\n${evaled[0]}\n\`\`\``) .setDescription(`\`\`\`js\n${evaled[0]}\n\`\`\``)
.setTimestamp() .setTimestamp()
@ -111,7 +113,7 @@ module.exports = {
page = evaled.length - 1; page = evaled.length - 1;
break; break;
} }
evaledEmbed = new Discord.EmbedBuilder() evaledEmbed = new Discord.MessageEmbed()
.setColor(interaction.guild.me.displayColor) .setColor(interaction.guild.me.displayColor)
.setDescription(`\`\`\`js\n${evaled[page]}\n\`\`\``); .setDescription(`\`\`\`js\n${evaled[page]}\n\`\`\``);
await mainMessage.edit({ await mainMessage.edit({

View file

@ -1,4 +1,4 @@
const { EmbedBuilder } = require("discord.js"); const { MessageEmbed } = require("discord.js");
module.exports = { module.exports = {
name: "guilds", name: "guilds",
category: "Owner", category: "Owner",
@ -15,30 +15,23 @@ module.exports = {
} members`; } members`;
}) })
.join("\n"); .join("\n");
const embed = new EmbedBuilder() const embed = new MessageEmbed()
.setTitle("Guilds") .setTitle("Guilds")
.setDescription(description) .setDescription(description)
.setColor(client.color) .setColor(client.color)
.addFields([ .addFields(
{ {
name: `Total Guilds`, name: `Total Guilds`,
value: client.guilds.cache.size value: client.guilds.cache.size,
? client.guilds.cache.size.toString()
: "0",
inline: true, inline: true,
}, },
{ {
name: `Total Members`, name: `Total Members`,
value: client.users.cache.size value: client.users.cache.size,
? client.users.cache.size.toString()
: "0",
inline: true, inline: true,
}, }
]) )
.setFooter({ .setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp(); .setTimestamp();
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
}, },

137
command/Owner/nsfw.js Normal file
View file

@ -0,0 +1,137 @@
const { getreddit } = require("cath");
const { MessageActionRow, MessageButton, MessageEmbed } = require("discord.js");
module.exports = {
name: "nsfw",
description: "nsfw command",
run: async (client, interaction) => {
const msg = await interaction.channel.send({ content: "Getting images" });
async function embed() {
if (!interaction.channel.nsfw) {
const embed = new MessageEmbed()
.setTitle(`AYO Calm Yo Cheeks`)
.setDescription("This command only works in NSFW Channels!")
.setImage(
"https://media.discordapp.net/attachments/851761493815853060/893777701599584266/warning.gif"
)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
}
let subreddits = [
"GoneWild",
"WorkGoneWild",
"GoneWild30Plus",
"hentai",
"HentaiAnime",
"nekogirls",
"ass",
"BestBooties",
"BootyGIFs",
"booty_queens",
"BlowJob",
"blowjobs",
"blowjobgifs",
"OralSex",
"boobs",
"GrabHerTitties",
"titfuck",
"milf",
"OnlyHotMilfs",
"realmoms",
"thighs",
"PerfectThighs",
"thickthighs",
];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
let embed1 = null;
embed1 = 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 }),
},
});
return embed1;
}
const row = new MessageActionRow().addComponents(
new MessageButton()
.setCustomId("reload")
.setLabel("Reload")
.setStyle("SUCCESS")
);
const disabled = new MessageActionRow().addComponents(
new MessageButton()
.setCustomId("reload")
.setLabel("Reload")
.setStyle("SECONDARY")
.setDisabled(true)
);
await msg.delete();
let m = await interaction.followUp({
embeds: [await embed()],
components: [row],
});
const collector = m.createMessageComponentCollector({
componentType: "BUTTON",
time: 120000,
});
collector.on("collect", async i => {
if (i.user.id === interaction.user.id) {
i.deferUpdate();
await update(m);
collector.stop();
} else {
i.reply({
content: `These buttons aren't for you!`,
ephemeral: true,
});
}
});
collector.on("end", (mes, r) => {
if (r == "time") {
m.edit({
components: [disabled],
});
}
});
async function update(m) {
m.edit({
embeds: [await embed()],
}).catch(null);
const collector = m.createMessageComponentCollector({
componentType: "BUTTON",
time: 120000,
});
collector.on("collect", async i => {
if (i.user.id === interaction.user.id) {
i.deferUpdate();
await update(m);
collector.stop();
} else {
i.reply({
content: `These buttons aren't for you!`,
ephemeral: true,
});
}
});
collector.on("end", (mes, r) => {
if (r == "time") {
m.edit({
components: [disabled],
});
}
});
}
},
};

35
command/Utilities/afk.js Normal file
View file

@ -0,0 +1,35 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "afk",
description: "Tell someone you are AFK.",
usage: "{Status}",
category: "Utilities",
type: "CHAT_INPUT",
options: [
{
type: 3,
name: "status",
description: "The status that shows to user while you are AFK",
required: false,
},
],
run: async (client, interaction, args) => {
const uuser = interaction.guild.members.cache.get(interaction.user.id);
const content = args[0] || "No status provided.";
uuser.setNickname(`[AFK] ${interaction.user.username}`).catch();
await client.data.AFK(interaction.user.id, content);
const embed = new MessageEmbed()
.setDescription(
`${interaction.user.username} is set into AFK.\nStatus : ${content}`
)
.setTimestamp()
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setColor(client.color)
.setAuthor(
interaction.user.username,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setURL(client.web);
interaction.followUp({ embeds: [embed] });
},
};

View file

@ -0,0 +1,83 @@
const { Util } = require("discord.js");
module.exports = {
name: "emoji",
usage: "(Emoji)",
description: "Show an emoji URL",
category: "Utilities",
type: "CHAT_INPUT",
options: [
{
type: 3,
name: "first",
description: "The first emoji",
required: true,
},
{
type: 3,
name: "second",
description: "The second emoji",
required: false,
},
{
type: 3,
name: "third",
description: "The third emoji",
required: false,
},
{
type: 3,
name: "forth",
description: "The forth emoji",
required: false,
},
{
type: 3,
name: "fifth",
description: "The fifth emoji",
required: false,
},
{
type: 3,
name: "sixth",
description: "The sixth emoji",
required: false,
},
{
type: 3,
name: "seventh",
description: "The seventh emoji",
required: false,
},
{
type: 3,
name: "eighth",
description: "The eighth emoji",
required: false,
},
{
type: 3,
name: "ninth",
description: "The ninth emoji",
required: false,
},
{
type: 3,
name: "tenth",
description: "The tenth emoji",
required: false,
},
],
run: async (client, interaction, args) => {
await interaction.deleteReply();
for (const rawEmoji of args) {
const parsedEmoji = Util.parseEmoji(rawEmoji);
if (parsedEmoji.id) {
const extension = parsedEmoji.animated ? ".gif" : ".png";
const url = `https://cdn.discordapp.com/emojis/${
parsedEmoji.id + extension
}`;
await interaction.channel.send({ content: `Emoji URL:\n${url}` });
}
}
},
};

View file

@ -0,0 +1,38 @@
module.exports = {
name: "emojiadd",
usage: "(Link) (Name)",
description: "Show an emoji URL or add the emoji to the server",
category: "Utilities",
UserPerms: ["MANAGE_EMOJIS_AND_STICKERS"],
BotPerms: ["MANAGE_EMOJIS_AND_STICKERS"],
options: [
{
type: 3,
name: "link",
description: "The link you want to add",
required: true,
},
{
type: 3,
name: "name",
description: "The emoji name you want to add",
required: true,
},
],
run: async (client, interaction, args) => {
try {
if (args[1].length < 2 || args[1].match(/\W/)) {
interaction.followUp({
content:
"The emoji name must have at least 2 charcter and must only contain alphanumeric characters & underscore",
});
}
interaction.guild.emojis.create(args[0], args[1]).then(() => {
const em = interaction.guild.emojis.cache.find(a => a.name == args[1]);
interaction.followUp(`Added <:${em.name}:${em.id}> to the server`);
});
} catch (e) {
console.log(e);
}
},
};

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