Compare commits
No commits in common. "main" and "tac-dev" have entirely different histories.
220 changed files with 37408 additions and 27395 deletions
13
.env.example
13
.env.example
|
@ -1,5 +1,10 @@
|
||||||
TOKEN =
|
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
2
.gitattributes
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Auto detect text files and perform LF normalization
|
||||||
|
* text=auto
|
24
.github/CODE_OF_CONDUCT.md
vendored
24
.github/CODE_OF_CONDUCT.md
vendored
|
@ -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
|
||||||
|
|
4
.github/CONTRIBUTING.md
vendored
4
.github/CONTRIBUTING.md
vendored
|
@ -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.
|
5
.github/PRIVACY_POLICY.md
vendored
5
.github/PRIVACY_POLICY.md
vendored
|
@ -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.**
|
|
222
.github/README.md
vendored
222
.github/README.md
vendored
|
@ -1,109 +1,113 @@
|
||||||
<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://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://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://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://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://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://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://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://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>
|
||||||
<img src ="https://forthebadge.com/images/badges/built-with-love.svg" width = "122">
|
<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>
|
||||||
</p>
|
<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>
|
||||||
<p align = "center">
|
<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://rebrand.ly/cathSupport"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner2" alt="Support Server" /></a>
|
</p>
|
||||||
</p>
|
|
||||||
|
<p align = "center">
|
||||||
<!-- description -->
|
<a href="https://rebrand.ly/cathSupport"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner2" alt="Support Server" /></a>
|
||||||
|
</p>
|
||||||
**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>
|
<!-- description -->
|
||||||
🔺 **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>
|
**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>
|
||||||
If you like this bot, feel free to :star: **Star** this repository.<br>
|
The Call of Duty Stats are courtesy of **Round Table** by Cygnoux Familia.<br><br>
|
||||||
|
If you like this bot, feel free to :star: **Star** this repository.<br>
|
||||||
> ⚠ The Verifed bot instance is current called Cath.exe, we are working on getting it changed
|
|
||||||
> <br>
|
> ⚠ The Verifed bot instance is current called Cath.exe, we are working on getting it changed
|
||||||
|
> <br>
|
||||||
# Features
|
|
||||||
|
# Features
|
||||||
> _This is a Non-Exhaustive list for commands. To access the full list of commands, check out our [Documentation](https://thunder75.gitbook.io/cath-bot/core/commands)._
|
|
||||||
|
> _This is a Non-Exhaustive list for commands. To access the full list of commands, check out our [Documentation](https://thunder75.gitbook.io/cath-bot/core/commands)._
|
||||||
<a href="https://thunder75.gitbook.io/cath-bot/core/commands" ><img src="https://img.shields.io/static/v1?label=List %20OF&message=Commands&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
|
|
||||||
|
<a href="https://thunder75.gitbook.io/cath-bot/core/commands" ><img src="https://img.shields.io/static/v1?label=List %20OF&message=Commands&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
|
||||||
🚨 **Moderation** - Classic commands like kick, ban, warn, role and many more. <br>
|
|
||||||
📈 **Economy** - A Robust economy system, inspired by **pepe bot** <br>
|
🚨 **Moderation** - Classic commands like kick, ban, warn, role and many more. <br>
|
||||||
✨ **Fun Commands** - A massive collection of fun commands `(35+ commands)` <br>
|
📈 **Economy** - A Robust economy system, inspired by **pepe bot** <br>
|
||||||
🎵 **Music** - Classic Music Commands that can play from various sources. <br>
|
✨ **Fun Commands** - A massive collection of fun commands `(35+ commands)` <br>
|
||||||
🛠 **Utility** - A wide range of useful commands `(Around 20)` <br>
|
🎵 **Music** - Classic Music Commands that can play from various sources. <br>
|
||||||
🕹 **Games** - Many fun games to spend your time <br>
|
🛠 **Utility** - A wide range of useful commands `(Around 20)` <br>
|
||||||
🎮 **Call of Duty** - Check the list of Call of Duty Mobile Commands
|
🕹 **Games** - Many fun games to spend your time <br>
|
||||||
|
🎮 **Call of Duty** - Check the list of Call of Duty Mobile Commands
|
||||||
## <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**
|
|
||||||
- **Currated Gunsmith Builds** by various content creators like Jokesta, dHitman, Path.exe, Stats On Duty and more comming soon.
|
- **Weapon Statistics** courtesy of **Lighthouse v2.1**
|
||||||
- **Perks** detailed info about the perks.
|
> Will soon be using stats provided by **Stats On Duty**.
|
||||||
- **Scorestreak** detailed info about scorestreak with preview videos.
|
- **Currated Gunsmith Builds** by various content creators like Jokesta, dHitman, Path.exe and more comming soon.
|
||||||
- **Randomly Generated Class** Wanna try something challenging? try our Randomly Generated Gunsmith builds.
|
- **Perks** detailed info about the perks.
|
||||||
|
- **Scorestreak** detailed info about scorestreak with preview videos.
|
||||||
> 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.
|
- **Randomly Generated Class** Wanna try something challenging? try our Randomly Generated Gunsmith builds.
|
||||||
|
|
||||||
## <img height="16px" src="../util/assets/images/apex/apex-legends-logo-white.svg"> **Apex Legends Mobile**
|
> 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.
|
||||||
|
|
||||||
> ⚠ _Coming Soon™_
|
## More Info
|
||||||
|
|
||||||
- **Player Stats** view your in-game stats. <!-- if they support mobile for the stats api -->
|
[![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)
|
||||||
- **Legends** detailed info about legends & their abilities.
|
[![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)
|
||||||
- **Guns** detailed info about guns.
|
<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>
|
||||||
- **Random Combos** Wanna try something challenging? try to win a game with a random selected legend & Gun combination
|
|
||||||
- _& many more, coming soon!_
|
A detailed Deployment guide can be found [here](https://thunder75.gitbook.io/cath-bot/deployment).
|
||||||
|
|
||||||
## More Info
|
<!-- <details>
|
||||||
|
<summary>Made With</summary>
|
||||||
[![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)
|
[![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)
|
||||||
[YouTube Deployment video](https://www.youtube.com/watch?v=9Dmtuv6tlTE)
|
[![node](https://img.shields.io/badge/Node.js-43853D?style=for-the-badge&logo=node.js&logoColor=white)](https://nodejs.org/en/)
|
||||||
|
[![npm](https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/)
|
||||||
<details>
|
[![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white)](https://mongodb.com/)
|
||||||
<summary>Made With</summary>
|
<img src ="https://forthebadge.com/images/badges/built-with-love.svg" width = "122"><br>
|
||||||
|
</details>
|
||||||
[![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
|
|
||||||
[![node](https://img.shields.io/badge/Node.js-43853D?style=for-the-badge&logo=node.js&logoColor=white)](https://nodejs.org/en/)
|
<details>
|
||||||
[![npm](https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/)
|
<summary>Github Stats</summary>
|
||||||
[![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white)](https://mongodb.com/)
|
|
||||||
<img src ="https://forthebadge.com/images/badges/built-with-love.svg" width = "122"><br>
|
![Lines of code](https://img.shields.io/tokei/lines/github/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge)
|
||||||
</details>
|
![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)
|
||||||
<details>
|
[![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)
|
||||||
<summary>Github Stats</summary>
|
<!-- [![Files](https://tokei.rs/b1/github/night0721/cath.exe?category=files&style=for-the-badge)](https://github.com/night0721/cath.exe)
|
||||||
|
|
||||||
![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)
|
</details> -->
|
||||||
[![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)
|
|
||||||
|
<h1 align = "center"> Support, Feature Request & Bug Reports </h1>
|
||||||
</details>
|
|
||||||
|
## <img src = "https://cdn.discordapp.com/emojis/867093614403256350.png?v=1" width = 18> Support & Feature Request
|
||||||
<h1 align = "center"> Support, Feature Request & Bug Reports </h1>
|
|
||||||
|
Join the official [Support Server](https://rebrand.ly/cathSupport) on Discord & we will be happy to assist you. <br>
|
||||||
## <img src = "https://cdn.discordapp.com/emojis/867093614403256350.png?v=1" width = 18> Support & Feature Request
|
To Request new features contact us on Discord using the support server.
|
||||||
|
|
||||||
Join the official [Support Server](https://rebrand.ly/cathSupport) on Discord & we will be happy to assist you. <br>
|
## <img src = "https://cdn.discordapp.com/emojis/867093601962950666.png?v=1" width = "18"> Report Bugs
|
||||||
To Request new features contact us on Discord using the support server.
|
|
||||||
|
You can report bugs or issues by opening a issue in this repository. Alternatevely you can also contact us on Discord using the support server.
|
||||||
## <img src = "https://cdn.discordapp.com/emojis/867093601962950666.png?v=1" width = "18"> Report Bugs
|
|
||||||
|
<p align = "center">
|
||||||
You can report bugs or issues by opening a issue in this repository. Alternatevely you can also contact us on Discord using the support server.
|
<a href="https://rebrand.ly/cathSupport" target="_blank"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner1"></a>
|
||||||
|
</p>
|
||||||
<p align = "center">
|
|
||||||
<a href="https://rebrand.ly/cathSupport" target="_blank"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner1"></a>
|
<h1 align="center"> Contributors </h1>
|
||||||
</p>
|
|
||||||
|
Contributions are always welcomed, but make sure to read [Contributing.md](/CONTRIBUTING.md) first.
|
||||||
<h1 align="center"> Contributors </h1>
|
|
||||||
|
![Contributors](https://badges.pufler.dev/contributors/night0721/cath.exe?bots=false)
|
||||||
Contributions are always welcomed, but make sure to read [Contributing.md](/CONTRIBUTING.md) first.
|
|
||||||
|
<!-- ## Special Thanks to The Roound Table from Cygnoux Familia.
|
||||||
![Contributors](https://badges.pufler.dev/contributors/night0721/cath.exe?bots=false)
|
|
||||||
|
<p align = "center">
|
||||||
|
<a href="https://discord.gg/mjVwkCsWY7" target="_blank"><img src="https://discordapp.com/api/guilds/756525751594909797/widget.png?style=banner1"></a>
|
||||||
<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> -->
|
||||||
|
|
||||||
|
⠀
|
||||||
|
|
||||||
|
<!-- <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
5
.github/TOS.md
vendored
|
@ -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.
|
|
0
.github/CHANGELOG.md → .github/changelog.md
vendored
0
.github/CHANGELOG.md → .github/changelog.md
vendored
2
.replit
Normal file
2
.replit
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
"language"="nodejs"
|
||||||
|
"run"="node_modules/.bin/node index.js"
|
|
@ -1,78 +1,78 @@
|
||||||
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",
|
||||||
description: "Generate A Random Loadout",
|
description: "Generate A Random Loadout",
|
||||||
category: "CODM",
|
category: "CODM",
|
||||||
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 types = d.Categories;
|
// const types = d.Categories;
|
||||||
// const names = d.Primary;
|
// const names = d.Primary;
|
||||||
// const category = types[Math.floor(Math.random() * types.length)];
|
// const category = types[Math.floor(Math.random() * types.length)];
|
||||||
// const weapons = names[0][category];
|
// const weapons = names[0][category];
|
||||||
// return `${weapons[Math.floor(Math.random() * weapons.length)]}`;
|
// 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, "");
|
||||||
// const slots = shuffle(Object.keys(Attachments[primary][0]));
|
// const slots = shuffle(Object.keys(Attachments[primary][0]));
|
||||||
// const slot_1 = slots.next().value,
|
// const slot_1 = slots.next().value,
|
||||||
// slot_2 = slots.next().value,
|
// slot_2 = slots.next().value,
|
||||||
// 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(
|
||||||
{
|
{
|
||||||
name: `Secondary Weapon`,
|
name: `Secondary Weapon`,
|
||||||
value: ``,
|
value: ``,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: `Operator Skill`,
|
name: `Operator Skill`,
|
||||||
value: ``,
|
value: ``,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: `Scorestreak`, // 3 perks
|
name: `Scorestreak`, // 3 perks
|
||||||
value: ``,
|
value: ``,
|
||||||
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,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
interaction.followUp({ embeds: [result] });
|
interaction.followUp({ embeds: [result] });
|
||||||
|
|
||||||
// function* shuffle(array) {
|
// function* shuffle(array) {
|
||||||
// let i = array.length;
|
// let i = array.length;
|
||||||
// while (i--) {
|
// while (i--) {
|
||||||
// yield array.splice(Math.floor(Math.random() * (i + 1)), 1)[0];
|
// yield array.splice(Math.floor(Math.random() * (i + 1)), 1)[0];
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// function getAttachment(gun, slot) {
|
// function getAttachment(gun, slot) {
|
||||||
// const ca = Attachments[gun][0][slot];
|
// const ca = Attachments[gun][0][slot];
|
||||||
// return ca[Math.floor(Math.random() * ca.length)];
|
// return ca[Math.floor(Math.random() * ca.length)];
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
};
|
};
|
File diff suppressed because it is too large
Load diff
|
@ -1,297 +1,270 @@
|
||||||
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,
|
||||||
currAttachments,
|
currAttachments,
|
||||||
currRecoilArr,
|
currRecoilArr,
|
||||||
currDRM,
|
currDRM,
|
||||||
interpretion,
|
interpretion,
|
||||||
recoilAvailable,
|
recoilAvailable,
|
||||||
chart,
|
chart,
|
||||||
hasError;
|
hasError;
|
||||||
module.exports = {
|
const errMsg = "*Generic placeholder error message*";
|
||||||
name: "stats",
|
module.exports = {
|
||||||
description: "Check gun statistics",
|
name: "stats",
|
||||||
usage: "(Gun)",
|
description: "Check gun stats",
|
||||||
category: "CODM",
|
usage: "(Gun)",
|
||||||
options: [
|
category: "CODM",
|
||||||
{
|
/**
|
||||||
type: 3,
|
* @param {Client} client
|
||||||
name: "gun_name",
|
* @param {Message} message
|
||||||
description: "Name of the gun",
|
* @param {String[]} args
|
||||||
required: true,
|
*/
|
||||||
choices: [],
|
run: async (client, message, args) => {
|
||||||
},
|
recoilAvailable = false;
|
||||||
{
|
hasError = false;
|
||||||
type: 3,
|
const repEmb = statsHandler(args.join(" ").replace("\n", " "));
|
||||||
name: "1st_attchment",
|
|
||||||
description: "First attachment",
|
if (hasError) {
|
||||||
},
|
message.reply({ embeds: [repEmb] });
|
||||||
{
|
}
|
||||||
type: 3,
|
if (recoilAvailable) {
|
||||||
name: "2nd_attchment",
|
repEmb.fields.push({
|
||||||
description: "Second attachment",
|
name: "**Recoil Graph**",
|
||||||
},
|
value:
|
||||||
{
|
"```\nThe Recoil graph below is dynamic (change based on attachment equipped)```",
|
||||||
type: 3,
|
});
|
||||||
name: "3rd_attchment",
|
const recoilImageLink = await chart.getShortUrl();
|
||||||
description: "Third attachment",
|
repEmb.image = { url: recoilImageLink };
|
||||||
},
|
}
|
||||||
{
|
message.reply({ embeds: [repEmb] });
|
||||||
type: 3,
|
},
|
||||||
name: "4th_attchment",
|
};
|
||||||
description: "Forth attachment",
|
|
||||||
},
|
function inpHandler(inpmsg) {
|
||||||
{
|
statsHandler(inpmsg.split("+")[0]);
|
||||||
type: 3,
|
}
|
||||||
name: "5th_attchment",
|
|
||||||
description: "Fifth attachment",
|
function statsHandler(inpmsg) {
|
||||||
},
|
let statsNames = [
|
||||||
],
|
"Pellets",
|
||||||
run: async (client, interaction, args) => {
|
"Detonation Range",
|
||||||
repEmb = null;
|
"Explosion Radius",
|
||||||
recoilAvailable = false;
|
"Explosion Damage",
|
||||||
hasError = false;
|
"Firing Mode",
|
||||||
if (args.length == 1)
|
"Rate of Fire",
|
||||||
repEmb = statsHandler(args.join(" ").replace("\n", " "));
|
"Bullet in Burst",
|
||||||
else repEmb = statsHandler(args.join(" + ").replace("\n", " "));
|
"Time Between Burst",
|
||||||
if (hasError) {
|
"Bullet Speed",
|
||||||
interaction.followUp({
|
"Penetration Level",
|
||||||
content: `**${repEmb || "An error has occured"}**`,
|
"Bullet Spread",
|
||||||
});
|
"Idle Sway",
|
||||||
} else {
|
"Hipfire Pellet Spread",
|
||||||
if (recoilAvailable) {
|
"ADS Pellet Spread",
|
||||||
repEmb.fields.push({
|
"ADS Time",
|
||||||
name: "**Recoil Graph**",
|
"Sprint-to-Fire Time",
|
||||||
value:
|
"ADS Zoom",
|
||||||
"```\nThe Recoil graph below is dynamic (change based on attachment equipped)```",
|
"Magazine",
|
||||||
});
|
"Reserve",
|
||||||
const recoilImageLink = await chart.getShortUrl();
|
"Reload Type",
|
||||||
repEmb.image = { url: recoilImageLink };
|
"Cancel Reload Time",
|
||||||
}
|
"Reload Time",
|
||||||
interaction.followUp({ embeds: [new EmbedBuilder(repEmb)] });
|
"Full Reload Time",
|
||||||
}
|
"Drop Time",
|
||||||
},
|
"Raise Time",
|
||||||
};
|
"Sprinting Speed",
|
||||||
|
"Walking Speed",
|
||||||
function inpHandler(inpmsg) {
|
"Straifing Speed",
|
||||||
statsHandler(inpmsg.split("+")[0]);
|
"Damage per Tick",
|
||||||
}
|
"Number of Ticks",
|
||||||
|
"Time Between Ticks",
|
||||||
function statsHandler(inpmsg) {
|
"Breath Hold Time",
|
||||||
let statsNames = [
|
"shouldNeverHappen0",
|
||||||
"Pellets", //0
|
"shouldNeverHappen1",
|
||||||
"Detonation Range", //1
|
"shouldNeverHappen2",
|
||||||
"Explosion Radius", //2
|
"shouldNeverHappen3",
|
||||||
"Explosion Damage", //3
|
"shouldNeverHappen4",
|
||||||
"Firing Mode", //4
|
],
|
||||||
"Rate of Fire", //5
|
out = [];
|
||||||
"Bullet in Burst", //6
|
|
||||||
"Time Between Burst", //7
|
currGun = common.weaponIdentifier(inpmsg);
|
||||||
"Bullet Speed", //8
|
if (typeof currGun == "string") {
|
||||||
"Penetration Level", //9
|
hasError = true;
|
||||||
"Bullet Spread", //10
|
return currGun;
|
||||||
"Idle Sway", //11
|
}
|
||||||
"Hipfire Pellet Spread", //12
|
currStats = currGun.stats;
|
||||||
"ADS Pellet Spread", //13
|
currDRM = currGun.drm[0];
|
||||||
"ADS Time", //14
|
currAttachments = [];
|
||||||
"Sprint-to-Fire Time", //15
|
currAttachments = common.attachmentsIdentifier(inpmsg, currGun);
|
||||||
"ADS Zoom", //16
|
if (typeof currAttachments == "string") {
|
||||||
"Magazine", //17
|
hasError = true;
|
||||||
"Reserve", //18
|
return currAttachments;
|
||||||
"Reload Type", //19
|
}
|
||||||
"Cancel Reload Time", //20
|
currRecoilArr = [1, 1, currGun.stats[17]];
|
||||||
"Reload Time", //21
|
if (currAttachments.length != 0) {
|
||||||
"Full Reload Time", //22
|
const totalEffects = common.totaler(currAttachments);
|
||||||
"Drop Time", //23
|
|
||||||
"Raise Time", //24
|
currStats = common.updateStatswithEffects(totalEffects, currStats);
|
||||||
"Sprinting Speed", //25
|
currRecoilArr = [totalEffects[2], totalEffects[3], currGun.stats[17]]; // must happen after currStats update
|
||||||
"Walking Speed", //26
|
currDRM = currGun.drm[totalEffects[37]];
|
||||||
"Straifing Speed", //27
|
currDRM.range = currDRM.range.map(x =>
|
||||||
"Damage per Tick", //28
|
Math.round(x * (1 + totalEffects[13] / 100))
|
||||||
"Number of Ticks", //29
|
);
|
||||||
"Time Between Ticks", //30
|
out = common.attachmentHandler(totalEffects, currStats);
|
||||||
"Breath Hold Time", //31
|
}
|
||||||
"shouldNeverHappen0",
|
function statsWorker() {
|
||||||
"shouldNeverHappen1",
|
if (currStats[19] === 2) {
|
||||||
"shouldNeverHappen2",
|
currStats[21] =
|
||||||
"shouldNeverHappen3",
|
currStats[20] + currStats[21] * currStats[17] + currStats[22];
|
||||||
"shouldNeverHappen4",
|
currStats[20] = 0;
|
||||||
],
|
currStats[22] = 0;
|
||||||
out = [];
|
}
|
||||||
|
currStats[25] = (currStats[25] * currStats[26]) / 100;
|
||||||
currGun = common.weaponIdentifier(inpmsg);
|
|
||||||
if (typeof currGun == "string") {
|
const outReady = currStats.map((x, i) =>
|
||||||
hasError = true;
|
x ? statsNames[i].padEnd(24) + ":".padEnd(3) + beautifier(i) : ""
|
||||||
return currGun;
|
);
|
||||||
}
|
out = [
|
||||||
currStats = currGun.stats;
|
...[
|
||||||
currDRM = currGun.drm[0]; // base mag. currGun.drm[1] for more vairents
|
"Basic Stats",
|
||||||
currAttachments = [];
|
"ADS Stats",
|
||||||
currAttachments = common.attachmentsIdentifier(inpmsg, currGun);
|
"Bullet Stats",
|
||||||
if (typeof currAttachments == "string") {
|
"Magazine",
|
||||||
hasError = true;
|
"Handling Stats",
|
||||||
return currAttachments;
|
"Mobility Stats",
|
||||||
}
|
"Miscellaneous Stats",
|
||||||
currRecoilArr = [1, 1, currGun.stats[17]];
|
].map((x, i) =>
|
||||||
if (currAttachments.length != 0) {
|
fieldMaker(
|
||||||
const totalEffects = common.totaler(currAttachments);
|
x,
|
||||||
|
[
|
||||||
currStats = common.updateStatswithEffects(totalEffects, currStats);
|
[04, 05, 09],
|
||||||
currRecoilArr = [totalEffects[2], totalEffects[3], currGun.stats[17]]; // must happen after currStats update
|
[14, 16, 11, 31],
|
||||||
currDRM = currGun.drm[totalEffects[37]];
|
[00, 06, 07, 08, 10, 12, 13],
|
||||||
currDRM.range = currDRM.range.map(x =>
|
[17, 18, 19, 20, 21, 22],
|
||||||
Math.round(x * (1 + totalEffects[13] / 100))
|
[23, 24],
|
||||||
);
|
[25, 26, 27, 15],
|
||||||
out = common.attachmentHandler(totalEffects, currStats);
|
[28, 29, 30, 01, 02, 03],
|
||||||
}
|
][i]
|
||||||
function statsWorker() {
|
)
|
||||||
if (currStats[19] === 2) {
|
),
|
||||||
currStats[21] =
|
...out,
|
||||||
currStats[20] + currStats[21] * currStats[17] + currStats[22];
|
];
|
||||||
currStats[20] = 0;
|
function fieldMaker(inpName, inpIndx) {
|
||||||
currStats[22] = 0;
|
inpIndx = inpIndx.filter(x => outReady[x]);
|
||||||
}
|
return inpIndx.length
|
||||||
currStats[25] = (currStats[25] * currStats[26]) / 100;
|
? {
|
||||||
|
name: "**" + inpName + "**",
|
||||||
const outReady = currStats.map((x, i) =>
|
value: "```\n" + inpIndx.map(x => outReady[x]).join("\n") + "```",
|
||||||
x ? statsNames[i].padEnd(24) + ":".padEnd(3) + beautifier(i) : ""
|
}
|
||||||
);
|
: "";
|
||||||
out = [
|
}
|
||||||
...[
|
}
|
||||||
"Basic Stats",
|
statsWorker();
|
||||||
"ADS Stats",
|
|
||||||
"Bullet Stats",
|
function beautifier(j) {
|
||||||
"Magazine",
|
switch (j) {
|
||||||
"Handling Stats",
|
case 04:
|
||||||
"Mobility Stats",
|
return data.firingModes[currStats[j] - 1];
|
||||||
"Miscellaneous Stats",
|
case 09:
|
||||||
].map((x, i) =>
|
return data.penetrationLevels[currStats[j] - 1];
|
||||||
fieldMaker(
|
case 19:
|
||||||
x,
|
return data.reloadTypes[currStats[j] - 1];
|
||||||
[
|
case 08:
|
||||||
[04, 05, 09],
|
if (currStats[j] == -1) {
|
||||||
[14, 16, 11, 31],
|
return "Infinity";
|
||||||
[00, 06, 07, 08, 10, 12, 13],
|
} else {
|
||||||
[17, 18, 19, 20, 21, 22],
|
return parseFloat(currStats[j].toFixed(2)).toString() + " m/s";
|
||||||
[23, 24],
|
}
|
||||||
[25, 26, 27, 15],
|
case 03:
|
||||||
[28, 29, 30, 01, 02, 03],
|
return parseFloat(currStats[j].toFixed(2))
|
||||||
][i]
|
.toString()
|
||||||
)
|
.replace(".", " ~ ");
|
||||||
),
|
default:
|
||||||
...out,
|
return parseFloat(currStats[j].toFixed(2)).toString() + addUnit(j);
|
||||||
];
|
}
|
||||||
function fieldMaker(inpName, inpIndx) {
|
|
||||||
inpIndx = inpIndx.filter(x => outReady[x]);
|
function addUnit(j) {
|
||||||
return inpIndx.length
|
switch (j) {
|
||||||
? {
|
case 07:
|
||||||
name: `**${inpName}**`,
|
case 14:
|
||||||
value: `\`\`\`\n${inpIndx.map(x => outReady[x]).join("\n")}\`\`\``,
|
case 15:
|
||||||
}
|
case 23:
|
||||||
: "";
|
case 24:
|
||||||
}
|
case 31:
|
||||||
}
|
return " ms";
|
||||||
statsWorker();
|
case 27:
|
||||||
|
case 28:
|
||||||
function beautifier(j) {
|
case 25:
|
||||||
switch (j) {
|
case 26:
|
||||||
case 04:
|
return " m/s";
|
||||||
return data.firingModes[currStats[j] - 1];
|
case 20:
|
||||||
case 09:
|
case 21:
|
||||||
return data.penetrationLevels[currStats[j] - 1];
|
case 22:
|
||||||
case 19:
|
return " s";
|
||||||
return data.reloadTypes[currStats[j] - 1];
|
case 16:
|
||||||
case 08:
|
return "%";
|
||||||
if (currStats[j] == -1) {
|
case 06:
|
||||||
return "Infinity";
|
return " Rounds";
|
||||||
} else {
|
case 05:
|
||||||
return parseFloat(currStats[j].toFixed(2)).toString() + " m/s";
|
return " RPM";
|
||||||
}
|
default:
|
||||||
case 03:
|
return "";
|
||||||
return parseFloat(currStats[j].toFixed(2))
|
}
|
||||||
.toString()
|
}
|
||||||
.replace(".", " ~ ");
|
}
|
||||||
default:
|
interpretion = currGun.gunname + common.interpretioner(currAttachments);
|
||||||
return parseFloat(currStats[j].toFixed(2)).toString() + addUnit(j);
|
if (currGun.recoil.hr.length > 2) {
|
||||||
}
|
chart = common.recoilHandler(
|
||||||
|
currGun.recoil.hr,
|
||||||
function addUnit(j) {
|
currGun.recoil.vr,
|
||||||
switch (j) {
|
currRecoilArr[0],
|
||||||
case 7:
|
currRecoilArr[1],
|
||||||
case 14:
|
currRecoilArr[2]
|
||||||
case 15:
|
);
|
||||||
case 23:
|
recoilAvailable = true;
|
||||||
case 24:
|
} else {
|
||||||
case 31:
|
recoilAvailable = false;
|
||||||
return " ms";
|
}
|
||||||
case 25:
|
if (chart == "none") {
|
||||||
case 26:
|
recoilAvailable = false;
|
||||||
case 27:
|
}
|
||||||
case 28:
|
if (chart == "err" || currAttachments == "err") {
|
||||||
return " m/s";
|
hasError = true;
|
||||||
case 20:
|
return "Cocaineeee";
|
||||||
case 21:
|
}
|
||||||
case 22:
|
const dmg =
|
||||||
return " s";
|
common.damageHandler(
|
||||||
case 16:
|
currDRM.damage,
|
||||||
return "%";
|
currDRM.range,
|
||||||
case 6:
|
1,
|
||||||
return " Rounds";
|
100,
|
||||||
case 5:
|
60000 / currStats[5],
|
||||||
return " RPM";
|
currStats[7],
|
||||||
default:
|
currStats[6],
|
||||||
return "";
|
currStats[0]
|
||||||
}
|
) || "```This should never happen```";
|
||||||
}
|
out = [
|
||||||
}
|
currGun.description
|
||||||
interpretion = currGun.gunname + common.interpretioner(currAttachments);
|
? {
|
||||||
if (currGun.recoil.hr.length > 2) {
|
name: "**Description:**",
|
||||||
chart = common.recoilHandler(
|
value: "```\n" + currGun.description + "```",
|
||||||
currGun.recoil.hr,
|
}
|
||||||
currGun.recoil.vr,
|
: {},
|
||||||
currRecoilArr[0],
|
{ name: "**Damage Profile:**", value: dmg },
|
||||||
currRecoilArr[1],
|
...out,
|
||||||
currRecoilArr[2]
|
];
|
||||||
);
|
out = out.filter(x => x.value);
|
||||||
recoilAvailable = true;
|
return {
|
||||||
} else recoilAvailable = false;
|
title: interpretion,
|
||||||
|
color: 5814783,
|
||||||
if (chart == "none") recoilAvailable = false;
|
fields: out,
|
||||||
if (chart == "err") hasError = true;
|
footer: {
|
||||||
|
text: "All data courtesy of Project Lighthouse and CoDM Research Crew",
|
||||||
const dmg =
|
icon_url:
|
||||||
common.damageHandler(
|
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
|
||||||
currDRM.damage,
|
},
|
||||||
currDRM.range,
|
};
|
||||||
1,
|
}
|
||||||
100,
|
// console.log(statsHandler("Holger").fields);
|
||||||
60000 / currStats[5],
|
|
||||||
currStats[7],
|
|
||||||
currStats[6],
|
|
||||||
currStats[0]
|
|
||||||
) || "```This should never happen```";
|
|
||||||
out = [
|
|
||||||
currGun.description
|
|
||||||
? {
|
|
||||||
name: "**Description:**",
|
|
||||||
value: `\`\`\`\n${currGun.description}\`\`\``,
|
|
||||||
}
|
|
||||||
: {},
|
|
||||||
{ name: "**Damage Profile:**", value: dmg },
|
|
||||||
...out,
|
|
||||||
];
|
|
||||||
out = out.filter(x => x.value);
|
|
||||||
return {
|
|
||||||
title: interpretion,
|
|
||||||
color: 5814783,
|
|
||||||
fields: out,
|
|
||||||
footer: {
|
|
||||||
text: "[OUTDATED] All data courtesy of Project Lighthouse 2.0 and CoDM Research Crew",
|
|
||||||
icon_url:
|
|
||||||
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
44
Dockerfile
44
Dockerfile
|
@ -1,23 +1,23 @@
|
||||||
FROM node:alpine
|
FROM node:alpine
|
||||||
|
|
||||||
# Create app directory
|
# Create app directory
|
||||||
WORKDIR /usr/bot/nyx
|
WORKDIR /usr/bot/nyx
|
||||||
|
|
||||||
# Copy package.json and package-lock.json
|
# Copy package.json and package-lock.json
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
# Install packages
|
# Install packages
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# Copy the app code
|
# Copy the app code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the project
|
# Build the project
|
||||||
RUN npm run all
|
RUN npm run all
|
||||||
|
|
||||||
# Expose ports
|
# Expose ports
|
||||||
# EXPOSE 8080
|
# EXPOSE 8080
|
||||||
|
|
||||||
# Run the application
|
# Run the application
|
||||||
CMD [ "node", "index.js" ]
|
CMD [ "node", "index.js" ]
|
||||||
# not sure what to run index.js or bot.js
|
# not sure what to run index.js or bot.js
|
1
Procfile
Normal file
1
Procfile
Normal file
|
@ -0,0 +1 @@
|
||||||
|
worker: node index.js
|
21
app.json
Normal file
21
app.json
Normal 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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -1,2 +1,2 @@
|
||||||
const { CODMClient } = require("cath");
|
const { CODMClient } = require("cath");
|
||||||
module.exports = new CODMClient(process.env.CODM_API_KEY);
|
module.exports = new CODMClient(process.env.CODM_API_KEY);
|
||||||
|
|
2
client/CodeClient.js
Normal file
2
client/CodeClient.js
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
const { CodeClient } = require("cath");
|
||||||
|
module.exports = new CodeClient();
|
38
client/GiveawaysClient.js
Normal file
38
client/GiveawaysClient.js
Normal 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,
|
||||||
|
},
|
||||||
|
});
|
251
client/NYX.js
251
client/NYX.js
|
@ -1,102 +1,149 @@
|
||||||
const {
|
const { Client, Collection, MessageEmbed } = require("discord.js");
|
||||||
Client,
|
const { Manager } = require("erela.js");
|
||||||
Collection,
|
const config = require("../config");
|
||||||
EmbedBuilder,
|
const Spotify = require("erela.js-spotify");
|
||||||
GatewayIntentBits,
|
const utils = require("../util/functions/function");
|
||||||
Partials,
|
require("dotenv").config();
|
||||||
} = require("discord.js");
|
|
||||||
const config = require("../config");
|
class NYX extends Client {
|
||||||
require("dotenv").config();
|
/**
|
||||||
|
* @param {Client.options} options
|
||||||
class NYX extends Client {
|
*/
|
||||||
/**
|
constructor(
|
||||||
* @param {Client.options} options
|
options = {
|
||||||
*/
|
presence: {
|
||||||
constructor(
|
activities: [
|
||||||
options = {
|
{
|
||||||
presence: {
|
name: `/help`,
|
||||||
activities: [
|
type: "STREAMING",
|
||||||
{
|
url: "https://www.youtube.com/watch?v=YSKDu1gKntY",
|
||||||
name: `/help`,
|
},
|
||||||
type: 1,
|
],
|
||||||
url: "https://www.youtube.com/watch?v=YSKDu1gKntY",
|
},
|
||||||
},
|
shard: "auto",
|
||||||
],
|
restTimeOffset: 0,
|
||||||
},
|
restRequestTimeout: 99999,
|
||||||
shards: "auto",
|
partials: ["MESSAGE", "CHANNEL", "REACTION", "GUILD_MEMBER"],
|
||||||
partials: [
|
intents: 24207,
|
||||||
Partials.Message,
|
}
|
||||||
Partials.Channel,
|
) {
|
||||||
Partials.Reaction,
|
super(options);
|
||||||
Partials.GuildMember,
|
this.slashCommands = new Collection();
|
||||||
],
|
this.hide = new Collection();
|
||||||
intents: [
|
this.esnipes = new Collection();
|
||||||
GatewayIntentBits.Guilds,
|
this.snipes = new Collection();
|
||||||
GatewayIntentBits.GuildMembers,
|
this.config = config;
|
||||||
// GatewayIntentBits.MessageContent,
|
this.data = require("../util/functions/mongoose");
|
||||||
GatewayIntentBits.GuildMessages,
|
this.color = config.color;
|
||||||
GatewayIntentBits.DirectMessageTyping,
|
this.author = "Team NYX";
|
||||||
GatewayIntentBits.DirectMessages,
|
this.invite = "https://discord.gg/SbQHChmGcp";
|
||||||
],
|
this.docs = "https://thunder75.gitbook.io/nyx/";
|
||||||
}
|
this.web = config.URL;
|
||||||
) {
|
this.owners = [
|
||||||
super(options);
|
"452076196419600394", // Night
|
||||||
this.slashCommands = new Collection();
|
"534027706325532694", // Cat drinking a cat
|
||||||
this.hide = new Collection();
|
"381442059111759883", // Thunder
|
||||||
this.config = config;
|
"556808365574193194", // chunchunmaru
|
||||||
this.data = require("../util/functions/mongoose");
|
"746753527338238115", // mightyful
|
||||||
this.color = config.color;
|
];
|
||||||
this.author = "Team NYX";
|
this.currency = "<:nyx_currency:918584872333893703>";
|
||||||
this.invite = "https://discord.gg/SbQHChmGcp";
|
this.xp = "<:nyx_xp:900309007472926720>";
|
||||||
this.docs = "https://thunder75.gitbook.io/nyx/";
|
this.path = [
|
||||||
this.web = config.URL;
|
"614423108388126731", // Camper on Duty
|
||||||
this.owners = [
|
"767173194943168542", // Dark Bonker
|
||||||
"452076196419600394", // Night
|
"718762019586572341", // NYX Nation
|
||||||
"534027706325532694", // Cat drinking a cat
|
"840225563193114624", // Command Test
|
||||||
"381442059111759883", // Thunder
|
];
|
||||||
"556808365574193194", // chunchunmaru
|
const client = this;
|
||||||
"687622268037365774", // Tac Shadow
|
require("../util/functions/economy")(client);
|
||||||
"309681798957498368", // Sideload
|
this.manager = new Manager({
|
||||||
"707177879984668673", // Random rock
|
plugins: [
|
||||||
"757530324686340197", // Madhav
|
new Spotify({
|
||||||
"804712098625486848", // hcs
|
clientID: process.env.SPOTIFY_ID,
|
||||||
"1078015817184182414", // gaba
|
clientSecret: process.env.SPOTIFY_SECRET,
|
||||||
"774390900411465769", // Alphaus
|
}),
|
||||||
];
|
],
|
||||||
this.currency = "<:nyx_currency:918584872333893703>";
|
nodes: [
|
||||||
this.xp = "<:nyx_xp:900309007472926720>";
|
{
|
||||||
this.dev = "<:discord_bot_dev:840231906200387666>";
|
host: config.Lavalink.Host,
|
||||||
this.path = [
|
port: config.Lavalink.Port,
|
||||||
"614423108388126731", // Camper on Duty
|
password: config.Lavalink.Password,
|
||||||
"767173194943168542", // Dark Bonker
|
retryDelay: 5000,
|
||||||
"718762019586572341", // NYX Nation
|
},
|
||||||
"840225563193114624", // Command Test
|
],
|
||||||
];
|
autoPlay: true,
|
||||||
}
|
send: (id, payload) => {
|
||||||
|
const guild = client.guilds.cache.get(id);
|
||||||
start() {
|
if (guild) guild.shard.send(payload);
|
||||||
require("../util/dist/handler")(this);
|
},
|
||||||
this.login(
|
})
|
||||||
process.argv[2] == "--dev" ? process.env.DEV : process.env.TOKEN
|
.on("nodeConnect", node =>
|
||||||
);
|
console.log(`Node "${node.options.identifier}" has connected`)
|
||||||
this.data
|
)
|
||||||
.connect(process.env.MONGO)
|
.on("nodeError", (node, error) =>
|
||||||
.then(() => console.log("Connected to MongoDB ✅"))
|
console.log(
|
||||||
.catch(e => console.log(e));
|
`Node "${node.options.identifier}" encountered an error: ${error.message}`
|
||||||
}
|
)
|
||||||
err(interaction, error) {
|
)
|
||||||
const embed = new EmbedBuilder()
|
.on("trackStart", (player, track) => {
|
||||||
.setTitle("An Error Occured")
|
const channel = client.channels.cache.get(player.textChannel);
|
||||||
.setColor("Red")
|
const embed = new MessageEmbed()
|
||||||
.setDescription(`❌ | ${error}`)
|
.setColor(config.color)
|
||||||
.setTimestamp()
|
.setAuthor(
|
||||||
.setFooter({
|
`Now Playing`,
|
||||||
text: `Made by ${this.author}`,
|
"https://cdn.discordapp.com/emojis/897017864085712936.gif"
|
||||||
iconURL: this.user.displayAvatarURL({ dynamic: true }),
|
)
|
||||||
});
|
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
|
||||||
interaction.channel.send({ embeds: [embed] });
|
.setTimestamp()
|
||||||
this.channels.cache.get(this.config.ErrorLog).send({ embeds: [embed] });
|
.setThumbnail(player.queue.current.displayThumbnail())
|
||||||
}
|
.setDescription(`[${track.title}](${track.uri})`)
|
||||||
}
|
.addField(
|
||||||
|
"Duration",
|
||||||
module.exports = NYX;
|
`\`${utils.prettyMs(track.duration, {
|
||||||
|
colonNotation: true,
|
||||||
|
})}\``,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
channel.send({ embeds: [embed] });
|
||||||
|
})
|
||||||
|
.on("queueEnd", player => {
|
||||||
|
const channel = client.channels.cache.get(player.textChannel);
|
||||||
|
const embed2 = new MessageEmbed()
|
||||||
|
.setColor(config.color)
|
||||||
|
.setAuthor(
|
||||||
|
`Queue has ended`,
|
||||||
|
"https://cdn.discordapp.com/emojis/897017864085712936.gif"
|
||||||
|
)
|
||||||
|
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
|
||||||
|
.setTimestamp();
|
||||||
|
channel.send({ embeds: [embed2] });
|
||||||
|
// player.destroy(); Remove if 24/7
|
||||||
|
});
|
||||||
|
}
|
||||||
|
start() {
|
||||||
|
require("../util/dist/handler")(this);
|
||||||
|
this.data
|
||||||
|
.connect(process.env.MONGO)
|
||||||
|
.then(() => console.log("Connected to MongoDB ✅"))
|
||||||
|
.catch(e => console.log(e));
|
||||||
|
this.login(process.env.TOKEN);
|
||||||
|
}
|
||||||
|
err(c, e) {
|
||||||
|
const embed = new MessageEmbed()
|
||||||
|
.setTitle("An Error Occured")
|
||||||
|
.setColor("RED")
|
||||||
|
.setDescription(`❌ | ${e}`)
|
||||||
|
.setTimestamp()
|
||||||
|
.setFooter(`Made by ${this.author}`, this.user.displayAvatarURL());
|
||||||
|
c.followUp({ embeds: [embed] });
|
||||||
|
}
|
||||||
|
se(c, e) {
|
||||||
|
const embed = new MessageEmbed()
|
||||||
|
.setColor(this.color)
|
||||||
|
.setDescription(e)
|
||||||
|
.setTimestamp();
|
||||||
|
c.followUp({ embeds: [embed] });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = NYX;
|
||||||
|
|
6
client/StarboardClient.js
Normal file
6
client/StarboardClient.js
Normal 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
2
client/URLClient.js
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
const { URLClient } = require("cath");
|
||||||
|
module.exports = new URLClient();
|
File diff suppressed because it is too large
Load diff
|
@ -1,55 +1,55 @@
|
||||||
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 = {
|
||||||
name: "class",
|
name: "class",
|
||||||
description: "Generate random class in CODM",
|
description: "Generate random class in CODM",
|
||||||
category: "CODM",
|
category: "CODM",
|
||||||
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 primary_weapon = await data();
|
const weapons = names[0][category];
|
||||||
const primary = primary_weapon.replace(/[ -]/g, "_").replace(/\./g, "");
|
return `${weapons[Math.floor(Math.random() * weapons.length)]}`;
|
||||||
const slots = shuffle(Object.keys(Attachments[primary][0]));
|
};
|
||||||
const slot_1 = slots.next().value,
|
const primary_weapon = await data();
|
||||||
slot_2 = slots.next().value,
|
const primary = primary_weapon.replace(/[ -]/g, "_").replace(/\./g, "");
|
||||||
slot_3 = slots.next().value,
|
const slots = shuffle(Object.keys(Attachments[primary][0]));
|
||||||
slot_4 = slots.next().value,
|
const slot_1 = slots.next().value,
|
||||||
slot_5 = slots.next().value;
|
slot_2 = slots.next().value,
|
||||||
const result = new EmbedBuilder()
|
slot_3 = slots.next().value,
|
||||||
.setColor(client.color)
|
slot_4 = slots.next().value,
|
||||||
.setTitle(`🎲 A Randomly Generated Class for ${primary_weapon} 🎲`)
|
slot_5 = slots.next().value;
|
||||||
.setDescription(
|
const result = new MessageEmbed()
|
||||||
`**Attachments**\n**${getAttachment(
|
.setColor(client.color)
|
||||||
primary,
|
.setTitle(`🎲 A Randomly Generated Class for ${primary_weapon} 🎲`)
|
||||||
slot_1
|
.setDescription(
|
||||||
)}**\n**${getAttachment(primary, slot_2)}**\n**${getAttachment(
|
`**Attachments**\n**${getAttachment(
|
||||||
primary,
|
primary,
|
||||||
slot_3
|
slot_1
|
||||||
)}**\n**${getAttachment(primary, slot_4)}**\n**${getAttachment(
|
)}**\n**${getAttachment(primary, slot_2)}**\n**${getAttachment(
|
||||||
primary,
|
primary,
|
||||||
slot_5
|
slot_3
|
||||||
)}**`
|
)}**\n**${getAttachment(primary, slot_4)}**\n**${getAttachment(
|
||||||
)
|
primary,
|
||||||
.setURL(client.web)
|
slot_5
|
||||||
.setFooter({
|
)}**`
|
||||||
text: `Made by ${client.author}`,
|
)
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
.setURL(client.web)
|
||||||
})
|
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
interaction.followUp({ embeds: [result] });
|
interaction.followUp({ embeds: [result] });
|
||||||
function* shuffle(array) {
|
function* shuffle(array) {
|
||||||
let i = array.length;
|
let i = array.length;
|
||||||
while (i--) {
|
while (i--) {
|
||||||
yield array.splice(Math.floor(Math.random() * (i + 1)), 1)[0];
|
yield array.splice(Math.floor(Math.random() * (i + 1)), 1)[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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)];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,121 +1,121 @@
|
||||||
const common = require("../../util/functions/common");
|
const common = require("../../util/functions/common");
|
||||||
let currGun = {},
|
let currGun = {},
|
||||||
currStats = [],
|
currStats = [],
|
||||||
currAttachments = {},
|
currAttachments = {},
|
||||||
currDRM = {},
|
currDRM = {},
|
||||||
totalEffects = [],
|
totalEffects = [],
|
||||||
interpretion = "",
|
interpretion = "",
|
||||||
hasError = false;
|
hasError = false;
|
||||||
const errMsg = "*Generic placeholder error message*";
|
const errMsg = "*Generic placeholder error message*";
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "damage",
|
name: "damage",
|
||||||
description: "Check gun damage",
|
description: "Check gun damage",
|
||||||
usage: "(Gun)",
|
usage: "(Gun)",
|
||||||
category: "CODM",
|
category: "CODM",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "gun",
|
name: "gun",
|
||||||
description: "Gun name",
|
description: "Gun name",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction, args) => {
|
run: async (client, interaction, args) => {
|
||||||
const repEmb = dmg(args[0].replace("\n", " "));
|
const repEmb = dmg(args[0].replace("\n", " "));
|
||||||
if (hasError) {
|
if (hasError) {
|
||||||
interaction.followUp({ embeds: [repEmb] });
|
interaction.followUp({ embeds: [repEmb] });
|
||||||
} else {
|
} else {
|
||||||
interaction.followUp({ embeds: [repEmb] });
|
interaction.followUp({ embeds: [repEmb] });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function dmg(inpmsg) {
|
function dmg(inpmsg) {
|
||||||
currGun = common.weaponIdentifier(inpmsg);
|
currGun = common.weaponIdentifier(inpmsg);
|
||||||
if (typeof currGun == "string") {
|
if (typeof currGun == "string") {
|
||||||
hasError = true;
|
hasError = true;
|
||||||
return currGun;
|
return currGun;
|
||||||
}
|
}
|
||||||
currDRM = currGun.drm[0];
|
currDRM = currGun.drm[0];
|
||||||
currStats = currGun.stats;
|
currStats = currGun.stats;
|
||||||
currAttachments = common.attachmentsIdentifier(inpmsg, currGun);
|
currAttachments = common.attachmentsIdentifier(inpmsg, currGun);
|
||||||
if (typeof currAttachments == "string") {
|
if (typeof currAttachments == "string") {
|
||||||
hasError = true;
|
hasError = true;
|
||||||
return currAttachments;
|
return currAttachments;
|
||||||
}
|
}
|
||||||
if (currAttachments.length) {
|
if (currAttachments.length) {
|
||||||
totalEffects = common.totaler(currAttachments);
|
totalEffects = common.totaler(currAttachments);
|
||||||
currDRM = currGun.drm[totalEffects[37]];
|
currDRM = currGun.drm[totalEffects[37]];
|
||||||
currDRM.range = currDRM.range.map(
|
currDRM.range = currDRM.range.map(
|
||||||
x => (x * (totalEffects[13] + 100)) / 100
|
x => (x * (totalEffects[13] + 100)) / 100
|
||||||
);
|
);
|
||||||
currStats = common.updateStatswithEffects(totalEffects, currStats);
|
currStats = common.updateStatswithEffects(totalEffects, currStats);
|
||||||
}
|
}
|
||||||
const mn = [
|
const mn = [
|
||||||
"Head",
|
"Head",
|
||||||
"Neck",
|
"Neck",
|
||||||
"Upper Chest",
|
"Upper Chest",
|
||||||
"Lower Chest",
|
"Lower Chest",
|
||||||
"Shoulders",
|
"Shoulders",
|
||||||
"Upper Arms",
|
"Upper Arms",
|
||||||
"Lower Arms",
|
"Lower Arms",
|
||||||
"Stomach",
|
"Stomach",
|
||||||
"Belly Button",
|
"Belly Button",
|
||||||
"Crotch",
|
"Crotch",
|
||||||
"Thighs",
|
"Thighs",
|
||||||
"Calf Muscles",
|
"Calf Muscles",
|
||||||
"Feet",
|
"Feet",
|
||||||
],
|
],
|
||||||
m1 = currDRM.bodymultiplier,
|
m1 = currDRM.bodymultiplier,
|
||||||
m2 = [...new Set(m1)], // [1.2, 1, 0.9]
|
m2 = [...new Set(m1)], // [1.2, 1, 0.9]
|
||||||
m3 = m1.map(x => m2.indexOf(x)), // [0, 1, 1, 1, 1, 1, 2, 2, 2]
|
m3 = m1.map(x => m2.indexOf(x)), // [0, 1, 1, 1, 1, 1, 2, 2, 2]
|
||||||
m4 = m2
|
m4 = m2
|
||||||
.map(x =>
|
.map(x =>
|
||||||
m3
|
m3
|
||||||
.map((y, i) => {
|
.map((y, i) => {
|
||||||
if (x === m2[y]) {
|
if (x === m2[y]) {
|
||||||
return mn[i];
|
return mn[i];
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.filter(y => y)
|
.filter(y => y)
|
||||||
)
|
)
|
||||||
.map(x =>
|
.map(x =>
|
||||||
x.length === m1.length
|
x.length === m1.length
|
||||||
? ["All"]
|
? ["All"]
|
||||||
: x.length === m1.length - 1
|
: x.length === m1.length - 1
|
||||||
? ["Others"]
|
? ["Others"]
|
||||||
: x
|
: x
|
||||||
);
|
);
|
||||||
interpretion = currGun.gunname + common.interpretioner(currAttachments);
|
interpretion = currGun.gunname + common.interpretioner(currAttachments);
|
||||||
return {
|
return {
|
||||||
title: "**" + interpretion + "**",
|
title: "**" + interpretion + "**",
|
||||||
color: 4849497,
|
color: 4849497,
|
||||||
fields: m4.map((x, i) => {
|
fields: m4.map((x, i) => {
|
||||||
return {
|
return {
|
||||||
name: x.join(", ") + ":",
|
name: x.join(", ") + ":",
|
||||||
value: common.damageHandler(
|
value: common.damageHandler(
|
||||||
currDRM.damage,
|
currDRM.damage,
|
||||||
currDRM.range,
|
currDRM.range,
|
||||||
m2[i],
|
m2[i],
|
||||||
100,
|
100,
|
||||||
60000 / currStats[5],
|
60000 / currStats[5],
|
||||||
currStats[7],
|
currStats[7],
|
||||||
currStats[6],
|
currStats[6],
|
||||||
currStats[0]
|
currStats[0]
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
footer: {
|
footer: {
|
||||||
text: "All the stats courtesy of Project Lighthouse",
|
text: "All the stats courtesy of Project Lighthouse",
|
||||||
icon_url:
|
icon_url:
|
||||||
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
|
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// console.log(dmg("47 + mono"));
|
// console.log(dmg("47 + mono"));
|
||||||
/* console.log(dmg("47"));
|
/* console.log(dmg("47"));
|
||||||
console.log(dmg("striker + choke"));
|
console.log(dmg("striker + choke"));
|
||||||
console.log(dmg("striker + choke"));
|
console.log(dmg("striker + choke"));
|
||||||
console.log(dmg("striker"));
|
console.log(dmg("striker"));
|
||||||
common.makeError();*/
|
common.makeError();*/
|
||||||
|
|
332
command/CODM/effects.js
vendored
332
command/CODM/effects.js
vendored
|
@ -1,166 +1,166 @@
|
||||||
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");
|
||||||
|
|
||||||
let currGun, currAttachments, interpretion, hasError;
|
let currGun, currAttachments, interpretion, hasError;
|
||||||
const errMsg = "*Generic placeholder error message*";
|
const errMsg = "*Generic placeholder error message*";
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "effects",
|
name: "effects",
|
||||||
description: "Check gun effects",
|
description: "Check gun effects",
|
||||||
usage: "(Gun)",
|
usage: "(Gun)",
|
||||||
category: "CODM",
|
category: "CODM",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 7,
|
type: 7,
|
||||||
name: "gun",
|
name: "gun",
|
||||||
description: "Gun name",
|
description: "Gun name",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction, args) => {
|
run: async (client, interaction, args) => {
|
||||||
const repEmb = attachments(args[0].replace("\n", " "));
|
const repEmb = attachments(args[0].replace("\n", " "));
|
||||||
if (hasError) {
|
if (hasError) {
|
||||||
interaction.followUp({ embeds: [repEmb] });
|
interaction.followUp({ embeds: [repEmb] });
|
||||||
} else {
|
} else {
|
||||||
interaction.followUp({ embeds: [repEmb] });
|
interaction.followUp({ embeds: [repEmb] });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function attachments(inpmsg) {
|
function attachments(inpmsg) {
|
||||||
const out = "",
|
const out = "",
|
||||||
at = data.attachmentTypes.map(x => (x.slice(-1) === "s" ? x : x + "s"));
|
at = data.attachmentTypes.map(x => (x.slice(-1) === "s" ? x : x + "s"));
|
||||||
if (inpmsg.includes("+") && inpmsg.includes(":")) {
|
if (inpmsg.includes("+") && inpmsg.includes(":")) {
|
||||||
hasError = true;
|
hasError = true;
|
||||||
return "Bro, can u liek, not do that?";
|
return "Bro, can u liek, not do that?";
|
||||||
}
|
}
|
||||||
if (inpmsg.includes(":")) {
|
if (inpmsg.includes(":")) {
|
||||||
const inpAll = inpmsg
|
const inpAll = inpmsg
|
||||||
.split(":")
|
.split(":")
|
||||||
.map(x => x.trim())
|
.map(x => x.trim())
|
||||||
.filter(x => x),
|
.filter(x => x),
|
||||||
inpType = inpAll.length === 2 ? inpAll[1] : null;
|
inpType = inpAll.length === 2 ? inpAll[1] : null;
|
||||||
if (!inpType) {
|
if (!inpType) {
|
||||||
hasError = true;
|
hasError = true;
|
||||||
return inpAll.length < 2
|
return inpAll.length < 2
|
||||||
? "Empty " + (inpAll[0] ? "" : "weapon name and ") + "attachment type"
|
? "Empty " + (inpAll[0] ? "" : "weapon name and ") + "attachment type"
|
||||||
: "Multiple `:`s detected";
|
: "Multiple `:`s detected";
|
||||||
}
|
}
|
||||||
currGun = common.weaponIdentifier(inpAll[0]);
|
currGun = common.weaponIdentifier(inpAll[0]);
|
||||||
if (typeof currGun == "string") {
|
if (typeof currGun == "string") {
|
||||||
hasError = true;
|
hasError = true;
|
||||||
return currGun;
|
return currGun;
|
||||||
}
|
}
|
||||||
let currAttachmentsType = at.filter(x => simplify(x) == simplify(inpType));
|
let currAttachmentsType = at.filter(x => simplify(x) == simplify(inpType));
|
||||||
currAttachmentsType = currAttachmentsType.length
|
currAttachmentsType = currAttachmentsType.length
|
||||||
? currAttachmentsType
|
? currAttachmentsType
|
||||||
: at.filter(
|
: at.filter(
|
||||||
x => simplify(x.substring(0, x.length - 1)) == simplify(inpType)
|
x => simplify(x.substring(0, x.length - 1)) == simplify(inpType)
|
||||||
);
|
);
|
||||||
currAttachmentsType = currAttachmentsType.length
|
currAttachmentsType = currAttachmentsType.length
|
||||||
? currAttachmentsType
|
? currAttachmentsType
|
||||||
: at.filter(x => simplify(x).includes(simplify(inpType)));
|
: at.filter(x => simplify(x).includes(simplify(inpType)));
|
||||||
if (currAttachmentsType.length === 0) {
|
if (currAttachmentsType.length === 0) {
|
||||||
hasError = true;
|
hasError = true;
|
||||||
return "Couldn't identify `" + inpType + "`";
|
return "Couldn't identify `" + inpType + "`";
|
||||||
} else if (currAttachmentsType.length === 1) {
|
} else if (currAttachmentsType.length === 1) {
|
||||||
currAttachmentsType = at.indexOf(currAttachmentsType[0]);
|
currAttachmentsType = at.indexOf(currAttachmentsType[0]);
|
||||||
} else {
|
} else {
|
||||||
hasError = true;
|
hasError = true;
|
||||||
return (
|
return (
|
||||||
"Did you mean `" +
|
"Did you mean `" +
|
||||||
currAttachmentsType.reduce((out, x, i) =>
|
currAttachmentsType.reduce((out, x, i) =>
|
||||||
[out, x].join(
|
[out, x].join(
|
||||||
i === currAttachmentsType.length - 1 ? "` or `" : "`, `"
|
i === currAttachmentsType.length - 1 ? "` or `" : "`, `"
|
||||||
)
|
)
|
||||||
) +
|
) +
|
||||||
"`"
|
"`"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
title: currGun.gunname,
|
title: currGun.gunname,
|
||||||
color: 11348938,
|
color: 11348938,
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name:
|
name:
|
||||||
"**" +
|
"**" +
|
||||||
currGun.gunname +
|
currGun.gunname +
|
||||||
"** has the following " +
|
"** has the following " +
|
||||||
at[currAttachmentsType],
|
at[currAttachmentsType],
|
||||||
value:
|
value:
|
||||||
"```\n" +
|
"```\n" +
|
||||||
currGun.aments
|
currGun.aments
|
||||||
.filter(x => x.type - 1 === currAttachmentsType)
|
.filter(x => x.type - 1 === currAttachmentsType)
|
||||||
.map(x => x.name)
|
.map(x => x.name)
|
||||||
.join("\n") +
|
.join("\n") +
|
||||||
"```",
|
"```",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
footer: {
|
footer: {
|
||||||
text: "All the stats courtesy of Project Lighthouse",
|
text: "All the stats courtesy of Project Lighthouse",
|
||||||
icon_url:
|
icon_url:
|
||||||
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
|
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
function simplify(v) {
|
function simplify(v) {
|
||||||
return v.toLowerCase().replace(/[^0-9a-z]/g, "");
|
return v.toLowerCase().replace(/[^0-9a-z]/g, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
currGun = common.weaponIdentifier(inpmsg);
|
currGun = common.weaponIdentifier(inpmsg);
|
||||||
if (typeof currGun == "string") {
|
if (typeof currGun == "string") {
|
||||||
hasError = true;
|
hasError = true;
|
||||||
return currGun;
|
return currGun;
|
||||||
}
|
}
|
||||||
hasAttachments = common.hasAttachments(inpmsg);
|
hasAttachments = common.hasAttachments(inpmsg);
|
||||||
currAttachments = [];
|
currAttachments = [];
|
||||||
if (hasAttachments) {
|
if (hasAttachments) {
|
||||||
currAttachments = common.attachmentsIdentifier(inpmsg, currGun);
|
currAttachments = common.attachmentsIdentifier(inpmsg, currGun);
|
||||||
if (typeof currAttachments == "string") {
|
if (typeof currAttachments == "string") {
|
||||||
hasError = true;
|
hasError = true;
|
||||||
return currAttachments;
|
return currAttachments;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
title: currGun.gunname + common.interpretioner(currAttachments),
|
title: currGun.gunname + common.interpretioner(currAttachments),
|
||||||
color: 11348938,
|
color: 11348938,
|
||||||
fields: common.attachmentHandler(
|
fields: common.attachmentHandler(
|
||||||
common.totaler(currAttachments),
|
common.totaler(currAttachments),
|
||||||
currGun.stats
|
currGun.stats
|
||||||
),
|
),
|
||||||
footer: {
|
footer: {
|
||||||
text: "All the stats courtesy of Project Lighthouse",
|
text: "All the stats courtesy of Project Lighthouse",
|
||||||
icon_url:
|
icon_url:
|
||||||
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
|
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
const availableAttachmentTypes = [
|
const availableAttachmentTypes = [
|
||||||
...new Set(currGun.aments.map(x => x.type)),
|
...new Set(currGun.aments.map(x => x.type)),
|
||||||
];
|
];
|
||||||
return {
|
return {
|
||||||
title: currGun.gunname,
|
title: currGun.gunname,
|
||||||
color: 11348938,
|
color: 11348938,
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name:
|
name:
|
||||||
"**" + currGun.gunname + "** has the following attachment types:",
|
"**" + currGun.gunname + "** has the following attachment types:",
|
||||||
value:
|
value:
|
||||||
"```\n" +
|
"```\n" +
|
||||||
availableAttachmentTypes.map(x => at[x - 1]).join(",\n") +
|
availableAttachmentTypes.map(x => at[x - 1]).join(",\n") +
|
||||||
"```",
|
"```",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
footer: {
|
footer: {
|
||||||
text: "All the stats courtesy of Project Lighthouse",
|
text: "All the stats courtesy of Project Lighthouse",
|
||||||
icon_url:
|
icon_url:
|
||||||
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
|
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png?width=638&height=638",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// console.log(attachments("Peacekeeper:muzzle")); //common.makeError();
|
// console.log(attachments("Peacekeeper:muzzle")); //common.makeError();
|
||||||
/* console.log(attachments(":")); //common.makeError();
|
/* console.log(attachments(":")); //common.makeError();
|
||||||
console.log(attachments("47:optics")); //common.makeError();
|
console.log(attachments("47:optics")); //common.makeError();
|
||||||
console.log(attachments("47")); //common.makeError();
|
console.log(attachments("47")); //common.makeError();
|
||||||
console.log(attachments("47 + ")); //common.makeError();
|
console.log(attachments("47 + ")); //common.makeError();
|
||||||
console.log(attachments("47 + :")); //common.makeError();
|
console.log(attachments("47 + :")); //common.makeError();
|
||||||
console.log(attachments("47 + red dot")); common.makeError();*/
|
console.log(attachments("47 + red dot")); common.makeError();*/
|
||||||
|
|
|
@ -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];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
|
@ -1,198 +1,195 @@
|
||||||
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: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "perk",
|
name: "perk",
|
||||||
description: "Perk",
|
description: "Perk",
|
||||||
required: true,
|
required: true,
|
||||||
choices: [
|
choices: [
|
||||||
{
|
{
|
||||||
name: "Fast Recover",
|
name: "Fast Recover",
|
||||||
value: "fastrecover",
|
value: "fastrecover",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Persistence",
|
name: "Persistence",
|
||||||
value: "persistence",
|
value: "persistence",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Flak Jacket",
|
name: "Flak Jacket",
|
||||||
value: "flakjacket",
|
value: "flakjacket",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Skulker",
|
name: "Skulker",
|
||||||
value: "skulker",
|
value: "skulker",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Agile",
|
name: "Agile",
|
||||||
value: "agile",
|
value: "agile",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Lightweight",
|
name: "Lightweight",
|
||||||
value: "lightweight",
|
value: "lightweight",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Restock",
|
name: "Restock",
|
||||||
value: "restock",
|
value: "restock",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Tactician",
|
name: "Tactician",
|
||||||
value: "tactician",
|
value: "tactician",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Overclock",
|
name: "Overclock",
|
||||||
value: "overclock",
|
value: "overclock",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Martydom",
|
name: "Martydom",
|
||||||
value: "martydom",
|
value: "martydom",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Iron Lungs",
|
name: "Iron Lungs",
|
||||||
value: "ironlungs",
|
value: "ironlungs",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 1,
|
type: "SUB_COMMAND",
|
||||||
name: "green",
|
name: "green",
|
||||||
description: "Green Perk",
|
description: "Green Perk",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "perk",
|
name: "perk",
|
||||||
description: "Perk",
|
description: "Perk",
|
||||||
required: true,
|
required: true,
|
||||||
choices: [
|
choices: [
|
||||||
{
|
{
|
||||||
name: "Vulture",
|
name: "Vulture",
|
||||||
value: "vulture",
|
value: "vulture",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Toughness",
|
name: "Toughness",
|
||||||
value: "toughness",
|
value: "toughness",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Tracker",
|
name: "Tracker",
|
||||||
value: "tracker",
|
value: "tracker",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Ghost",
|
name: "Ghost",
|
||||||
value: "ghost",
|
value: "ghost",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Cold Blooded",
|
name: "Cold Blooded",
|
||||||
value: "coldblooded",
|
value: "coldblooded",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Hardwired",
|
name: "Hardwired",
|
||||||
value: "hardwired",
|
value: "hardwired",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Quick Fix",
|
name: "Quick Fix",
|
||||||
value: "quickfix",
|
value: "quickfix",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Amped",
|
name: "Amped",
|
||||||
value: "amped",
|
value: "amped",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Recon",
|
name: "Recon",
|
||||||
value: "recon",
|
value: "recon",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Gung Ho",
|
name: "Gung Ho",
|
||||||
value: "gungho",
|
value: "gungho",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 1,
|
type: "SUB_COMMAND",
|
||||||
name: "blue",
|
name: "blue",
|
||||||
description: "Blue Perk",
|
description: "Blue Perk",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "perk",
|
name: "perk",
|
||||||
description: "Perk",
|
description: "Perk",
|
||||||
required: true,
|
required: true,
|
||||||
choices: [
|
choices: [
|
||||||
{
|
{
|
||||||
name: "Hardline",
|
name: "Hardline",
|
||||||
value: "hardline",
|
value: "hardline",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Demo Expert",
|
name: "Demo Expert",
|
||||||
value: "demoexpert",
|
value: "demoexpert",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Tactical Mask",
|
name: "Tactical Mask",
|
||||||
value: "tacticalmask",
|
value: "tacticalmask",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Alert",
|
name: "Alert",
|
||||||
value: "alert",
|
value: "alert",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Engineer",
|
name: "Engineer",
|
||||||
value: "engineer",
|
value: "engineer",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Dead Silence",
|
name: "Dead Silence",
|
||||||
value: "deadsilence",
|
value: "deadsilence",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Shrapnel",
|
name: "Shrapnel",
|
||||||
value: "shrapnel",
|
value: "shrapnel",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "High Alert",
|
name: "High Alert",
|
||||||
value: "highalert",
|
value: "highalert",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Launcher Plus",
|
name: "Launcher Plus",
|
||||||
value: "launcherplus",
|
value: "launcherplus",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
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"
|
||||||
: d.type == "red"
|
: d.type == "red"
|
||||||
? "8a0a0a"
|
? "8a0a0a"
|
||||||
: d.type == "blue"
|
: d.type == "blue"
|
||||||
? "1047a4"
|
? "1047a4"
|
||||||
: client.color
|
: client.color
|
||||||
)
|
)
|
||||||
.setFooter({
|
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
|
||||||
text: `Made by ${client.author}`,
|
.setTimestamp()
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
.setTitle(d.perk)
|
||||||
})
|
.addField("Effects", d.effects);
|
||||||
.setTimestamp()
|
interaction.followUp({ embeds: [embed] });
|
||||||
.setTitle(d.perk)
|
},
|
||||||
.addFields({ name: "Effects", value: d.effects });
|
};
|
||||||
interaction.followUp({ embeds: [embed] });
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
|
@ -1,169 +1,170 @@
|
||||||
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",
|
||||||
usage: "{Scorestreak}",
|
type: "CHAT_INPUT",
|
||||||
category: "CODM",
|
usage: "{Scorestreak}",
|
||||||
options: [
|
category: "CODM",
|
||||||
{
|
options: [
|
||||||
type: 1,
|
{
|
||||||
name: "lethal",
|
type: "SUB_COMMAND",
|
||||||
description: "Lethal Scorestreak",
|
name: "lethal",
|
||||||
options: [
|
description: "Lethal Scorestreak",
|
||||||
{
|
options: [
|
||||||
type: 3,
|
{
|
||||||
name: "scorestreak",
|
type: 3,
|
||||||
description: "Select a lethal scorestreak",
|
name: "scorestreak",
|
||||||
required: true,
|
description: "Select a lethal scorestreak",
|
||||||
choices: [
|
required: true,
|
||||||
{
|
choices: [
|
||||||
name: "Shield Turret",
|
{
|
||||||
value: "shieldturret",
|
name: "Shield Turret",
|
||||||
},
|
value: "shieldturret",
|
||||||
{
|
},
|
||||||
name: "Hunter Killer Drone",
|
{
|
||||||
value: "hunterkillerdrone",
|
name: "Hunter Killer Drone",
|
||||||
},
|
value: "hunterkillerdrone",
|
||||||
{
|
},
|
||||||
name: "MQ-27 Dragonfire",
|
{
|
||||||
value: "mq27dragonfire",
|
name: "MQ-27 Dragonfire",
|
||||||
},
|
value: "mq27dragonfire",
|
||||||
{
|
},
|
||||||
name: "Predator Missile",
|
{
|
||||||
value: "predatormissile",
|
name: "Predator Missile",
|
||||||
},
|
value: "predatormissile",
|
||||||
{
|
},
|
||||||
name: "Hawk X3",
|
{
|
||||||
value: "hawkx3",
|
name: "Hawk X3",
|
||||||
},
|
value: "hawkx3",
|
||||||
{
|
},
|
||||||
name: "Sentry Gun",
|
{
|
||||||
value: "sentrygun",
|
name: "Sentry Gun",
|
||||||
},
|
value: "sentrygun",
|
||||||
{
|
},
|
||||||
name: "Lightning Strike",
|
{
|
||||||
value: "lightningstrike",
|
name: "Lightning Strike",
|
||||||
},
|
value: "lightningstrike",
|
||||||
{
|
},
|
||||||
name: "Orbital Laser",
|
{
|
||||||
value: "orbitallaser",
|
name: "Orbital Laser",
|
||||||
},
|
value: "orbitallaser",
|
||||||
{
|
},
|
||||||
name: "XS1 Goliath",
|
{
|
||||||
value: "xs1goliath",
|
name: "XS1 Goliath",
|
||||||
},
|
value: "xs1goliath",
|
||||||
{
|
},
|
||||||
name: "Cluster Strike",
|
{
|
||||||
value: "clusterstrike",
|
name: "Cluster Strike",
|
||||||
},
|
value: "clusterstrike",
|
||||||
{
|
},
|
||||||
name: "Chopper Gunner",
|
{
|
||||||
value: "choppergunner",
|
name: "Chopper Gunner",
|
||||||
},
|
value: "choppergunner",
|
||||||
{
|
},
|
||||||
name: "Stealth Chopper",
|
{
|
||||||
value: "stealthchopper",
|
name: "Stealth Chopper",
|
||||||
},
|
value: "stealthchopper",
|
||||||
{
|
},
|
||||||
name: "Swarm",
|
{
|
||||||
value: "swarm",
|
name: "Swarm",
|
||||||
},
|
value: "swarm",
|
||||||
{
|
},
|
||||||
name: "Napalm",
|
{
|
||||||
value: "napalm",
|
name: "Napalm",
|
||||||
},
|
value: "napalm",
|
||||||
{
|
},
|
||||||
name: "VTOL",
|
{
|
||||||
value: "vtol",
|
name: "VTOL",
|
||||||
},
|
value: "vtol",
|
||||||
],
|
},
|
||||||
},
|
],
|
||||||
],
|
},
|
||||||
},
|
],
|
||||||
{
|
},
|
||||||
type: 1,
|
{
|
||||||
name: "support",
|
type: "SUB_COMMAND",
|
||||||
description: "Support Scorestreak",
|
name: "support",
|
||||||
options: [
|
description: "Support Scorestreak",
|
||||||
{
|
options: [
|
||||||
type: 3,
|
{
|
||||||
name: "scorestreak",
|
type: 3,
|
||||||
description: "Select a Support Scorestreak",
|
name: "scorestreak",
|
||||||
required: true,
|
description: "Select a Support Scorestreak",
|
||||||
choices: [
|
required: true,
|
||||||
{
|
choices: [
|
||||||
name: "UAV",
|
{
|
||||||
value: "uav",
|
name: "UAV",
|
||||||
},
|
value: "uav",
|
||||||
{
|
},
|
||||||
name: "Shock RC",
|
{
|
||||||
value: "shockrc",
|
name: "Shock RC",
|
||||||
},
|
value: "shockrc",
|
||||||
{
|
},
|
||||||
name: "Care Package",
|
{
|
||||||
value: "carepackage",
|
name: "Care Package",
|
||||||
},
|
value: "carepackage",
|
||||||
{
|
},
|
||||||
name: "Counter UAV",
|
{
|
||||||
value: "cuav",
|
name: "Counter UAV",
|
||||||
},
|
value: "cuav",
|
||||||
{
|
},
|
||||||
name: "SAM Turret",
|
{
|
||||||
value: "samturret",
|
name: "SAM Turret",
|
||||||
},
|
value: "samturret",
|
||||||
{
|
},
|
||||||
name: "Advance UAV",
|
{
|
||||||
value: "auav",
|
name: "Advance UAV",
|
||||||
},
|
value: "auav",
|
||||||
{
|
},
|
||||||
name: "EMP Systems",
|
{
|
||||||
value: "empsystems",
|
name: "EMP Systems",
|
||||||
},
|
value: "empsystems",
|
||||||
],
|
},
|
||||||
},
|
],
|
||||||
],
|
},
|
||||||
},
|
],
|
||||||
],
|
},
|
||||||
run: async (client, interaction, args) => {
|
],
|
||||||
const val = args[1];
|
run: async (client, interaction, args) => {
|
||||||
const d = await c.getscorestreak(val);
|
const val = args[1];
|
||||||
const embed = new EmbedBuilder()
|
const d = await c.getscorestreak(val);
|
||||||
.setTitle(d.name)
|
const embed = new MessageEmbed()
|
||||||
.setURL(d.preview_video)
|
.setTitle(d.name)
|
||||||
.setDescription(
|
.setURL(d.preview_video)
|
||||||
`<:nyx_description:897379659665264650> **Description** \`\`\`\n${d.description}\`\`\``
|
.setDescription(
|
||||||
)
|
`<:nyx_description:897379659665264650> **Description** \`\`\`\n${d.description}\`\`\``
|
||||||
.addFields(
|
)
|
||||||
{
|
.addFields(
|
||||||
name: "Cost",
|
{
|
||||||
value: `${d.cost}`,
|
name: "Cost",
|
||||||
inline: true,
|
value: `${d.cost}`,
|
||||||
},
|
inline: true,
|
||||||
{
|
},
|
||||||
name: "AI-Assisted",
|
{
|
||||||
value: `
|
name: "AI-Assisted",
|
||||||
${
|
value: `
|
||||||
d.manual
|
${
|
||||||
? "<a:nyx_cross:897244999211696198> No"
|
d.manual
|
||||||
: "<a:nyx_checkmark:897240322411724841> Yes"
|
? "<a:nyx_cross:897244999211696198> No"
|
||||||
}`,
|
: "<a:nyx_checkmark:897240322411724841> Yes"
|
||||||
inline: true,
|
}`,
|
||||||
}
|
inline: true,
|
||||||
)
|
}
|
||||||
.setThumbnail(d.preview)
|
)
|
||||||
.setFooter({
|
.setThumbnail(d.preview)
|
||||||
text: `Made by ${client.author}`,
|
.setFooter({
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
text: `Made by ${client.author}`,
|
||||||
})
|
iconURL: client.user.displayAvatarURL(),
|
||||||
.setColor(
|
})
|
||||||
d.type == "lethal"
|
.setColor(
|
||||||
? "FF2222"
|
d.type == "lethal"
|
||||||
: d.type == "assist"
|
? "FF2222"
|
||||||
? "22FF4A"
|
: d.type == "assist"
|
||||||
: client.color
|
? "22FF4A"
|
||||||
)
|
: client.color
|
||||||
.setTimestamp();
|
)
|
||||||
interaction.followUp({ embeds: [embed] });
|
.setTimestamp();
|
||||||
},
|
interaction.followUp({ embeds: [embed] });
|
||||||
};
|
},
|
||||||
|
};
|
||||||
|
|
|
@ -1,119 +1,119 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "sgrelo",
|
name: "sgrelo",
|
||||||
description: "Calculate reload time for shotgun",
|
description: "Calculate reload time for shotgun",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 7,
|
type: 7,
|
||||||
name: "gun",
|
name: "gun",
|
||||||
description: "Gun name",
|
description: "Gun name",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction, args) => {
|
run: async (client, interaction, args) => {
|
||||||
let err = "",
|
let err = "",
|
||||||
wrn = "",
|
wrn = "",
|
||||||
interpretedAs = [];
|
interpretedAs = [];
|
||||||
function mather(inp) {
|
function mather(inp) {
|
||||||
const inpArr = interpreter(inp),
|
const inpArr = interpreter(inp),
|
||||||
outArr = [];
|
outArr = [];
|
||||||
inpArr.map((x, i, a) => {
|
inpArr.map((x, i, a) => {
|
||||||
for (let j = i + 1; j < a.length; j++) {
|
for (let j = i + 1; j < a.length; j++) {
|
||||||
outArr.push(worker(x, a[j]));
|
outArr.push(worker(x, a[j]));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const aArr = outArr.map(x => x.a),
|
const aArr = outArr.map(x => x.a),
|
||||||
iArr = outArr.map(x => x.i);
|
iArr = outArr.map(x => x.i);
|
||||||
return (
|
return (
|
||||||
"Input: `" +
|
"Input: `" +
|
||||||
interpretedAs.join("`, `") +
|
interpretedAs.join("`, `") +
|
||||||
"`" +
|
"`" +
|
||||||
(aArr.length == 1
|
(aArr.length == 1
|
||||||
? "\nOpening and Closing Animation Time: " +
|
? "\nOpening and Closing Animation Time: " +
|
||||||
beautifier(aArr[0]) +
|
beautifier(aArr[0]) +
|
||||||
"\nReload Time: " +
|
"\nReload Time: " +
|
||||||
beautifier(iArr[0])
|
beautifier(iArr[0])
|
||||||
: "\nAll Opening and Closing Animation Time: " +
|
: "\nAll Opening and Closing Animation Time: " +
|
||||||
aArr.map(x => beautifier(x)).join(", ") +
|
aArr.map(x => beautifier(x)).join(", ") +
|
||||||
"\nAll Reload Time: " +
|
"\nAll Reload Time: " +
|
||||||
iArr.map(x => beautifier(x)).join(", ") +
|
iArr.map(x => beautifier(x)).join(", ") +
|
||||||
"\nAverage Opening and Closing Animation Time: " +
|
"\nAverage Opening and Closing Animation Time: " +
|
||||||
beautifier(aArr.reduce((t, x) => t + x, 0) / aArr.length) +
|
beautifier(aArr.reduce((t, x) => t + x, 0) / aArr.length) +
|
||||||
"\nAverage Reload Time: " +
|
"\nAverage Reload Time: " +
|
||||||
beautifier(iArr.reduce((t, x) => t + x, 0) / iArr.length))
|
beautifier(iArr.reduce((t, x) => t + x, 0) / iArr.length))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function interpreter(inp) {
|
function interpreter(inp) {
|
||||||
let out = [
|
let out = [
|
||||||
...new Set(
|
...new Set(
|
||||||
inp
|
inp
|
||||||
.split(/\n|, |,/g)
|
.split(/\n|, |,/g)
|
||||||
.filter(x => x)
|
.filter(x => x)
|
||||||
.map(x => x.toLowerCase().replace(/[^0-9a-z]/g, ""))
|
.map(x => x.toLowerCase().replace(/[^0-9a-z]/g, ""))
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
out = out
|
out = out
|
||||||
.map(x => {
|
.map(x => {
|
||||||
interpretedAs.push(x);
|
interpretedAs.push(x);
|
||||||
const obj = {
|
const obj = {
|
||||||
b: 0,
|
b: 0,
|
||||||
f: 0,
|
f: 0,
|
||||||
};
|
};
|
||||||
if (
|
if (
|
||||||
x.split(/b/g).length > 2 ||
|
x.split(/b/g).length > 2 ||
|
||||||
x.split(/f/g).length > 2 ||
|
x.split(/f/g).length > 2 ||
|
||||||
x.split(/[a-z]/g).length > 3
|
x.split(/[a-z]/g).length > 3
|
||||||
) {
|
) {
|
||||||
err += "Unknown identifier `" + x + "`\n";
|
err += "Unknown identifier `" + x + "`\n";
|
||||||
} else if (x.indexOf("b") === -1 || x.indexOf("f") === -1) {
|
} else if (x.indexOf("b") === -1 || x.indexOf("f") === -1) {
|
||||||
err += "Missing identifier `" + x + "`\n";
|
err += "Missing identifier `" + x + "`\n";
|
||||||
} else if (x.indexOf("b") === x.length - 1) {
|
} else if (x.indexOf("b") === x.length - 1) {
|
||||||
obj.b = parseFloat(x.split("f")[1].trim());
|
obj.b = parseFloat(x.split("f")[1].trim());
|
||||||
obj.f = parseFloat(x.split("f")[0].trim());
|
obj.f = parseFloat(x.split("f")[0].trim());
|
||||||
} else if (x.indexOf("f") === x.length - 1) {
|
} else if (x.indexOf("f") === x.length - 1) {
|
||||||
obj.b = parseFloat(x.split("b")[0].trim());
|
obj.b = parseFloat(x.split("b")[0].trim());
|
||||||
obj.f = parseFloat(x.split("b")[1].trim());
|
obj.f = parseFloat(x.split("b")[1].trim());
|
||||||
} else {
|
} else {
|
||||||
err += "Unknown identifier `" + x + "`\n";
|
err += "Unknown identifier `" + x + "`\n";
|
||||||
}
|
}
|
||||||
if (!obj.b && obj.f) {
|
if (!obj.b && obj.f) {
|
||||||
err += "Couldn't interpret `" + x + "`\n";
|
err += "Couldn't interpret `" + x + "`\n";
|
||||||
} else if (!Number.isInteger(obj.b)) {
|
} else if (!Number.isInteger(obj.b)) {
|
||||||
err += "Decimal bullet count found `" + x + "`\n";
|
err += "Decimal bullet count found `" + x + "`\n";
|
||||||
} else if (!Number.isInteger(obj.f)) {
|
} else if (!Number.isInteger(obj.f)) {
|
||||||
wrn += "Decimal value found `" + x + "`\n";
|
wrn += "Decimal value found `" + x + "`\n";
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
})
|
})
|
||||||
.filter(x => JSON.stringify(x).length && x);
|
.filter(x => JSON.stringify(x).length && x);
|
||||||
if (out.length === 1) {
|
if (out.length === 1) {
|
||||||
err += "Single equation found\n";
|
err += "Single equation found\n";
|
||||||
}
|
}
|
||||||
return err || !out.length ? [] : out;
|
return err || !out.length ? [] : out;
|
||||||
}
|
}
|
||||||
|
|
||||||
function worker(o1, o2) {
|
function worker(o1, o2) {
|
||||||
const out = {
|
const out = {
|
||||||
i: 0,
|
i: 0,
|
||||||
a: 0,
|
a: 0,
|
||||||
};
|
};
|
||||||
out.i = (o1.f - o2.f) / (o1.b - o2.b);
|
out.i = (o1.f - o2.f) / (o1.b - o2.b);
|
||||||
out.a = o1.f - out.i * o1.b;
|
out.a = o1.f - out.i * o1.b;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
function beautifier(num) {
|
function beautifier(num) {
|
||||||
return parseFloat(num.toFixed(2)).toString() + "s";
|
return parseFloat(num.toFixed(2)).toString() + "s";
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = mather(args[0]);
|
const msg = mather(args[0]);
|
||||||
|
|
||||||
if (err !== "") {
|
if (err !== "") {
|
||||||
interaction.followUp(err);
|
interaction.followUp(err);
|
||||||
} else if (wrn !== "") {
|
} else if (wrn !== "") {
|
||||||
interaction.followUp({ content: wrn + "\n" + msg });
|
interaction.followUp({ content: wrn + "\n" + msg });
|
||||||
} else {
|
} else {
|
||||||
interaction.followUp({ content: msg });
|
interaction.followUp({ content: msg });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,297 +1,301 @@
|
||||||
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,
|
||||||
currAttachments,
|
currAttachments,
|
||||||
currRecoilArr,
|
currRecoilArr,
|
||||||
currDRM,
|
currDRM,
|
||||||
interpretion,
|
interpretion,
|
||||||
recoilAvailable,
|
recoilAvailable,
|
||||||
chart,
|
chart,
|
||||||
hasError;
|
hasError;
|
||||||
module.exports = {
|
const errMsg = "*Generic placeholder error message*";
|
||||||
name: "stats",
|
module.exports = {
|
||||||
description: "Check gun stats",
|
name: "stats",
|
||||||
usage: "(Gun)",
|
description: "Check gun stats",
|
||||||
category: "CODM",
|
usage: "(Gun)",
|
||||||
options: [
|
category: "CODM",
|
||||||
{
|
options: [
|
||||||
type: 3,
|
{
|
||||||
name: "gun_name",
|
type: 3,
|
||||||
description: "Name of the gun",
|
name: "gun_name",
|
||||||
required: true,
|
description: "Name of the gun",
|
||||||
choices: [],
|
required: true,
|
||||||
},
|
choices: [],
|
||||||
{
|
},
|
||||||
type: 3,
|
{
|
||||||
name: "1st_attchment",
|
type: 3,
|
||||||
description: "First attachment",
|
name: "1st_attchment",
|
||||||
},
|
description: "First attachment",
|
||||||
{
|
},
|
||||||
type: 3,
|
{
|
||||||
name: "2nd_attchment",
|
type: 3,
|
||||||
description: "Second attachment",
|
name: "2nd_attchment",
|
||||||
},
|
description: "Second attachment",
|
||||||
{
|
},
|
||||||
type: 3,
|
{
|
||||||
name: "3rd_attchment",
|
type: 3,
|
||||||
description: "Third attachment",
|
name: "3rd_attchment",
|
||||||
},
|
description: "Third attachment",
|
||||||
{
|
},
|
||||||
type: 3,
|
{
|
||||||
name: "4th_attchment",
|
type: 3,
|
||||||
description: "Forth attachment",
|
name: "4th_attchment",
|
||||||
},
|
description: "Forth attachment",
|
||||||
{
|
},
|
||||||
type: 3,
|
{
|
||||||
name: "5th_attchment",
|
type: 3,
|
||||||
description: "Fifth attachment",
|
name: "5th_attchment",
|
||||||
},
|
description: "Fifth attachment",
|
||||||
],
|
},
|
||||||
run: async (client, interaction, args) => {
|
],
|
||||||
repEmb = null;
|
run: async (client, interaction, args) => {
|
||||||
recoilAvailable = false;
|
repEmb = null;
|
||||||
hasError = false;
|
recoilAvailable = false;
|
||||||
if (args.length == 1)
|
hasError = false;
|
||||||
repEmb = statsHandler(args.join(" ").replace("\n", " "));
|
if (args.length == 1)
|
||||||
else repEmb = statsHandler(args.join(" + ").replace("\n", " "));
|
repEmb = statsHandler(args.join(" ").replace("\n", " "));
|
||||||
if (hasError) {
|
else repEmb = statsHandler(args.join(" + ").replace("\n", " "));
|
||||||
interaction.followUp({
|
if (hasError) {
|
||||||
content: `**${repEmb || "An error has occured"}**`,
|
interaction.followUp({ content: `**${repEmb}**` });
|
||||||
});
|
} else {
|
||||||
} else {
|
if (recoilAvailable) {
|
||||||
if (recoilAvailable) {
|
repEmb.fields.push({
|
||||||
repEmb.fields.push({
|
name: "**Recoil Graph**",
|
||||||
name: "**Recoil Graph**",
|
value:
|
||||||
value:
|
"```\nThe Recoil graph below is dynamic (change based on attachment equipped)```",
|
||||||
"```\nThe Recoil graph below is dynamic (change based on attachment equipped)```",
|
});
|
||||||
});
|
const recoilImageLink = await chart.getShortUrl();
|
||||||
const recoilImageLink = await chart.getShortUrl();
|
repEmb.image = { url: recoilImageLink };
|
||||||
repEmb.image = { url: recoilImageLink };
|
}
|
||||||
}
|
interaction.followUp({ embeds: [new MessageEmbed(repEmb)] });
|
||||||
interaction.followUp({ embeds: [new EmbedBuilder(repEmb)] });
|
}
|
||||||
}
|
},
|
||||||
},
|
};
|
||||||
};
|
|
||||||
|
function inpHandler(inpmsg) {
|
||||||
function inpHandler(inpmsg) {
|
statsHandler(inpmsg.split("+")[0]);
|
||||||
statsHandler(inpmsg.split("+")[0]);
|
}
|
||||||
}
|
|
||||||
|
function statsHandler(inpmsg) {
|
||||||
function statsHandler(inpmsg) {
|
let statsNames = [
|
||||||
let statsNames = [
|
"Pellets",
|
||||||
"Pellets", //0
|
"Detonation Range",
|
||||||
"Detonation Range", //1
|
"Explosion Radius",
|
||||||
"Explosion Radius", //2
|
"Explosion Damage",
|
||||||
"Explosion Damage", //3
|
"Firing Mode",
|
||||||
"Firing Mode", //4
|
"Rate of Fire",
|
||||||
"Rate of Fire", //5
|
"Bullet in Burst",
|
||||||
"Bullet in Burst", //6
|
"Time Between Burst",
|
||||||
"Time Between Burst", //7
|
"Bullet Speed",
|
||||||
"Bullet Speed", //8
|
"Penetration Level",
|
||||||
"Penetration Level", //9
|
"Bullet Spread",
|
||||||
"Bullet Spread", //10
|
"Idle Sway",
|
||||||
"Idle Sway", //11
|
"Hipfire Pellet Spread",
|
||||||
"Hipfire Pellet Spread", //12
|
"ADS Pellet Spread",
|
||||||
"ADS Pellet Spread", //13
|
"ADS Time",
|
||||||
"ADS Time", //14
|
"Sprint-to-Fire Time",
|
||||||
"Sprint-to-Fire Time", //15
|
"ADS Zoom",
|
||||||
"ADS Zoom", //16
|
"Magazine",
|
||||||
"Magazine", //17
|
"Reserve",
|
||||||
"Reserve", //18
|
"Reload Type",
|
||||||
"Reload Type", //19
|
"Cancel Reload Time",
|
||||||
"Cancel Reload Time", //20
|
"Reload Time",
|
||||||
"Reload Time", //21
|
"Full Reload Time",
|
||||||
"Full Reload Time", //22
|
"Drop Time",
|
||||||
"Drop Time", //23
|
"Raise Time",
|
||||||
"Raise Time", //24
|
"Sprinting Speed",
|
||||||
"Sprinting Speed", //25
|
"Walking Speed",
|
||||||
"Walking Speed", //26
|
"Straifing Speed",
|
||||||
"Straifing Speed", //27
|
"Damage per Tick",
|
||||||
"Damage per Tick", //28
|
"Number of Ticks",
|
||||||
"Number of Ticks", //29
|
"Time Between Ticks",
|
||||||
"Time Between Ticks", //30
|
"Breath Hold Time",
|
||||||
"Breath Hold Time", //31
|
"shouldNeverHappen0",
|
||||||
"shouldNeverHappen0",
|
"shouldNeverHappen1",
|
||||||
"shouldNeverHappen1",
|
"shouldNeverHappen2",
|
||||||
"shouldNeverHappen2",
|
"shouldNeverHappen3",
|
||||||
"shouldNeverHappen3",
|
"shouldNeverHappen4",
|
||||||
"shouldNeverHappen4",
|
],
|
||||||
],
|
out = [];
|
||||||
out = [];
|
|
||||||
|
currGun = common.weaponIdentifier(inpmsg);
|
||||||
currGun = common.weaponIdentifier(inpmsg);
|
if (typeof currGun == "string") {
|
||||||
if (typeof currGun == "string") {
|
hasError = true;
|
||||||
hasError = true;
|
return currGun;
|
||||||
return currGun;
|
}
|
||||||
}
|
currStats = currGun.stats;
|
||||||
currStats = currGun.stats;
|
currDRM = currGun.drm[0];
|
||||||
currDRM = currGun.drm[0];
|
currAttachments = [];
|
||||||
currAttachments = [];
|
currAttachments = common.attachmentsIdentifier(inpmsg, currGun);
|
||||||
currAttachments = common.attachmentsIdentifier(inpmsg, currGun);
|
if (typeof currAttachments == "string") {
|
||||||
if (typeof currAttachments == "string") {
|
hasError = true;
|
||||||
hasError = true;
|
return currAttachments;
|
||||||
return currAttachments;
|
}
|
||||||
}
|
currRecoilArr = [1, 1, currGun.stats[17]];
|
||||||
currRecoilArr = [1, 1, currGun.stats[17]];
|
if (currAttachments.length != 0) {
|
||||||
if (currAttachments.length != 0) {
|
const totalEffects = common.totaler(currAttachments);
|
||||||
const totalEffects = common.totaler(currAttachments);
|
|
||||||
|
currStats = common.updateStatswithEffects(totalEffects, currStats);
|
||||||
currStats = common.updateStatswithEffects(totalEffects, currStats);
|
currRecoilArr = [totalEffects[2], totalEffects[3], currGun.stats[17]]; // must happen after currStats update
|
||||||
currRecoilArr = [totalEffects[2], totalEffects[3], currGun.stats[17]]; // must happen after currStats update
|
currDRM = currGun.drm[totalEffects[37]];
|
||||||
currDRM = currGun.drm[totalEffects[37]];
|
currDRM.range = currDRM.range.map(x =>
|
||||||
currDRM.range = currDRM.range.map(x =>
|
Math.round(x * (1 + totalEffects[13] / 100))
|
||||||
Math.round(x * (1 + totalEffects[13] / 100))
|
);
|
||||||
);
|
out = common.attachmentHandler(totalEffects, currStats);
|
||||||
out = common.attachmentHandler(totalEffects, currStats);
|
}
|
||||||
}
|
function statsWorker() {
|
||||||
function statsWorker() {
|
if (currStats[19] === 2) {
|
||||||
if (currStats[19] === 2) {
|
currStats[21] =
|
||||||
currStats[21] =
|
currStats[20] + currStats[21] * currStats[17] + currStats[22];
|
||||||
currStats[20] + currStats[21] * currStats[17] + currStats[22];
|
currStats[20] = 0;
|
||||||
currStats[20] = 0;
|
currStats[22] = 0;
|
||||||
currStats[22] = 0;
|
}
|
||||||
}
|
currStats[25] = (currStats[25] * currStats[26]) / 100;
|
||||||
currStats[25] = (currStats[25] * currStats[26]) / 100;
|
|
||||||
|
const outReady = currStats.map((x, i) =>
|
||||||
const outReady = currStats.map((x, i) =>
|
x ? statsNames[i].padEnd(24) + ":".padEnd(3) + beautifier(i) : ""
|
||||||
x ? statsNames[i].padEnd(24) + ":".padEnd(3) + beautifier(i) : ""
|
);
|
||||||
);
|
out = [
|
||||||
out = [
|
...[
|
||||||
...[
|
"Basic Stats",
|
||||||
"Basic Stats",
|
"ADS Stats",
|
||||||
"ADS Stats",
|
"Bullet Stats",
|
||||||
"Bullet Stats",
|
"Magazine",
|
||||||
"Magazine",
|
"Handling Stats",
|
||||||
"Handling Stats",
|
"Mobility Stats",
|
||||||
"Mobility Stats",
|
"Miscellaneous Stats",
|
||||||
"Miscellaneous Stats",
|
].map((x, i) =>
|
||||||
].map((x, i) =>
|
fieldMaker(
|
||||||
fieldMaker(
|
x,
|
||||||
x,
|
[
|
||||||
[
|
[04, 05, 09],
|
||||||
[04, 05, 09],
|
[14, 16, 11, 31],
|
||||||
[14, 16, 11, 31],
|
[00, 06, 07, 08, 10, 12, 13],
|
||||||
[00, 06, 07, 08, 10, 12, 13],
|
[17, 18, 19, 20, 21, 22],
|
||||||
[17, 18, 19, 20, 21, 22],
|
[23, 24],
|
||||||
[23, 24],
|
[25, 26, 27, 15],
|
||||||
[25, 26, 27, 15],
|
[28, 29, 30, 01, 02, 03],
|
||||||
[28, 29, 30, 01, 02, 03],
|
][i]
|
||||||
][i]
|
)
|
||||||
)
|
),
|
||||||
),
|
...out,
|
||||||
...out,
|
];
|
||||||
];
|
function fieldMaker(inpName, inpIndx) {
|
||||||
function fieldMaker(inpName, inpIndx) {
|
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")}\`\`\``,
|
}
|
||||||
}
|
: "";
|
||||||
: "";
|
}
|
||||||
}
|
}
|
||||||
}
|
statsWorker();
|
||||||
statsWorker();
|
|
||||||
|
function beautifier(j) {
|
||||||
function beautifier(j) {
|
switch (j) {
|
||||||
switch (j) {
|
case 04:
|
||||||
case 04:
|
return data.firingModes[currStats[j] - 1];
|
||||||
return data.firingModes[currStats[j] - 1];
|
case 09:
|
||||||
case 09:
|
return data.penetrationLevels[currStats[j] - 1];
|
||||||
return data.penetrationLevels[currStats[j] - 1];
|
case 19:
|
||||||
case 19:
|
return data.reloadTypes[currStats[j] - 1];
|
||||||
return data.reloadTypes[currStats[j] - 1];
|
case 08:
|
||||||
case 08:
|
if (currStats[j] == -1) {
|
||||||
if (currStats[j] == -1) {
|
return "Infinity";
|
||||||
return "Infinity";
|
} else {
|
||||||
} else {
|
return parseFloat(currStats[j].toFixed(2)).toString() + " m/s";
|
||||||
return parseFloat(currStats[j].toFixed(2)).toString() + " m/s";
|
}
|
||||||
}
|
case 03:
|
||||||
case 03:
|
return parseFloat(currStats[j].toFixed(2))
|
||||||
return parseFloat(currStats[j].toFixed(2))
|
.toString()
|
||||||
.toString()
|
.replace(".", " ~ ");
|
||||||
.replace(".", " ~ ");
|
default:
|
||||||
default:
|
return parseFloat(currStats[j].toFixed(2)).toString() + addUnit(j);
|
||||||
return parseFloat(currStats[j].toFixed(2)).toString() + addUnit(j);
|
}
|
||||||
}
|
|
||||||
|
function addUnit(j) {
|
||||||
function addUnit(j) {
|
switch (j) {
|
||||||
switch (j) {
|
case 07:
|
||||||
case 7:
|
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 27:
|
||||||
case 25:
|
case 28:
|
||||||
case 26:
|
case 25:
|
||||||
case 27:
|
case 26:
|
||||||
case 28:
|
return " m/s";
|
||||||
return " m/s";
|
case 20:
|
||||||
case 20:
|
case 21:
|
||||||
case 21:
|
case 22:
|
||||||
case 22:
|
return " s";
|
||||||
return " s";
|
case 16:
|
||||||
case 16:
|
return "%";
|
||||||
return "%";
|
case 06:
|
||||||
case 6:
|
return " Rounds";
|
||||||
return " Rounds";
|
case 05:
|
||||||
case 5:
|
return " RPM";
|
||||||
return " RPM";
|
default:
|
||||||
default:
|
return "";
|
||||||
return "";
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
interpretion = currGun.gunname + common.interpretioner(currAttachments);
|
||||||
interpretion = currGun.gunname + common.interpretioner(currAttachments);
|
if (currGun.recoil.hr.length > 2) {
|
||||||
if (currGun.recoil.hr.length > 2) {
|
chart = common.recoilHandler(
|
||||||
chart = common.recoilHandler(
|
currGun.recoil.hr,
|
||||||
currGun.recoil.hr,
|
currGun.recoil.vr,
|
||||||
currGun.recoil.vr,
|
currRecoilArr[0],
|
||||||
currRecoilArr[0],
|
currRecoilArr[1],
|
||||||
currRecoilArr[1],
|
currRecoilArr[2]
|
||||||
currRecoilArr[2]
|
);
|
||||||
);
|
recoilAvailable = true;
|
||||||
recoilAvailable = true;
|
} else {
|
||||||
} else recoilAvailable = false;
|
recoilAvailable = false;
|
||||||
|
}
|
||||||
if (chart == "none") recoilAvailable = false;
|
if (chart == "none") {
|
||||||
if (chart == "err") hasError = true;
|
recoilAvailable = false;
|
||||||
|
}
|
||||||
const dmg =
|
if (chart == "err" || currAttachments == "err") {
|
||||||
common.damageHandler(
|
hasError = true;
|
||||||
currDRM.damage,
|
return "Cocaineeee";
|
||||||
currDRM.range,
|
}
|
||||||
1,
|
const dmg =
|
||||||
100,
|
common.damageHandler(
|
||||||
60000 / currStats[5],
|
currDRM.damage,
|
||||||
currStats[7],
|
currDRM.range,
|
||||||
currStats[6],
|
1,
|
||||||
currStats[0]
|
100,
|
||||||
) || "```This should never happen```";
|
60000 / currStats[5],
|
||||||
out = [
|
currStats[7],
|
||||||
currGun.description
|
currStats[6],
|
||||||
? {
|
currStats[0]
|
||||||
name: "**Description:**",
|
) || "```This should never happen```";
|
||||||
value: `\`\`\`\n${currGun.description}\`\`\``,
|
out = [
|
||||||
}
|
currGun.description
|
||||||
: {},
|
? {
|
||||||
{ name: "**Damage Profile:**", value: dmg },
|
name: "**Description:**",
|
||||||
...out,
|
value: "```\n" + currGun.description + "```",
|
||||||
];
|
}
|
||||||
out = out.filter(x => x.value);
|
: {},
|
||||||
return {
|
{ name: "**Damage Profile:**", value: dmg },
|
||||||
title: interpretion,
|
...out,
|
||||||
color: 5814783,
|
];
|
||||||
fields: out,
|
out = out.filter(x => x.value);
|
||||||
footer: {
|
return {
|
||||||
text: "[OUTDATED] All data courtesy of Project Lighthouse 2.0 and CoDM Research Crew",
|
title: interpretion,
|
||||||
icon_url:
|
color: 5814783,
|
||||||
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png",
|
fields: out,
|
||||||
},
|
footer: {
|
||||||
};
|
text: "[OUTDATED] All data courtesy of Project Lighthouse 2.0 and CoDM Research Crew",
|
||||||
}
|
icon_url:
|
||||||
|
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
106
command/CODM/watermark.js
Normal file
106
command/CODM/watermark.js
Normal 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] });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
|
@ -1,128 +1,124 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { MessageEmbed } = require("discord.js");
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "premiumserver",
|
name: "premiumserver",
|
||||||
category: "Config",
|
category: "Config",
|
||||||
description: "Add premium to a server",
|
description: "Add premium to a server",
|
||||||
Premium: true,
|
Premium: true,
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 5,
|
type: 5,
|
||||||
name: "choice",
|
name: "choice",
|
||||||
description: "Whether add or remove premium server",
|
description: "Whether add or remove premium server",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction) => {
|
run: async (client, interaction) => {
|
||||||
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 (
|
||||||
}
|
(user.Tier == 1 && user.PremiumServers.length >= 5) ||
|
||||||
if (
|
(user.Tier == 2 && user.PremiumServers.length >= 2) ||
|
||||||
(user.Tier == 1 && user.PremiumServers.length >= 5) ||
|
(user.Tier == 3 && user.PremiumServers.length >= 0)
|
||||||
(user.Tier == 2 && user.PremiumServers.length >= 2) ||
|
) {
|
||||||
(user.Tier == 3 && user.PremiumServers.length >= 0)
|
interaction.followUp({
|
||||||
) {
|
content:
|
||||||
interaction.followUp({
|
"You have already reached the maximum amount of premium servers",
|
||||||
content:
|
});
|
||||||
"You have already reached the maximum amount of premium servers",
|
} else {
|
||||||
});
|
await client.data.setPremium(interaction.guild.id, "true");
|
||||||
} else {
|
await client.data.pushGuild(
|
||||||
await client.data.setPremium(interaction.guild.id, "true");
|
interaction.user.id,
|
||||||
await client.data.pushGuild(
|
interaction.guild.id,
|
||||||
interaction.user.id,
|
"push"
|
||||||
interaction.guild.id,
|
);
|
||||||
"push"
|
interaction.followUp({
|
||||||
);
|
embeds: [
|
||||||
interaction.followUp({
|
new MessageEmbed()
|
||||||
embeds: [
|
.setTitle("Success!")
|
||||||
new EmbedBuilder()
|
.setDescription(
|
||||||
.setTitle("Success!")
|
`Premium added to **${interaction.guild.name}**! \n`
|
||||||
.setDescription(
|
)
|
||||||
`Premium added to **${interaction.guild.name}**! \n`
|
.setFooter("Thank you for supporting Cath!")
|
||||||
)
|
.setColor("GREEN")
|
||||||
.setFooter({ text: "Thank you for supporting Cath!" })
|
.setTimestamp()
|
||||||
.setColor("Green")
|
.setAuthor(
|
||||||
.setTimestamp()
|
interaction.user.tag,
|
||||||
.setAuthor({
|
interaction.user.displayAvatarURL({ dynamic: true })
|
||||||
name: interaction.user.tag,
|
),
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
],
|
||||||
}),
|
});
|
||||||
],
|
client.channels.cache.get(client.config.ServerLog).send({
|
||||||
});
|
embeds: [
|
||||||
client.channels.cache.get(client.config.ServerLog).send({
|
new MessageEmbed()
|
||||||
embeds: [
|
.setTitle("New Premium Server")
|
||||||
new EmbedBuilder()
|
.addField(
|
||||||
.setTitle("New Premium Server")
|
"Server Info",
|
||||||
.addFields({
|
`**>Server Name**: \n${interaction.guild.name}
|
||||||
name: "Server Info",
|
**>Server ID**: \n${interaction.guild.id}
|
||||||
value: `**>Server Name**: \n${interaction.guild.name}
|
**>Server Member Count**: \n${interaction.guild.memberCount}`
|
||||||
**>Server ID**: \n${interaction.guild.id}
|
)
|
||||||
**>Server Member Count**: \n${interaction.guild.memberCount}`,
|
.setTimestamp()
|
||||||
})
|
.setThumbnail(interaction.guild.iconURL({ dynamic: true }))
|
||||||
.setTimestamp()
|
.setColor("GREEN"),
|
||||||
.setThumbnail(interaction.guild.iconURL({ dynamic: true }))
|
],
|
||||||
.setColor("Green"),
|
});
|
||||||
],
|
}
|
||||||
});
|
} else {
|
||||||
}
|
if (guild.Premium == false) {
|
||||||
} else {
|
interaction.followUp({ content: "This server isn't premium yet" });
|
||||||
if (!guild.Premium) {
|
}
|
||||||
return interaction.followUp({
|
if (!user.PremiumServers.includes(interaction.guild.id)) {
|
||||||
content: "This server isn't premium yet",
|
interaction.followUp({
|
||||||
});
|
content:
|
||||||
}
|
"You can't remove due to you aren't the person who made the server premium",
|
||||||
if (!user.PremiumServers.includes(interaction.guild.id)) {
|
});
|
||||||
return interaction.followUp({
|
} else {
|
||||||
content:
|
await client.data.setPremium(interaction.guild.id, "false");
|
||||||
"You can't remove due to you aren't the person who made the server premium",
|
await client.data.pushGuild(
|
||||||
});
|
interaction.user.id,
|
||||||
} else {
|
interaction.guild.id,
|
||||||
await client.data.setPremium(interaction.guild.id, "false");
|
"splice"
|
||||||
await client.data.pushGuild(
|
);
|
||||||
interaction.user.id,
|
interaction.followUp({
|
||||||
interaction.guild.id,
|
embeds: [
|
||||||
"splice"
|
new MessageEmbed()
|
||||||
);
|
.setTitle("Removed!")
|
||||||
interaction.followUp({
|
.setDescription(
|
||||||
embeds: [
|
`Premium removed from **${interaction.guild.name}**! \n`
|
||||||
new EmbedBuilder()
|
)
|
||||||
.setTitle("Removed!")
|
.setColor("RED")
|
||||||
.setDescription(
|
.setTimestamp()
|
||||||
`Premium removed from **${interaction.guild.name}**! \n`
|
.setAuthor(
|
||||||
)
|
interaction.user.tag,
|
||||||
.setColor("Red")
|
interaction.user.displayAvatarURL({ dynamic: true })
|
||||||
.setTimestamp()
|
),
|
||||||
.setAuthor({
|
],
|
||||||
name: interaction.user.tag,
|
});
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
client.channels.cache.get(client.config.ServerLog).send({
|
||||||
}),
|
embeds: [
|
||||||
],
|
new MessageEmbed()
|
||||||
});
|
.setTitle("Premium Server Removed")
|
||||||
client.channels.cache.get(client.config.ServerLog).send({
|
.addField(
|
||||||
embeds: [
|
"Server Info",
|
||||||
new EmbedBuilder()
|
`**>Server Name**: \n${interaction.guild.name}
|
||||||
.setTitle("Premium Server Removed")
|
**>Server ID**: \n${interaction.guild.id}
|
||||||
.addFields({
|
**>Server Member Count**: \n${interaction.guild.memberCount}`
|
||||||
name: "Server Info",
|
)
|
||||||
value: `**>Server Name**: \n${interaction.guild.name}
|
.setTimestamp()
|
||||||
**>Server ID**: \n${interaction.guild.id}
|
.setThumbnail(interaction.guild.iconURL({ dynamic: true }))
|
||||||
**>Server Member Count**: \n${interaction.guild.memberCount}`,
|
.setColor("RED"),
|
||||||
})
|
],
|
||||||
.setTimestamp()
|
});
|
||||||
.setThumbnail(interaction.guild.iconURL({ dynamic: true }))
|
}
|
||||||
.setColor("Red"),
|
}
|
||||||
],
|
} catch (e) {
|
||||||
});
|
console.log(e);
|
||||||
}
|
interaction.followUp({ content: `**Error**: ${e.message}` });
|
||||||
}
|
}
|
||||||
} catch (e) {
|
},
|
||||||
console.log(e);
|
};
|
||||||
interaction.followUp({ content: `**Error**: ${e.message}` });
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
|
@ -1,246 +1,537 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const starboardClient = require("../../client/StarboardClient");
|
||||||
const fs = require("fs");
|
const { MessageEmbed } = require("discord.js");
|
||||||
module.exports = {
|
const fs = require("fs");
|
||||||
name: "settings",
|
module.exports = {
|
||||||
description: "Configure settings for the server",
|
name: "settings",
|
||||||
UserPerms: ["ADMINISTRATOR"],
|
description: "Configure settings for the server",
|
||||||
category: "Config",
|
UserPerms: ["ADMINISTRATOR"],
|
||||||
options: [
|
category: "Config",
|
||||||
{
|
options: [
|
||||||
type: 2,
|
{
|
||||||
name: "enable",
|
type: "SUB_COMMAND",
|
||||||
description: "Enable commands/category for the server",
|
name: "muterole",
|
||||||
options: [
|
description: "Configure mute role settings for the server",
|
||||||
{
|
options: [
|
||||||
type: 1,
|
{
|
||||||
name: "command",
|
type: 8,
|
||||||
description: "To enable commands",
|
name: "role",
|
||||||
options: [
|
description: "The role for muted users",
|
||||||
{
|
required: true,
|
||||||
type: 3,
|
},
|
||||||
name: "name",
|
],
|
||||||
description: "The command name to be enabled",
|
},
|
||||||
required: true,
|
{
|
||||||
},
|
type: "SUB_COMMAND",
|
||||||
],
|
name: "prefix",
|
||||||
},
|
description: "Configure prefix settings for the server",
|
||||||
{
|
options: [
|
||||||
type: 1,
|
{
|
||||||
name: "category",
|
type: 3,
|
||||||
description: "To enable categories",
|
name: "prefix",
|
||||||
options: [
|
description: "The prefix for the server",
|
||||||
{
|
required: true,
|
||||||
type: 3,
|
choices: [],
|
||||||
name: "name",
|
},
|
||||||
description: "The category name to be enabled",
|
],
|
||||||
required: true,
|
},
|
||||||
choices: [
|
{
|
||||||
{
|
type: "SUB_COMMAND",
|
||||||
name: "codm",
|
name: "welcome",
|
||||||
value: "CODM",
|
description: "Configure welcome channel settings for the server",
|
||||||
},
|
options: [
|
||||||
{
|
{
|
||||||
name: "config",
|
type: 7,
|
||||||
value: "Config",
|
name: "channel",
|
||||||
},
|
description: "The channel for welcome messages",
|
||||||
{
|
required: true,
|
||||||
name: "information",
|
channelTypes: ["GUILD_TEXT"],
|
||||||
value: "Information",
|
},
|
||||||
},
|
],
|
||||||
{
|
},
|
||||||
name: "utilities",
|
{
|
||||||
value: "Utilities",
|
type: "SUB_COMMAND",
|
||||||
},
|
name: "goodbye",
|
||||||
],
|
description: "Configure goodbye channel settings for the server",
|
||||||
},
|
options: [
|
||||||
],
|
{
|
||||||
},
|
type: 7,
|
||||||
],
|
name: "channel",
|
||||||
},
|
description: "The channel for goodbye messages",
|
||||||
{
|
required: true,
|
||||||
type: 2,
|
channelTypes: ["GUILD_TEXT"],
|
||||||
name: "disable",
|
},
|
||||||
description: "Disable commands/category for the server",
|
],
|
||||||
options: [
|
},
|
||||||
{
|
{
|
||||||
type: 1,
|
type: "SUB_COMMAND",
|
||||||
name: "command",
|
name: "starboard",
|
||||||
description: "To disable commands",
|
description: "Configure starboard channel settings for the server",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 7,
|
||||||
name: "name",
|
name: "channel",
|
||||||
description: "The command name to be disabled",
|
description: "The channel for starboard messages",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
channelTypes: ["GUILD_TEXT"],
|
||||||
],
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 4,
|
||||||
type: 1,
|
name: "starcount",
|
||||||
name: "category",
|
description: "The required amount of star to trigger the starboard",
|
||||||
description: "To disable categories",
|
required: true,
|
||||||
options: [
|
},
|
||||||
{
|
],
|
||||||
type: 3,
|
},
|
||||||
name: "name",
|
{
|
||||||
description: "The category name to be disabled",
|
type: "SUB_COMMAND",
|
||||||
required: true,
|
name: "chatbot",
|
||||||
choices: [
|
description: "Configure chatbot channel settings for the server",
|
||||||
{
|
options: [
|
||||||
name: "codm",
|
{
|
||||||
value: "CODM",
|
type: 7,
|
||||||
},
|
name: "channel",
|
||||||
{
|
description: "The channel for chatbotmessages",
|
||||||
name: "config",
|
required: true,
|
||||||
value: "Config",
|
channelTypes: ["GUILD_TEXT"],
|
||||||
},
|
},
|
||||||
|
],
|
||||||
{
|
},
|
||||||
name: "information",
|
{
|
||||||
value: "Information",
|
type: "SUB_COMMAND",
|
||||||
},
|
name: "log",
|
||||||
{
|
description: "Configure log channel settings for the server",
|
||||||
name: "utilities",
|
options: [
|
||||||
value: "Utilities",
|
{
|
||||||
},
|
type: 7,
|
||||||
],
|
name: "channel",
|
||||||
},
|
description: "The channel for log messages",
|
||||||
],
|
required: true,
|
||||||
},
|
channelTypes: ["GUILD_TEXT"],
|
||||||
],
|
},
|
||||||
},
|
],
|
||||||
{
|
},
|
||||||
type: 1,
|
{
|
||||||
name: "tips",
|
type: 2,
|
||||||
description: "Configure tips settings for the server",
|
name: "enable",
|
||||||
options: [
|
description: "Enable commands/category for the server",
|
||||||
{
|
options: [
|
||||||
type: 5,
|
{
|
||||||
name: "choice",
|
type: "SUB_COMMAND",
|
||||||
description: "Set whether tips system is activated for the server",
|
name: "command",
|
||||||
required: true,
|
description: "To enable commands",
|
||||||
},
|
options: [
|
||||||
],
|
{
|
||||||
},
|
type: 3,
|
||||||
{
|
name: "name",
|
||||||
type: 1,
|
description: "The command name to be enabled",
|
||||||
name: "overall",
|
required: true,
|
||||||
description: "See overall settings for the server",
|
},
|
||||||
options: [],
|
],
|
||||||
},
|
},
|
||||||
],
|
{
|
||||||
run: async (client, interaction, args, utils, data) => {
|
type: "SUB_COMMAND",
|
||||||
if (args[0].toLowerCase() === "tips") {
|
name: "category",
|
||||||
if (args[1]) {
|
description: "To enable categories",
|
||||||
await client.data.setTips(interaction.guild.id, "true");
|
options: [
|
||||||
interaction.followUp({
|
{
|
||||||
content: `Tips is enabled in this server now.`,
|
type: 3,
|
||||||
});
|
name: "name",
|
||||||
} else {
|
description: "The category name to be enabled",
|
||||||
await client.data.setTips(interaction.guild.id, "false");
|
required: true,
|
||||||
interaction.followUp({
|
choices: [
|
||||||
content: `Tips is disabled in this server now.`,
|
{
|
||||||
});
|
name: "codm",
|
||||||
}
|
value: "CODM",
|
||||||
} else if (args[0].toLowerCase() === "enable") {
|
},
|
||||||
const type = args[1].toLowerCase();
|
{
|
||||||
const name = args[2].toLowerCase();
|
name: "config",
|
||||||
if (type === "command") {
|
value: "Config",
|
||||||
if (!!client.slashCommands.get(name) === false) {
|
},
|
||||||
interaction.followUp({
|
{
|
||||||
content: `There isn't any command/category named \`${name}\``,
|
name: "economy",
|
||||||
});
|
value: "Economy",
|
||||||
} else if (!data.Guild.Commands.includes(name)) {
|
},
|
||||||
interaction.followUp({
|
{
|
||||||
content: `\`${args[2]}\` command had already been enabled`,
|
name: "fun",
|
||||||
});
|
value: "Fun",
|
||||||
} else if (
|
},
|
||||||
data.Guild.Commands.includes(name) &&
|
{
|
||||||
!!client.slashCommands.get(name) === true
|
name: "information",
|
||||||
) {
|
value: "Information",
|
||||||
await client.data.enable(interaction.guild.id, "command", name);
|
},
|
||||||
interaction.followUp({
|
{
|
||||||
content: `\`${args[2]}\` command is now enabled`,
|
name: "moderation",
|
||||||
});
|
value: "Moderation",
|
||||||
}
|
},
|
||||||
}
|
{
|
||||||
if (type === "category") {
|
name: "utilities",
|
||||||
const category = fs.readdirSync("./command");
|
value: "Utilities",
|
||||||
if (!data.Guild.Category.includes(args[2])) {
|
},
|
||||||
interaction.followUp({
|
],
|
||||||
content: `\`${args[2]}\` category had already been enabled`,
|
},
|
||||||
});
|
],
|
||||||
}
|
},
|
||||||
if (
|
],
|
||||||
data.Guild.Category.includes(args[2]) &&
|
},
|
||||||
category.includes(args[2])
|
{
|
||||||
) {
|
type: 2,
|
||||||
await client.data.enable(interaction.guild.id, "category", args[2]);
|
name: "disable",
|
||||||
interaction.followUp({
|
description: "Disable commands/category for the server",
|
||||||
content: `\`${args[2]}\` category is now enabled`,
|
options: [
|
||||||
});
|
{
|
||||||
}
|
type: "SUB_COMMAND",
|
||||||
}
|
name: "command",
|
||||||
} else if (args[0].toLowerCase() === "disable") {
|
description: "To disable commands",
|
||||||
const type = args[1].toLowerCase();
|
options: [
|
||||||
const name = args[2].toLowerCase();
|
{
|
||||||
if (type === "command") {
|
type: 3,
|
||||||
if (!!client.slashCommands.get(name) === false) {
|
name: "name",
|
||||||
interaction.followUp({
|
description: "The command name to be disabled",
|
||||||
content: `There isn't any command/category named \`${name}\``,
|
required: true,
|
||||||
});
|
},
|
||||||
} else if (data.Guild.Commands.includes(name)) {
|
],
|
||||||
interaction.followUp({
|
},
|
||||||
content: `\`${args[2]}\` command had already been disabled`,
|
{
|
||||||
});
|
type: "SUB_COMMAND",
|
||||||
} else if (
|
name: "category",
|
||||||
!data.Guild.Commands.includes(name) &&
|
description: "To disable categories",
|
||||||
!!client.slashCommands.get(name) === true
|
options: [
|
||||||
) {
|
{
|
||||||
await client.data.disable(interaction.guild.id, "command", name);
|
type: 3,
|
||||||
interaction.followUp({
|
name: "name",
|
||||||
content: `\`${args[2]}\` command is now disabled`,
|
description: "The category name to be disabled",
|
||||||
});
|
required: true,
|
||||||
}
|
choices: [
|
||||||
}
|
{
|
||||||
if (type === "category") {
|
name: "codm",
|
||||||
const category = fs.readdirSync("./command");
|
value: "CODM",
|
||||||
if (data.Guild.Category.includes(args[2])) {
|
},
|
||||||
interaction.followUp({
|
{
|
||||||
content: `\`${args[2]}\` category had already been disabled`,
|
name: "config",
|
||||||
});
|
value: "Config",
|
||||||
}
|
},
|
||||||
if (
|
{
|
||||||
!data.Guild.Category.includes(args[2]) &&
|
name: "economy",
|
||||||
category.includes(args[2])
|
value: "Economy",
|
||||||
) {
|
},
|
||||||
await client.data.disable(interaction.guild.id, "category", args[2]);
|
{
|
||||||
interaction.followUp({
|
name: "fun",
|
||||||
content: `\`${args[2]}\` category is now disabled`,
|
value: "Fun",
|
||||||
});
|
},
|
||||||
}
|
{
|
||||||
}
|
name: "information",
|
||||||
} else {
|
value: "Information",
|
||||||
const d = `
|
},
|
||||||
**Prefix**: ${data.Guild.Prefix ? data.Guild.Prefix : "C."}
|
{
|
||||||
**Tips**: ${data.Guild.Tips ? "Enable" : "Disabled"}
|
name: "moderation",
|
||||||
**Disabled Commands**: ${
|
value: "Moderation",
|
||||||
data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None"
|
},
|
||||||
}
|
{
|
||||||
**Disabled Categories**: ${
|
name: "utilities",
|
||||||
data.Guild.Category.length ? data.Guilds.Category.join(",") : "None"
|
value: "Utilities",
|
||||||
}
|
},
|
||||||
`;
|
],
|
||||||
const embed = new EmbedBuilder()
|
},
|
||||||
.setTitle(`**${interaction.guild.name}** Settings`)
|
],
|
||||||
.setColor(client.color)
|
},
|
||||||
.setFooter({
|
],
|
||||||
text: `Made by ${client.author}`,
|
},
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
{
|
||||||
})
|
type: "SUB_COMMAND",
|
||||||
.setTimestamp()
|
name: "level",
|
||||||
.setDescription(d);
|
description: "Configure level settings for the server",
|
||||||
interaction.followUp({ embeds: [embed] });
|
options: [
|
||||||
}
|
{
|
||||||
},
|
type: 5,
|
||||||
};
|
name: "choice",
|
||||||
|
description: "Set whether level system is activated for the server",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "SUB_COMMAND",
|
||||||
|
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: "SUB_COMMAND",
|
||||||
|
name: "tips",
|
||||||
|
description: "Configure tips settings for the server",
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
type: 5,
|
||||||
|
name: "choice",
|
||||||
|
description: "Set whether tips system is activated for the server",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "SUB_COMMAND",
|
||||||
|
name: "overall",
|
||||||
|
description: "See overall settings for the server",
|
||||||
|
options: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
run: async (client, interaction, args, utils, data) => {
|
||||||
|
if (args[0].toLowerCase() === "muterole") {
|
||||||
|
const role = interaction.guild.roles.cache.get(args[1]);
|
||||||
|
if (role.managed) {
|
||||||
|
interaction.followUp({ content: "You must provide a non bot role" });
|
||||||
|
} else {
|
||||||
|
await client.data.setMuterole(interaction.guild.id, args[1]);
|
||||||
|
interaction.followUp({
|
||||||
|
content: `Saved **${role.name}** as the mute role`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (args[0].toLowerCase() === "prefix") {
|
||||||
|
await client.data.setPrefix(interaction.guild.id, args[1]);
|
||||||
|
interaction.followUp({ content: `Saved \`${args[2]}\` as the prefix` });
|
||||||
|
} else if (args[0].toLowerCase() === "welcome") {
|
||||||
|
const channel = interaction.guild.channels.cache.get(args[1]);
|
||||||
|
if (channel.type !== "GUILD_TEXT") {
|
||||||
|
interaction.followUp({ content: "Please provide a text channel" });
|
||||||
|
} else {
|
||||||
|
await client.data.setWelcome(interaction.guild.id, args[1]);
|
||||||
|
interaction.followUp({
|
||||||
|
content: `Saved **${channel}** as the welcome channel`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (args[0].toLowerCase() === "goodbye") {
|
||||||
|
const channel = interaction.guild.channels.cache.get(args[1]);
|
||||||
|
if (channel.type !== "GUILD_TEXT") {
|
||||||
|
interaction.followUp({ content: "Please provide a text channel" });
|
||||||
|
} else {
|
||||||
|
await client.data.setGoodbye(interaction.guild.id, args[1]);
|
||||||
|
interaction.followUp({
|
||||||
|
content: `Saved **${channel}** as the goodbye channel`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (args[0].toLowerCase() === "starboard") {
|
||||||
|
const channel = interaction.guild.channels.cache.get(args[1]);
|
||||||
|
if (channel.type !== "GUILD_TEXT") {
|
||||||
|
interaction.followUp({ content: "Please provide a text channel" });
|
||||||
|
} else {
|
||||||
|
starboardClient.config.guilds.add({
|
||||||
|
id: interaction.guild.id,
|
||||||
|
options: {
|
||||||
|
starCount: args[2],
|
||||||
|
starboardChannel: args[1],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
await client.data.setStarboard(interaction.guild.id, args[1], args[2]);
|
||||||
|
interaction.followUp({
|
||||||
|
content: `Saved **${channel}** as the starboard channel`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (args[0].toLowerCase() === "chatbot") {
|
||||||
|
const channel = interaction.guild.channels.cache.get(args[1]);
|
||||||
|
if (channel.type !== "GUILD_TEXT") {
|
||||||
|
interaction.followUp({ content: "Please provide a text channel" });
|
||||||
|
} else {
|
||||||
|
await client.data.setChatbot(interaction.guild.id, args[1]);
|
||||||
|
interaction.followUp({
|
||||||
|
content: `Saved **${channel}** as the chatbot channel`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (args[0].toLowerCase() === "log") {
|
||||||
|
const channel = interaction.guild.channels.cache.get(args[1]);
|
||||||
|
if (channel.type !== "GUILD_TEXT") {
|
||||||
|
interaction.followUp({ content: "Please provide a text channel" });
|
||||||
|
} else {
|
||||||
|
let webhookid;
|
||||||
|
let webhooktoken;
|
||||||
|
await channel
|
||||||
|
.createWebhook(interaction.guild.name, {
|
||||||
|
avatar: interaction.guild.iconURL({ format: "png" }),
|
||||||
|
})
|
||||||
|
.then(webhook => {
|
||||||
|
webhookid = webhook.id;
|
||||||
|
webhooktoken = webhook.token;
|
||||||
|
});
|
||||||
|
await client.data.setLog(
|
||||||
|
interaction.guild.id,
|
||||||
|
channel.id,
|
||||||
|
webhookid,
|
||||||
|
webhooktoken
|
||||||
|
);
|
||||||
|
interaction.followUp({
|
||||||
|
content: `Saved **${channel}** as the log channel`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (args[0].toLowerCase() === "level") {
|
||||||
|
if (args[1]) {
|
||||||
|
await client.data.setGLevel(interaction.guild.id, "true");
|
||||||
|
interaction.followUp({
|
||||||
|
content: `Levelling is enabled in this server now.`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
await client.data.setGLevel(interaction.guild.id, "false");
|
||||||
|
interaction.followUp({
|
||||||
|
content: `Levelling is disabled in this server now.`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (args[0].toLowerCase() === "nsfw") {
|
||||||
|
if (args[1]) {
|
||||||
|
await client.data.setNSFW(interaction.guild.id, "true");
|
||||||
|
interaction.followUp({
|
||||||
|
content: `NSFW is enabled in this server now.`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
await client.data.setNSFW(interaction.guild.id, "false");
|
||||||
|
interaction.followUp({
|
||||||
|
content: `NSFW is disabled in this server now.`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (args[0].toLowerCase() === "tips") {
|
||||||
|
if (args[1]) {
|
||||||
|
await client.data.setTips(interaction.guild.id, "true");
|
||||||
|
interaction.followUp({
|
||||||
|
content: `Tips is enabled in this server now.`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
await client.data.setTips(interaction.guild.id, "false");
|
||||||
|
interaction.followUp({
|
||||||
|
content: `Tips is disabled in this server now.`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (args[0].toLowerCase() === "enable") {
|
||||||
|
const type = args[1].toLowerCase();
|
||||||
|
const name = args[2].toLowerCase();
|
||||||
|
if (type === "command") {
|
||||||
|
if (!!client.slashCommands.get(name) === false) {
|
||||||
|
interaction.followUp({
|
||||||
|
content: `There isn't any command/category named \`${name}\``,
|
||||||
|
});
|
||||||
|
} else if (!data.Guild.Commands.includes(name)) {
|
||||||
|
interaction.followUp({
|
||||||
|
content: `\`${args[2]}\` command had already been enabled`,
|
||||||
|
});
|
||||||
|
} else if (
|
||||||
|
data.Guild.Commands.includes(name) &&
|
||||||
|
!!client.slashCommands.get(name) === true
|
||||||
|
) {
|
||||||
|
await client.data.enable(interaction.guild.id, "command", name);
|
||||||
|
interaction.followUp({
|
||||||
|
content: `\`${args[2]}\` command is now enabled`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type === "category") {
|
||||||
|
const category = fs.readdirSync("./command");
|
||||||
|
if (!data.Guild.Category.includes(args[2])) {
|
||||||
|
interaction.followUp({
|
||||||
|
content: `\`${args[2]}\` category had already been enabled`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
data.Guild.Category.includes(args[2]) &&
|
||||||
|
category.includes(args[2])
|
||||||
|
) {
|
||||||
|
await client.data.enable(interaction.guild.id, "category", args[2]);
|
||||||
|
interaction.followUp({
|
||||||
|
content: `\`${args[2]}\` category is now enabled`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (args[0].toLowerCase() === "disable") {
|
||||||
|
const type = args[1].toLowerCase();
|
||||||
|
const name = args[2].toLowerCase();
|
||||||
|
if (type === "command") {
|
||||||
|
if (!!client.slashCommands.get(name) === false) {
|
||||||
|
interaction.followUp({
|
||||||
|
content: `There isn't any command/category named \`${name}\``,
|
||||||
|
});
|
||||||
|
} else if (data.Guild.Commands.includes(name)) {
|
||||||
|
interaction.followUp({
|
||||||
|
content: `\`${args[2]}\` command had already been disabled`,
|
||||||
|
});
|
||||||
|
} else if (
|
||||||
|
!data.Guild.Commands.includes(name) &&
|
||||||
|
!!client.slashCommands.get(name) === true
|
||||||
|
) {
|
||||||
|
await client.data.disable(interaction.guild.id, "command", name);
|
||||||
|
interaction.followUp({
|
||||||
|
content: `\`${args[2]}\` command is now disabled`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type === "category") {
|
||||||
|
const category = fs.readdirSync("./command");
|
||||||
|
if (data.Guild.Category.includes(args[2])) {
|
||||||
|
interaction.followUp({
|
||||||
|
content: `\`${args[2]}\` category had already been disabled`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
!data.Guild.Category.includes(args[2]) &&
|
||||||
|
category.includes(args[2])
|
||||||
|
) {
|
||||||
|
await client.data.disable(interaction.guild.id, "category", args[2]);
|
||||||
|
interaction.followUp({
|
||||||
|
content: `\`${args[2]}\` category is now disabled`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const d = `
|
||||||
|
**Mute Role**: ${
|
||||||
|
interaction.guild.roles.cache.get(data.Guild.Muterole)
|
||||||
|
? interaction.guild.roles.cache.get(data.Guild.Muterole)
|
||||||
|
: "None"
|
||||||
|
}
|
||||||
|
**Prefix**: ${data.Guild.Prefix ? data.Guild.Prefix : "C."}
|
||||||
|
**Welcome Channel**: ${
|
||||||
|
interaction.guild.channels.cache.get(data.Guild.Welcome)
|
||||||
|
? interaction.guild.channels.cache.get(data.Guild.Welcome)
|
||||||
|
: "None"
|
||||||
|
}
|
||||||
|
**Goodbye Channel**: ${
|
||||||
|
interaction.guild.channels.cache.get(data.Guild.Goodbye)
|
||||||
|
? interaction.guild.channels.cache.get(data.Guild.Goodbye)
|
||||||
|
: "None"
|
||||||
|
}
|
||||||
|
**Starboard Channel**: ${
|
||||||
|
interaction.guild.channels.cache.get(data.Guild.Starboard)
|
||||||
|
? interaction.guild.channels.cache.get(data.Guild.Starboard)
|
||||||
|
: "None"
|
||||||
|
}
|
||||||
|
**Chatbot Channel**: ${
|
||||||
|
interaction.guild.channels.cache.get(data.Guild.Chatbot)
|
||||||
|
? interaction.guild.channels.cache.get(data.Guild.Chatbot)
|
||||||
|
: "None"
|
||||||
|
}
|
||||||
|
**Log Channel**: ${
|
||||||
|
interaction.guild.channels.cache.get(data.Guild.Log)
|
||||||
|
? interaction.guild.channels.cache.get(data.Guild.Log)
|
||||||
|
: "None"
|
||||||
|
}
|
||||||
|
**Level**: ${data.Guild.Level ? "Enable" : "Disabled"}
|
||||||
|
**NSFW**: ${data.Guild.NSFW ? "Enable" : "Disabled"}
|
||||||
|
**Tips**: ${data.Guild.Tips ? "Enable" : "Disabled"}
|
||||||
|
**Disabled Commands**: ${
|
||||||
|
data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None"
|
||||||
|
}
|
||||||
|
**Disabled Categories**: ${
|
||||||
|
data.Guild.Category.length ? data.Guilds.Category.join(",") : "None"
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
const embed = new MessageEmbed()
|
||||||
|
.setTitle(`**${interaction.guild.name}** Settings`)
|
||||||
|
.setColor(client.color)
|
||||||
|
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
|
||||||
|
.setTimestamp()
|
||||||
|
.setDescription(d);
|
||||||
|
interaction.followUp({ embeds: [embed] });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
29
command/Economy/bal.js
Normal file
29
command/Economy/bal.js
Normal 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
81
command/Economy/bet.js
Normal 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] });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
304
command/Economy/blackjack.js
Normal file
304
command/Economy/blackjack.js
Normal 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
103
command/Economy/buy.js
Normal 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
43
command/Economy/daily.js
Normal 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
136
command/Economy/gift.js
Normal 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
72
command/Economy/give.js
Normal 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
120
command/Economy/gun.js
Normal 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: "SUB_COMMAND",
|
||||||
|
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: "SUB_COMMAND",
|
||||||
|
name: "list",
|
||||||
|
description: "See the information for the guns",
|
||||||
|
options: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "SUB_COMMAND",
|
||||||
|
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
67
command/Economy/inv.js
Normal 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` });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
44
command/Economy/multiplier.js
Normal file
44
command/Economy/multiplier.js
Normal 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] });
|
||||||
|
},
|
||||||
|
};
|
49
command/Economy/profile.js
Normal file
49
command/Economy/profile.js
Normal 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
47
command/Economy/rich.js
Normal 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
78
command/Economy/shop.js
Normal 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
124
command/Economy/slots.js
Normal 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
151
command/Economy/steal.js
Normal 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
37
command/Economy/work.js
Normal 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
23
command/Fun/ascii.js
Normal 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
21
command/Fun/dare.js
Normal 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(tnd.dare[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
97
command/Fun/hangman.js
Normal 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
20
command/Fun/say.js
Normal 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
42
command/Fun/ship.js
Normal 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
30
command/Fun/simprate.js
Normal 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
21
command/Fun/truth.js
Normal 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(tnd.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
29
command/Fun/wyr.js
Normal 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("🇧");
|
||||||
|
},
|
||||||
|
};
|
|
@ -1,50 +1,49 @@
|
||||||
const {
|
const { MessageEmbed } = require("discord.js");
|
||||||
Client,
|
module.exports = {
|
||||||
CommandInteraction,
|
name: "avatar",
|
||||||
EmbedBuilder,
|
description: "Show user's avatar in different formats",
|
||||||
ImageFormat,
|
type: "CHAT_INPUT",
|
||||||
} = require("discord.js");
|
usage: "{User}",
|
||||||
module.exports = {
|
category: "Information",
|
||||||
name: "avatar",
|
options: [
|
||||||
description: "Show user's avatar in different formats",
|
{
|
||||||
usage: "{User}",
|
type: 6,
|
||||||
category: "Information",
|
name: "user",
|
||||||
options: [
|
description: "The user you want to see",
|
||||||
{
|
required: false,
|
||||||
type: 6,
|
},
|
||||||
name: "user",
|
],
|
||||||
description: "The user you want to see",
|
run: async (client, interaction, args) => {
|
||||||
required: false,
|
const member =
|
||||||
},
|
interaction.guild.members.cache.get(args[0]) || interaction.member;
|
||||||
],
|
const embed = new MessageEmbed()
|
||||||
/**
|
.setAuthor(
|
||||||
*
|
member.user.tag,
|
||||||
* @param {Client} client
|
member.user.displayAvatarURL({ dynamic: true, size: 1024 })
|
||||||
* @param {CommandInteraction} interaction
|
)
|
||||||
* @param {String[]} args
|
.setColor(client.color)
|
||||||
*/ run: async (client, interaction, args) => {
|
.setTitle(`${member.user.username}'s Avatar`)
|
||||||
const member =
|
.setDescription(
|
||||||
interaction.guild.members.cache.get(args[0]) || interaction.member;
|
`\`Links:\` **[png](${member.user.displayAvatarURL({
|
||||||
const embed = new EmbedBuilder()
|
format: "png",
|
||||||
.setAuthor({
|
size: 2048,
|
||||||
name: member.user.tag,
|
})}) | [jpg](${member.user.displayAvatarURL({
|
||||||
iconURL: member.user.displayAvatarURL({ dynamic: true, size: 1024 }),
|
format: "jpg",
|
||||||
})
|
size: 2048,
|
||||||
.setColor(client.color)
|
})}) | [webp](${member.user.displayAvatarURL({
|
||||||
.setTitle(`${member.user.username}'s Avatar`)
|
format: "webp",
|
||||||
.setImage(
|
size: 2048,
|
||||||
member.user.displayAvatarURL({
|
})}) | [gif](${member.user.displayAvatarURL({
|
||||||
size: 2048,
|
format: "gif",
|
||||||
dynamic: true,
|
size: 2048,
|
||||||
format: "png",
|
})})**`
|
||||||
})
|
)
|
||||||
)
|
.setImage(
|
||||||
.setFooter({
|
member.user.avatarURL({ size: 2048, dynamic: true, format: "png" })
|
||||||
text: `Made by ${client.author}`,
|
)
|
||||||
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] });
|
},
|
||||||
},
|
};
|
||||||
};
|
|
||||||
|
|
|
@ -1,60 +1,79 @@
|
||||||
const { EmbedBuilder, version: djsversion } = require("discord.js");
|
const { MessageEmbed, version: djsversion } = require("discord.js");
|
||||||
const version = require("../../package.json").version;
|
const version = require("../../../package.json").version;
|
||||||
module.exports = {
|
const { utc } = require("moment");
|
||||||
name: "botinfo",
|
// const os = require("os");
|
||||||
description: "Check the info of the bot",
|
module.exports = {
|
||||||
category: "Information",
|
name: "botinfo",
|
||||||
run: async (client, interaction, args, utils) => {
|
description: "Check the info of the bot",
|
||||||
const embed = new EmbedBuilder()
|
category: "Information",
|
||||||
.setTitle(`NYX - CODM Gunsmith Bot`)
|
type: "CHAT_INPUT",
|
||||||
.setURL(utils.inviteLink(client.user.id))
|
run: async (client, interaction, args, utils) => {
|
||||||
.setThumbnail(
|
// const core = os.cpus()[0];
|
||||||
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
|
const embed = new MessageEmbed()
|
||||||
)
|
.setTitle(`NYX - CODM Gunsmith Bot`)
|
||||||
.setColor(client.color)
|
.setURL(
|
||||||
.addFields([
|
`https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=4231314550&scope=bot%20applications.commands`
|
||||||
{
|
)
|
||||||
name: `General`,
|
.setThumbnail(
|
||||||
value: `
|
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
|
||||||
<:nyx_owner:897418259433943120> Owner ❯ <@452076196419600394>
|
)
|
||||||
Bot ❯ ${client.user.tag}
|
.setColor(client.color)
|
||||||
Bot ID ❯ \`${client.user.id}\`
|
.addFields(
|
||||||
Created on ❯ \`${utils.botDate(
|
{
|
||||||
new Date(client.user.createdTimestamp)
|
name: `General`,
|
||||||
)}\``,
|
value: `
|
||||||
inline: true,
|
<:nyx_owner:897418259433943120> Owner ❯ <@452076196419600394>
|
||||||
},
|
Bot ❯ ${client.user.tag}
|
||||||
{
|
Bot ID ❯ \`${client.user.id}\`
|
||||||
name: `Bot Stats`,
|
Created on ❯ \`${utc(client.user.createdTimestamp).format(
|
||||||
value: `
|
"MMMM Do YYYY"
|
||||||
Servers ❯ ${client.guilds.cache.size.toLocaleString()}
|
)}\``,
|
||||||
Users ❯ ${client.guilds.cache
|
inline: true,
|
||||||
.reduce((a, b) => a + b.memberCount, 0)
|
},
|
||||||
.toLocaleString()}
|
{
|
||||||
Channels ❯ \`${client.channels.cache.size.toLocaleString()}\`
|
name: `Bot Stats`,
|
||||||
Commands ❯ \`${client.slashCommands.size}\`
|
value: `
|
||||||
`,
|
Servers ❯ ${client.guilds.cache.size.toLocaleString()}
|
||||||
inline: true,
|
Users ❯ ${client.guilds.cache
|
||||||
},
|
.reduce((a, b) => a + b.memberCount, 0)
|
||||||
{
|
.toLocaleString()}
|
||||||
name: `Platform`,
|
Channels ❯ \`${client.channels.cache.size.toLocaleString()}\`
|
||||||
value: `
|
Commands ❯ \`${client.commands.size}\`
|
||||||
NYX ❯ \`v${version}\`
|
`,
|
||||||
Discord.js ❯ \`v${djsversion}\`
|
inline: true,
|
||||||
Node.js ❯ \`${process.version}\``,
|
}
|
||||||
},
|
)
|
||||||
{
|
.addFields(
|
||||||
name: `**${client.author}**`,
|
{
|
||||||
value: `**Development Management**\n\u3000Ń1ght#0001\n\u3000Cat drinking a cat#0795\n\u3000mightyful#6536\n\u3000Thunder#2128\n\u3000mobo#9277\n
|
name: `Platform`,
|
||||||
**Research & Documentation**\n\u3000Thunder#2128\n
|
value: `
|
||||||
**Website**\n\u3000Chunchunmaru#8570`,
|
NYX ❯ \`v${version}\`
|
||||||
},
|
Discord.js ❯ \`v${djsversion}\`
|
||||||
])
|
Node.js ❯ \`${process.version}\``,
|
||||||
.setFooter({
|
}
|
||||||
text: `Made by ${client.author}`,
|
// Removed OS Info for troubleshooting.
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
//
|
||||||
})
|
// {
|
||||||
.setTimestamp();
|
// name: `Hardware`,
|
||||||
interaction.followUp({ embeds: [embed] });
|
// value: `
|
||||||
},
|
// Uptime:** ${utils.timer(os.uptime() * 1000, { long: true })}
|
||||||
};
|
// Platform:** ${process.platform}
|
||||||
|
// CPU:**
|
||||||
|
// \u3000 Cores: ${os.cpus().length}
|
||||||
|
// \u3000 Model: ${core.model}
|
||||||
|
// \u3000 Speed: ${core.speed}MHz
|
||||||
|
// **`,
|
||||||
|
// inline: true,
|
||||||
|
// }
|
||||||
|
)
|
||||||
|
.addFields({
|
||||||
|
name: `**${client.author}**`,
|
||||||
|
value: `**Development Management**\n\u3000Ń1ght#0001\n\u3000Cat drinking a cat#0795\n\u3000mightyful#6536\n\u3000Thunder#2128\n\u3000mobo#9277\n
|
||||||
|
**Research & Documentation**\n\u3000𝔔𝓻𝔦ค𝔁𝔖ค𝔦ӄø#0690\n\u3000Thunder#2128\n
|
||||||
|
**Website**\n\u3000Chunchunmaru#8570`,
|
||||||
|
})
|
||||||
|
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
|
||||||
|
.setTimestamp();
|
||||||
|
interaction.followUp({ embeds: [embed] });
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
|
@ -1,204 +1,200 @@
|
||||||
const {
|
const Discord = require("discord.js");
|
||||||
EmbedBuilder,
|
module.exports = {
|
||||||
Client,
|
name: "help",
|
||||||
CommandInteraction,
|
usage: "(Command/Category)",
|
||||||
ActionRowBuilder,
|
description: "Shows all available bot commands",
|
||||||
StringSelectMenuBuilder,
|
category: "Information",
|
||||||
ComponentType,
|
options: [
|
||||||
} = require("discord.js");
|
{
|
||||||
const Utils = require("../../util/functions/function");
|
type: 3,
|
||||||
module.exports = {
|
name: "command",
|
||||||
name: "help",
|
description: "The command you want to see",
|
||||||
usage: "(Command/Category)",
|
required: false,
|
||||||
description: "Shows all available bot commands",
|
},
|
||||||
category: "Information",
|
],
|
||||||
options: [
|
run: async (client, interaction, args, utils) => {
|
||||||
{
|
if (!args[0]) {
|
||||||
type: 3,
|
await interaction.deleteReply();
|
||||||
name: "command",
|
const emoji = {
|
||||||
description: "The command you want to see",
|
CODM: "<a:codm:897030768793104385>",
|
||||||
required: false,
|
Config: "<a:config:896990033561669762>",
|
||||||
},
|
Economy: client.currency,
|
||||||
],
|
Fun: "<a:fun:896889821816053790>",
|
||||||
/**
|
Moderation: "<:discordmod:897364105730617364>",
|
||||||
*
|
Information: "<a:information:894962394932064346>",
|
||||||
* @param {Client} client
|
Utilities: "<a:utilites:897233087941988392>",
|
||||||
* @param {CommandInteraction} interaction
|
Music: "<a:music:897017864085712936>",
|
||||||
* @param {String[]} args
|
Giveaway: "<a:confetti:896763534682226758>",
|
||||||
* @param {Utils} utils
|
NSFW: "🍑",
|
||||||
*/
|
};
|
||||||
run: async (client, interaction, args, utils) => {
|
const directories = [
|
||||||
if (!args[0]) {
|
...new Set(client.slashCommands.map(cmd => cmd.directory)),
|
||||||
await interaction.deleteReply();
|
];
|
||||||
const emoji = {
|
const categories = directories.map(dir => {
|
||||||
CODM: "<a:codm:897030768793104385>",
|
if (dir == "Owner") return;
|
||||||
APEX: "🎆",
|
const getCmds = client.slashCommands
|
||||||
Config: "<a:config:896990033561669762>",
|
.filter(c => c.directory == dir)
|
||||||
Information: "<a:information:894962394932064346>",
|
.map(cmd => {
|
||||||
Utilities: "<a:utilites:897233087941988392>",
|
return {
|
||||||
};
|
name: cmd.name || "No command name",
|
||||||
const directories = [
|
};
|
||||||
...new Set(client.slashCommands.map(cmd => cmd.directory)),
|
});
|
||||||
];
|
return {
|
||||||
const categories = directories.map(dir => {
|
directory: dir,
|
||||||
if (dir == "Owner") return;
|
commands: getCmds,
|
||||||
const getCmds = client.slashCommands
|
};
|
||||||
.filter(c => c.directory == dir)
|
});
|
||||||
.map(cmd => {
|
const embed = new Discord.MessageEmbed()
|
||||||
return {
|
.setTitle(`**NYX's Commands**`)
|
||||||
name: cmd.name || "No command name",
|
.setDescription(`Please choose a category in the dropdown menu`)
|
||||||
};
|
.setColor(client.color)
|
||||||
});
|
.setTimestamp()
|
||||||
return {
|
.addFields(
|
||||||
directory: dir,
|
{
|
||||||
commands: getCmds,
|
name: ":link: **Invite Me**",
|
||||||
};
|
value: `[Click Here](https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=4231314550&scope=bot%20applications.commands)`,
|
||||||
});
|
inline: true,
|
||||||
const embed = new EmbedBuilder()
|
},
|
||||||
.setTitle(`**NYX's Commands**`)
|
{
|
||||||
.setDescription(`Please choose a category in the dropdown menu`)
|
name: "<:support1:867093614403256350> **Need Help ?**",
|
||||||
.setColor(client.color)
|
value: `[Support Server](https://discord.gg/SbQHChmGcp)`,
|
||||||
.setTimestamp()
|
inline: true,
|
||||||
.addFields(
|
},
|
||||||
{
|
{
|
||||||
name: ":link: **Invite Me**",
|
name: "<:YouTube:841186450497339412> **Video Guide**",
|
||||||
value: `[Click Here](${utils.inviteLink(client.user.id)})`,
|
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "<:support1:867093614403256350> **Need Help ?**",
|
name: `<:nyx_description:897379659665264650> Documentation`,
|
||||||
value: `[Support Server](${client.invite})`,
|
value: `[Click here](${client.docs})`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "<:YouTube:841186450497339412> **Video Guide**",
|
name: "<a:booster:896527475063025704> **Premium**",
|
||||||
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
|
value: `You can either boost support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team.`,
|
||||||
inline: true,
|
inline: false,
|
||||||
},
|
}
|
||||||
{
|
)
|
||||||
name: `<:nyx_description:897379659665264650> Documentation`,
|
.setURL(client.docs)
|
||||||
value: `[Click here](${client.docs})`,
|
.setThumbnail(
|
||||||
inline: true,
|
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
|
||||||
},
|
)
|
||||||
{
|
.setFooter(
|
||||||
name: "<a:booster:896527475063025704> **Premium**",
|
`Requested by ${interaction.user.tag}`,
|
||||||
value: `You can either boost support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team.`,
|
interaction.user.displayAvatarURL({ dynamic: true })
|
||||||
inline: false,
|
);
|
||||||
}
|
const components = state => [
|
||||||
)
|
new Discord.MessageActionRow().addComponents(
|
||||||
.setURL(client.docs)
|
new Discord.MessageSelectMenu()
|
||||||
.setThumbnail(
|
.setCustomId("help-menu")
|
||||||
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
|
.setPlaceholder(`Please select a category`)
|
||||||
)
|
.setDisabled(state)
|
||||||
.setFooter({
|
.addOptions(
|
||||||
text: `Requested by ${interaction.user.tag}`,
|
categories.map(cmd => {
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
return {
|
||||||
});
|
label: cmd.directory,
|
||||||
const components = state => [
|
value: cmd.directory,
|
||||||
new ActionRowBuilder().addComponents(
|
description: `Commands from ${cmd.directory} category`,
|
||||||
new StringSelectMenuBuilder()
|
emoji: emoji[cmd.directory] || null,
|
||||||
.setCustomId("help-menu")
|
};
|
||||||
.setPlaceholder(`Please select a category`)
|
})
|
||||||
.setDisabled(state)
|
)
|
||||||
.addOptions(
|
),
|
||||||
categories.map(cmd => {
|
];
|
||||||
return {
|
|
||||||
label: cmd.directory,
|
const msg = await interaction.channel.send({
|
||||||
value: cmd.directory,
|
embeds: [embed],
|
||||||
description: `Commands from ${cmd.directory} category`,
|
components: components(false),
|
||||||
emoji: emoji[cmd.directory] || null,
|
});
|
||||||
};
|
const filter = m => m.user.id === interaction.user.id;
|
||||||
})
|
const collector = interaction.channel.createMessageComponentCollector({
|
||||||
)
|
filter,
|
||||||
),
|
componentType: "SELECT_MENU",
|
||||||
];
|
time: 60000,
|
||||||
|
});
|
||||||
const msg = await interaction.channel.send({
|
collector.on("collect", async interaction => {
|
||||||
embeds: [embed],
|
const [directory] = interaction.values;
|
||||||
components: components(false),
|
const category = categories.find(u => u.directory === directory);
|
||||||
});
|
const newembed = new Discord.MessageEmbed()
|
||||||
const filter = m => m.user.id === interaction.user.id;
|
.setTitle(
|
||||||
const collector = interaction.channel.createMessageComponentCollector({
|
`${emoji[directory]} ${directory} Commands ${emoji[directory]}`
|
||||||
filter,
|
)
|
||||||
componentType: ComponentType.StringSelect,
|
.setTimestamp()
|
||||||
time: 60000,
|
.setColor(client.color)
|
||||||
});
|
.setFooter(`Please use /help (Command Name) for more details`)
|
||||||
collector.on("collect", async interaction => {
|
.setDescription(
|
||||||
const [directory] = interaction.values;
|
category.commands
|
||||||
const category = categories.find(u => u.directory === directory);
|
.map(cmd => {
|
||||||
const newembed = new EmbedBuilder()
|
return [`\`${cmd.name}\``];
|
||||||
.setTitle(
|
})
|
||||||
`${emoji[directory]} ${directory} Commands ${emoji[directory]}`
|
.join(", ")
|
||||||
)
|
);
|
||||||
.setTimestamp()
|
interaction.reply({ embeds: [newembed] });
|
||||||
.setColor(client.color)
|
});
|
||||||
.setFooter({
|
collector.on("end", () => msg.edit({ components: components(true) }));
|
||||||
text: `Please use /help (Command Name) for more details`,
|
} else {
|
||||||
})
|
const command = client.slashCommands.get(args[0].toLowerCase());
|
||||||
.setDescription(
|
if (!command) {
|
||||||
category.commands
|
interaction.followUp({
|
||||||
.map(cmd => {
|
content: `There isn't any command or category named "${args[0]}"`,
|
||||||
return [`\`${cmd.name}\``];
|
});
|
||||||
})
|
} else {
|
||||||
.join(", ")
|
if (command.UserPerms && Array.isArray(command.UserPerms)) {
|
||||||
);
|
UserPermissions = command.UserPerms;
|
||||||
interaction.reply({ embeds: [newembed] });
|
} else {
|
||||||
});
|
UserPermissions = [command.UserPerms ? command.UserPerms : ""];
|
||||||
collector.on("end", () => msg.edit({ components: components(true) }));
|
}
|
||||||
} else {
|
if (command.BotPerms && Array.isArray(command.BotPerms)) {
|
||||||
const command = client.slashCommands.get(args[0].toLowerCase());
|
BotPermissions = command.BotPerms;
|
||||||
if (!command) {
|
} else {
|
||||||
interaction.editReply({
|
BotPermissions = [command.BotPerms ? command.BotPerms : ""];
|
||||||
content: `There isn't any command named "${args[0]}"`,
|
}
|
||||||
});
|
const BotPerms = BotPermissions.map(x =>
|
||||||
} else {
|
x
|
||||||
if (command.UserPerms && Array.isArray(command.UserPerms)) {
|
.split("_")
|
||||||
UserPermissions = command.UserPerms;
|
.map(y => y[0] + y.substring(1, y.length).toLowerCase())
|
||||||
} else {
|
.join(" ")
|
||||||
UserPermissions = [command.UserPerms ? command.UserPerms : ""];
|
).join(", ");
|
||||||
}
|
const UserPerms = UserPermissions.map(x =>
|
||||||
const fields = [];
|
x
|
||||||
const embed = new EmbedBuilder()
|
.split("_")
|
||||||
.setTitle(`"${command.name}" command details`)
|
.map(y => y[0] + y.substring(1, y.length).toLowerCase())
|
||||||
.addFields([
|
.join(" ")
|
||||||
{
|
).join(", ");
|
||||||
name: "**Command**:",
|
const embed = new Discord.MessageEmbed()
|
||||||
value: command.name ? `\`${command.name}\`` : "N/A",
|
.setTitle(`"${command.name}" command details`)
|
||||||
},
|
.addField(
|
||||||
]);
|
"**Command**:",
|
||||||
if (command.usage)
|
command.name ? `\`${command.name}\`` : "N/A"
|
||||||
fields.push({
|
);
|
||||||
name: "**Usage**:",
|
if (command.usage) {
|
||||||
value: `\`/${command.name} ${command.usage}\``,
|
embed.addField("**Usage**:", `\`/${command.name} ${command.usage}\``);
|
||||||
});
|
} else {
|
||||||
else
|
embed.addField("**Usage**:", `\`/${command.name}\``);
|
||||||
fields.push({
|
}
|
||||||
name: "**Usage**:",
|
if (command.description) {
|
||||||
value: `\`/${command.name}\``,
|
embed.addField("**Description**:", command.description);
|
||||||
});
|
}
|
||||||
|
if (command.timeout) {
|
||||||
if (command.description)
|
embed.addField("**Cooldown**:", utils.timer(command.timeout));
|
||||||
fields.push({
|
}
|
||||||
name: "**Description**:",
|
if (command.UserPerms) {
|
||||||
value: command.description,
|
embed.addField("**Required User Permission**:", UserPerms);
|
||||||
});
|
}
|
||||||
|
if (command.BotPerms) {
|
||||||
if (command.timeout)
|
embed.addField("**Required Bot Permission**:", BotPerms);
|
||||||
fields.push({
|
}
|
||||||
name: "**Cooldown**:",
|
embed
|
||||||
value: utils.timer(command.timeout),
|
.setFooter(
|
||||||
});
|
`Requested by ${interaction.user.tag}`,
|
||||||
embed
|
interaction.user.displayAvatarURL({ dynamic: true })
|
||||||
.setFooter({
|
)
|
||||||
text: `Requested by ${interaction.user.tag}`,
|
.setTimestamp()
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
.setURL(client.web)
|
||||||
})
|
.setColor(client.color);
|
||||||
.setTimestamp()
|
interaction.followUp({ embeds: [embed] });
|
||||||
.addFields(fields)
|
}
|
||||||
.setURL(client.web)
|
}
|
||||||
.setColor(client.color);
|
},
|
||||||
interaction.followUp({ embeds: [embed] });
|
};
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
|
@ -1,34 +1,32 @@
|
||||||
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",
|
||||||
category: "Information",
|
type: "CHAT_INPUT",
|
||||||
run: async (client, interaction, args) => {
|
category: "Information",
|
||||||
const msg = await interaction.channel.send(`Pinging...`);
|
run: async (client, interaction, args) => {
|
||||||
const messageping = msg.createdTimestamp - interaction.createdTimestamp;
|
const msg = await interaction.channel.send(`Pinging...`);
|
||||||
await msg.delete();
|
const messageping = msg.createdTimestamp - interaction.createdTimestamp;
|
||||||
const Embed = new EmbedBuilder()
|
await msg.delete();
|
||||||
.setTitle("<a:pong:897383314405605436> Pong!")
|
const Embed = new MessageEmbed()
|
||||||
.setAuthor({
|
.setTitle("<a:pong:897383314405605436> Pong!")
|
||||||
name: interaction.user.username,
|
.setAuthor(
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
`${interaction.user.username}`,
|
||||||
})
|
interaction.user.displayAvatarURL()
|
||||||
.setDescription(
|
)
|
||||||
`\n 📨 • **Message Latency** \`${Math.floor(messageping)}ms\`
|
.setDescription(
|
||||||
\n🛰️ • **Bot Latency** \`${Math.round(client.ws.ping)}ms\``
|
`\n 📨 • **Message Latency** \`${Math.floor(messageping)}ms\`
|
||||||
)
|
\n🛰️ • **Bot Latency** \`${Math.round(client.ws.ping)}ms\``
|
||||||
.setFooter({
|
)
|
||||||
text: `Made by ${client.author}`,
|
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
.setTimestamp()
|
||||||
})
|
.setColor(
|
||||||
.setTimestamp()
|
messageping < 350
|
||||||
.setColor(
|
? "GREEN"
|
||||||
messageping < 350
|
: messageping < 500 && messageping > 350
|
||||||
? "#008000"
|
? "YELLOW"
|
||||||
: messageping < 500 && messageping > 350
|
: "RED"
|
||||||
? "#ffff31"
|
);
|
||||||
: "#ff0000"
|
interaction.followUp({ embeds: [Embed] });
|
||||||
);
|
},
|
||||||
interaction.followUp({ embeds: [Embed] });
|
};
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
|
@ -1,89 +1,132 @@
|
||||||
const { Client, CommandInteraction, EmbedBuilder } = require("discord.js");
|
const { MessageEmbed } = require("discord.js");
|
||||||
const Utils = require("../../util/functions/function");
|
const moment = require("moment");
|
||||||
module.exports = {
|
|
||||||
name: "userinfo",
|
module.exports = {
|
||||||
description: "Check the info of a user",
|
name: "userinfo",
|
||||||
usage: "{User}",
|
description: "Check the info of a user",
|
||||||
category: "Information",
|
usage: "{User}",
|
||||||
options: [
|
category: "Information",
|
||||||
{
|
options: [
|
||||||
type: 6,
|
{
|
||||||
name: "user",
|
type: 6,
|
||||||
description: "The user you want to see",
|
name: "user",
|
||||||
required: false,
|
description: "The user you want to see",
|
||||||
},
|
required: false,
|
||||||
],
|
},
|
||||||
/**
|
],
|
||||||
*
|
type: "CHAT_INPUT",
|
||||||
* @param {Client} client
|
run: async (client, interaction, args, utils) => {
|
||||||
* @param {CommandInteraction} interaction
|
const member =
|
||||||
* @param {String[]} args
|
interaction.guild.members.cache.get(args[0]) || interaction.member;
|
||||||
* @param {Utils} utils
|
const flags = {
|
||||||
*/
|
DISCORD_EMPLOYEE: "Discord Staff<:staff:840231971526803467>",
|
||||||
run: async (client, interaction, args, utils) => {
|
PARTNERED_SERVER_OWNER:
|
||||||
const member =
|
"Partnered Server Owner<:partner:840231939944480829>",
|
||||||
interaction.guild.members.cache.get(args[0]) || interaction.member;
|
BUGHUNTER_LEVEL_1: "Discord Bug Hunter<:bughunter:840231967600803920>",
|
||||||
|
BUGHUNTER_LEVEL_2: "Discord Bug Hunter<:bughunterlv2:840231970017771571>",
|
||||||
const x = Date.now() - member.user.createdAt;
|
HYPESQUAD_EVENTS: "HypeSquad Events<:HypeSquad:840231908599922721>",
|
||||||
const y =
|
HOUSE_BRAVERY: "HypeSquad Bravery<:bravery:840231941974655007>",
|
||||||
Date.now() - interaction.guild.members.cache.get(member.id).joinedAt;
|
HOUSE_BRILLIANCE: "HypeSquad Brilliance<:brilliance:840231943764443136>",
|
||||||
const created = Math.floor(x / 86400000);
|
HOUSE_BALANCE: "HypeSquad Balance<:balance:840231925876523018>",
|
||||||
const joined = Math.floor(y / 86400000);
|
EARLY_SUPPORTER: "Early Supporter<:earlysupporter:840231983216984085>",
|
||||||
const nickname = member.nickname || "None";
|
TEAM_USER: "Team User",
|
||||||
const roles = member.roles.cache
|
SYSTEM: "System",
|
||||||
.filter(r => r.id != interaction.guild.id)
|
VERIFIED_BOT: "Verified Bot<:VerifiedBot:840231982054375425>",
|
||||||
.sort((a, b) => b.position - a.position)
|
EARLY_VERIFIED_BOT_DEVELOPER:
|
||||||
.map(role => role.toString());
|
"Early Verified Bot Developer<:discord_bot_dev:840231906200387666>",
|
||||||
const createDateFormatted = utils.parseDate(
|
DISCORD_CERTIFIED_MODERATOR: "Discord Certified Moderator",
|
||||||
new Date(member.user.createdAt)
|
};
|
||||||
);
|
// let status;
|
||||||
const joinDateFormatted = utils.parseDate(new Date(member.joinedAt));
|
// switch (member.presence.status) {
|
||||||
const embed = new EmbedBuilder()
|
// case "online":
|
||||||
.setAuthor({
|
// status = "<:online:840231921123721237>Online";
|
||||||
name: member.user.tag,
|
// break;
|
||||||
iconURL: member.user.displayAvatarURL({ dynamic: true, size: 4096 }),
|
// case "dnd":
|
||||||
})
|
// status = "<:do_not_disturb:840231907715448842>Do Not Disturb";
|
||||||
.setTimestamp()
|
// break;
|
||||||
.setColor(member.displayHexColor || client.color)
|
// case "idle":
|
||||||
.setURL(client.web)
|
// status = "<:idle:840231935485149184>Idle";
|
||||||
.setFooter({
|
// break;
|
||||||
text: `Made by ${client.author}`,
|
// case "offline":
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true, size: 4096 }),
|
// status = "<:offline:840231954897305620>Offline";
|
||||||
})
|
// break;
|
||||||
.setThumbnail(member.user.displayAvatarURL({ dynamic: true, size: 4096 }))
|
// }
|
||||||
.addFields([
|
const x = Date.now() - member.user.createdAt;
|
||||||
{
|
const y =
|
||||||
name: "User",
|
Date.now() - interaction.guild.members.cache.get(member.id).joinedAt;
|
||||||
value: `**❯ User Tag:** ${member.user.tag} ${client.owners.includes(member.id) ? client.dev : ""}
|
const created = Math.floor(x / 86400000);
|
||||||
**❯ Username:** ${member.user.username}
|
const joined = Math.floor(y / 86400000);
|
||||||
**❯ Discriminator:** ${member.user.discriminator}
|
const nickname =
|
||||||
**❯ Nickname:** ${nickname}
|
member.nickname !== undefined && member.nickname !== null
|
||||||
**❯ User ID:** ${member.id}
|
? member.nickname
|
||||||
**❯ Avatar:** [Link to avatar](${member.user.displayAvatarURL({
|
: "None";
|
||||||
dynamic: true,
|
const roles = member.roles.cache
|
||||||
size: 2048,
|
.filter(r => r.id != interaction.guild.id)
|
||||||
})})
|
.sort((a, b) => b.position - a.position)
|
||||||
**❯ Time Created:** ${createDateFormatted} \nSince ${created} day${created <= 1 ? "" : "s"} ago
|
.map(role => role.toString())
|
||||||
\u200b`,
|
.slice(0, -1);
|
||||||
},
|
const userFlags = member.user.flags.toArray();
|
||||||
{
|
const createdate = moment(member.user.createdAt).format(
|
||||||
name: "Member",
|
"dddd, MMMM Do YYYY, HH:mm:ss"
|
||||||
value: `**❯ Highest Role:** ${
|
);
|
||||||
member.roles.highest.id === interaction.guild.id
|
const joindate = moment(member.joinedAt).format(
|
||||||
? "None"
|
"dddd, MMMM Do YYYY, HH:mm:ss"
|
||||||
: member.roles.highest.name
|
);
|
||||||
}
|
// let activities;
|
||||||
**❯ Server Join Date:** ${joinDateFormatted} \nSince ${joined} day${joined <= 1 ? "" : "s"} ago
|
// if (member.presence.activities[0] && member.presence.activities[1]) {
|
||||||
**❯ Roles [${roles.length}]:** ${
|
// activities = member.presence.activities[1].name;
|
||||||
roles.length < 10 && roles.length > 0
|
// } else if (
|
||||||
? roles.join(" **|** ")
|
// member.presence.activities[0] &&
|
||||||
: roles.length > 0
|
// !member.presence.activities[1]
|
||||||
? utils.trimArray(roles)
|
// ) {
|
||||||
: "None"
|
// activities = "None";
|
||||||
}
|
// } else activities = "None";
|
||||||
\u200b`,
|
const embed = new MessageEmbed()
|
||||||
},
|
.setAuthor(
|
||||||
]);
|
member.user.tag,
|
||||||
interaction.followUp({ embeds: [embed] });
|
member.user.displayAvatarURL({ dynamic: true, size: 2048 })
|
||||||
},
|
)
|
||||||
};
|
.setTimestamp()
|
||||||
|
.setColor(member.displayHexColor || client.color)
|
||||||
|
.setURL(client.web)
|
||||||
|
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
|
||||||
|
.setThumbnail(member.user.displayAvatarURL({ dynamic: true, size: 512 }))
|
||||||
|
.setColor(member.displayHexColor || client.color)
|
||||||
|
.addField(
|
||||||
|
"User",
|
||||||
|
`**❯ Username:** ${member.user.username}
|
||||||
|
**❯ Discriminator:** ${member.user.discriminator}
|
||||||
|
**❯ Nickname:** ${nickname}
|
||||||
|
**❯ User ID:** ${member.id}
|
||||||
|
**❯ Badge:** ${
|
||||||
|
userFlags.length
|
||||||
|
? userFlags.map(flag => flags[flag]).join(" **|** ")
|
||||||
|
: "None"
|
||||||
|
}
|
||||||
|
**❯ Avatar:** [Link to avatar](${member.user.displayAvatarURL({
|
||||||
|
dynamic: true,
|
||||||
|
size: 2048,
|
||||||
|
})})
|
||||||
|
**❯ Time Created:** ${createdate} \nSince ${created} day(s) ago
|
||||||
|
\u200b`
|
||||||
|
) //* *❯ Status:** ${status}* *❯ Game:** ${activities}
|
||||||
|
.addField(
|
||||||
|
"Member",
|
||||||
|
`**❯ Highest Role:** ${
|
||||||
|
member.roles.highest.id === interaction.guild.id
|
||||||
|
? "None"
|
||||||
|
: member.roles.highest.name
|
||||||
|
}
|
||||||
|
**❯ Server Join Date:** ${joindate} \nSince ${joined} day(s) ago
|
||||||
|
**❯ Roles [${roles.length}]:** ${
|
||||||
|
roles.length < 10
|
||||||
|
? roles.join(" **|** ")
|
||||||
|
: roles.length > 10
|
||||||
|
? utils.trimArray(roles)
|
||||||
|
: "None"
|
||||||
|
}
|
||||||
|
\u200b`
|
||||||
|
);
|
||||||
|
interaction.followUp({ embeds: [embed] });
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
106
command/Moderation/ban.js
Normal file
106
command/Moderation/ban.js
Normal 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}` });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
58
command/Moderation/kick.js
Normal file
58
command/Moderation/kick.js
Normal 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}` });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
53
command/Moderation/lock.js
Normal file
53
command/Moderation/lock.js
Normal 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
119
command/Moderation/mute.js
Normal 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}` });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
67
command/Moderation/nuke.js
Normal file
67
command/Moderation/nuke.js
Normal 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}` });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
85
command/Moderation/purge.js
Normal file
85
command/Moderation/purge.js
Normal 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}` });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
59
command/Moderation/role.js
Normal file
59
command/Moderation/role.js
Normal 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}` });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
102
command/Moderation/slowmode.js
Normal file
102
command/Moderation/slowmode.js
Normal 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] });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
34
command/Moderation/unban.js
Normal file
34
command/Moderation/unban.js
Normal 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}` });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
39
command/Moderation/unmute.js
Normal file
39
command/Moderation/unmute.js
Normal 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
273
command/Moderation/warn.js
Normal 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: "SUB_COMMAND",
|
||||||
|
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: "SUB_COMMAND",
|
||||||
|
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: "SUB_COMMAND",
|
||||||
|
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: "SUB_COMMAND",
|
||||||
|
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}` });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
53
command/Music/bassboost.js
Normal file
53
command/Music/bassboost.js
Normal 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]}\``
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
24
command/Music/clearqueue.js
Normal file
24
command/Music/clearqueue.js
Normal 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!**");
|
||||||
|
},
|
||||||
|
};
|
25
command/Music/disconnect.js
Normal file
25
command/Music/disconnect.js
Normal 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
52
command/Music/grab.js
Normal 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
53
command/Music/loop.js
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
module.exports = {
|
||||||
|
name: "loop",
|
||||||
|
description: "Music loop",
|
||||||
|
category: "Music",
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
type: "SUB_COMMAND",
|
||||||
|
name: "track",
|
||||||
|
description: "Loop the track",
|
||||||
|
options: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "SUB_COMMAND",
|
||||||
|
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
50
command/Music/move.js
Normal 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}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
64
command/Music/nowplaying.js
Normal file
64
command/Music/nowplaying.js
Normal 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
29
command/Music/pause.js
Normal 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
145
command/Music/play.js
Normal 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
114
command/Music/queue.js
Normal 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
42
command/Music/remove.js
Normal 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
28
command/Music/resume.js
Normal 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
53
command/Music/seek.js
Normal 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
27
command/Music/shuffle.js
Normal 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
38
command/Music/skip.js
Normal 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
37
command/Music/volume.js
Normal 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}\``
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
|
@ -1,50 +1,50 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { MessageEmbed } = require("discord.js");
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "accept",
|
name: "accept",
|
||||||
category: "Owner",
|
category: "Owner",
|
||||||
usage: "(Message)",
|
usage: "(Message)",
|
||||||
description: "Accept a suggestion",
|
description: "Accept a suggestion",
|
||||||
Owner: true,
|
Owner: true,
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "messageid",
|
name: "messageid",
|
||||||
description: "The message ID to accept",
|
description: "The message ID to accept",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "query",
|
name: "query",
|
||||||
description: "The accept query",
|
description: "The accept query",
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction, args) => {
|
run: async (client, interaction, args) => {
|
||||||
const MessageID = args[0];
|
const MessageID = args[0];
|
||||||
const acceptQuery =
|
const acceptQuery =
|
||||||
args.slice(1).join(" ") || `They didn't leave any message.`;
|
args.slice(1).join(" ") || `They didn't leave any message.`;
|
||||||
try {
|
try {
|
||||||
const suggestionChannel = interaction.guild.channels.cache.get(
|
const suggestionChannel = interaction.guild.channels.cache.get(
|
||||||
client.config.Report
|
client.config.Report
|
||||||
);
|
);
|
||||||
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(
|
||||||
u => u.tag === data.author.name
|
u => u.tag === data.author.name
|
||||||
);
|
);
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: "<a:nyx_checkmark:897240322411724841> Suggestion Accepted",
|
content: "<a:nyx_checkmark:897240322411724841> Suggestion Accepted",
|
||||||
});
|
});
|
||||||
user.send({ embeds: [acceptEmbed] });
|
user.send({ embeds: [acceptEmbed] });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
interaction.followUp({ content: "That suggestion doesn't exist" });
|
interaction.followUp({ content: "That suggestion doesn't exist" });
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
68
command/Owner/add.js
Normal file
68
command/Owner/add.js
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
module.exports = {
|
||||||
|
name: "economy",
|
||||||
|
category: "Owner",
|
||||||
|
description: "Add/Remove coins from someone",
|
||||||
|
Owner: true,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
type: "SUB_COMMAND",
|
||||||
|
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: "SUB_COMMAND",
|
||||||
|
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`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
|
@ -1,65 +1,59 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "blacklist",
|
name: "blacklist",
|
||||||
category: "Owner",
|
category: "Owner",
|
||||||
usage: "(User) (Toggle) (Reason)",
|
usage: "(User) (Toggle) (Reason)",
|
||||||
description: "Manage Blacklisted Users",
|
description: "Manage Blacklisted Users",
|
||||||
Owner: true,
|
Owner: true,
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 6,
|
type: 6,
|
||||||
name: "user",
|
name: "user",
|
||||||
description: "The user to blacklist/whitelist",
|
description: "The user to blacklist/whitelist",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 5,
|
type: 5,
|
||||||
name: "blacklist",
|
name: "blacklist",
|
||||||
description: "Whether to blacklist or whitelist",
|
description: "Whether to blacklist or whitelist",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "reason",
|
name: "reason",
|
||||||
description: "The reason to blacklist",
|
description: "The reason to blacklist",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction) => {
|
run: async (client, interaction) => {
|
||||||
const user = interaction.options.getUser("user");
|
const user = interaction.options.getUser("user");
|
||||||
const toggle = interaction.options.getBoolean("blacklist");
|
const toggle = interaction.options.getBoolean("blacklist");
|
||||||
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"
|
||||||
)
|
)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**User:** ${user.user.tag} \`(${user.id})\`\n**Reason:** ${reason} \n**Blacklisted by:** ${interaction.member}`
|
`**User:** ${user.user.tag} \`(${user.id})\`\n**Reason:** ${reason} \n**Blacklisted 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}`,
|
.setTimestamp();
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
interaction.followUp({ embeds: [embed] });
|
||||||
})
|
} else {
|
||||||
.setTimestamp();
|
await client.data.BK(user.id, toggle, reason);
|
||||||
interaction.followUp({ embeds: [embed] });
|
const embed = new MessageEmbed()
|
||||||
} else {
|
.setTitle("<a:nyx_checkmark:897240322411724841> Removed From Blacklist")
|
||||||
await client.data.BK(user.id, toggle, reason);
|
.setDescription(
|
||||||
const embed = new EmbedBuilder()
|
`**User:** ${user.user.tag} \`(${user.id})\`\n**Reason:** ${reason} \n**Whitelisted by:** ${interaction.member}`
|
||||||
.setTitle("<a:nyx_checkmark:897240322411724841> Removed From Blacklist")
|
)
|
||||||
.setDescription(
|
.setURL(client.web)
|
||||||
`**User:** ${user.user.tag} \`(${user.id})\`\n**Reason:** ${reason} \n**Whitelisted by:** ${interaction.member}`
|
.setColor(client.color)
|
||||||
)
|
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
|
||||||
.setURL(client.web)
|
.setTimestamp();
|
||||||
.setColor(client.color)
|
interaction.followUp({ embeds: [embed] });
|
||||||
.setFooter({
|
}
|
||||||
text: `Made by ${client.author}`,
|
},
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
};
|
||||||
})
|
|
||||||
.setTimestamp();
|
|
||||||
interaction.followUp({ embeds: [embed] });
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
|
@ -1,49 +1,49 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { MessageEmbed } = require("discord.js");
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "deny",
|
name: "deny",
|
||||||
category: "Owner",
|
category: "Owner",
|
||||||
usage: "(Message)",
|
usage: "(Message)",
|
||||||
description: "Deny a suggestion",
|
description: "Deny a suggestion",
|
||||||
Owner: true,
|
Owner: true,
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "messageid",
|
name: "messageid",
|
||||||
description: "The message ID to deny",
|
description: "The message ID to deny",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "query",
|
name: "query",
|
||||||
description: "The deny query",
|
description: "The deny query",
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction, args) => {
|
run: async (client, interaction, args) => {
|
||||||
const MessageID = args[0];
|
const MessageID = args[0];
|
||||||
const denyQuery = args[1] || `They didn't leave any message.`;
|
const denyQuery = args[1] || `They didn't leave any message.`;
|
||||||
try {
|
try {
|
||||||
const suggestionChannel = interaction.guild.channels.cache.get(
|
const suggestionChannel = interaction.guild.channels.cache.get(
|
||||||
client.config.Report
|
client.config.Report
|
||||||
);
|
);
|
||||||
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(
|
||||||
u => u.tag === data.author.name
|
u => u.tag === data.author.name
|
||||||
);
|
);
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: "<a:nyx_cross:897244999211696198> Suggestion Denied",
|
content: "<a:nyx_cross:897244999211696198> Suggestion Denied",
|
||||||
});
|
});
|
||||||
user.send({ embeds: [denyEmbed] });
|
user.send({ embeds: [denyEmbed] });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
interaction.followUp({ content: "That suggestion doesn't exist" });
|
interaction.followUp({ content: "That suggestion doesn't exist" });
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,33 +1,33 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "dm",
|
name: "dm",
|
||||||
category: "Owner",
|
category: "Owner",
|
||||||
usage: "(User) (Message)",
|
usage: "(User) (Message)",
|
||||||
description: "DM a user",
|
description: "DM a user",
|
||||||
Owner: true,
|
Owner: true,
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 6,
|
type: 6,
|
||||||
name: "user",
|
name: "user",
|
||||||
description: "The user you want to send",
|
description: "The user you want to send",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "msg",
|
name: "msg",
|
||||||
description: "The message you want to send",
|
description: "The message you want to send",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction, args) => {
|
run: async (client, interaction, args) => {
|
||||||
const user = interaction.options.getUser("user");
|
const user = interaction.options.getUser("user");
|
||||||
if (!user) return interaction.followUp("User?");
|
if (!user) return interaction.followUp("User?");
|
||||||
if (!args[1]) return interaction.followUp("Message?");
|
if (!args[1]) return interaction.followUp("Message?");
|
||||||
try {
|
try {
|
||||||
await user
|
await user
|
||||||
.send({ content: args[1] })
|
.send({ content: args[1] })
|
||||||
.then(() => interaction.followUp({ content: `Sent message` }));
|
.then(() => interaction.followUp({ content: `Sent message` }));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
interaction.user.send({ content: "That user can't be dmed" });
|
interaction.user.send({ content: "That user can't be dmed" });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,129 +1,131 @@
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "eval",
|
name: "eval",
|
||||||
category: "Owner",
|
category: "Owner",
|
||||||
usage: "(Code)",
|
usage: "(Code)",
|
||||||
Owner: true,
|
Owner: true,
|
||||||
description: "Eval something",
|
description: "Eval something",
|
||||||
|
type: "CHAT_INPUT",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "code",
|
name: "code",
|
||||||
description: "The code to eval",
|
description: "The code to eval",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction, args, utils) => {
|
run: async (client, interaction, args, utils) => {
|
||||||
const code = args[0];
|
const code = args[0];
|
||||||
function CheckFilter(object) {
|
function CheckFilter(object) {
|
||||||
if (typeof object === "string") {
|
if (typeof object === "string") {
|
||||||
object = object.replace(
|
object = object.replace(
|
||||||
new RegExp(`${client.token || process.env.TOKEN}`, "gi"),
|
new RegExp(`${client.token || process.env.TOKEN}`, "gi"),
|
||||||
"Cannot eval Token"
|
"Cannot eval Token"
|
||||||
);
|
);
|
||||||
} else if (typeof object === "object") {
|
} else if (typeof object === "object") {
|
||||||
if (Array.isArray(object)) {
|
if (Array.isArray(object)) {
|
||||||
for (let i = 0; i < object.length; i++) {
|
for (let i = 0; i < object.length; i++) {
|
||||||
object[i] = CheckFilter(object[i]);
|
object[i] = CheckFilter(object[i]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (const key in object) {
|
for (const key in object) {
|
||||||
object[key] = CheckFilter(object[key]);
|
object[key] = CheckFilter(object[key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
const oldSend = Discord.TextChannel.prototype.send;
|
const oldSend = Discord.TextChannel.prototype.send;
|
||||||
Discord.TextChannel.prototype.send = async function send(content, options) {
|
Discord.TextChannel.prototype.send = async function send(content, options) {
|
||||||
return oldSend.bind(this)(CheckFilter(content), CheckFilter(options));
|
return oldSend.bind(this)(CheckFilter(content), CheckFilter(options));
|
||||||
};
|
};
|
||||||
let evaled;
|
let evaled;
|
||||||
try {
|
try {
|
||||||
evaled = eval(code);
|
evaled = eval(code);
|
||||||
if (evaled instanceof Promise) evaled = await evaled;
|
if (evaled instanceof Promise) evaled = await evaled;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
evaled = err;
|
evaled = err;
|
||||||
}
|
}
|
||||||
if (typeof evaled !== "string") evaled = require("util").inspect(evaled);
|
if (typeof evaled !== "string") evaled = require("util").inspect(evaled);
|
||||||
evaled = chunk([evaled], 750);
|
console.log(evaled);
|
||||||
let reactions = ["❌", "⏪", "◀️", "⏹️", "▶️", "⏩"],
|
evaled = chunk([evaled], 750);
|
||||||
page = 0,
|
console.log(evaled);
|
||||||
evaledEmbed = new Discord.EmbedBuilder()
|
let reactions = ["❌", "⏪", "◀️", "⏹️", "▶️", "⏩"],
|
||||||
.setColor(client.color)
|
page = 0,
|
||||||
.setDescription(`\`\`\`js\n${evaled[0]}\n\`\`\``)
|
evaledEmbed = new Discord.MessageEmbed()
|
||||||
.setTimestamp()
|
.setColor(client.color)
|
||||||
.setAuthor({
|
.setDescription(`\`\`\`js\n${evaled[0]}\n\`\`\``)
|
||||||
name: `Evaled by ${interaction.user.tag}`,
|
.setTimestamp()
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
.setAuthor({
|
||||||
});
|
name: `Evaled by ${interaction.user.tag}`,
|
||||||
const mainMessage = await interaction.channel.send({
|
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
||||||
embeds: [evaledEmbed],
|
});
|
||||||
});
|
const mainMessage = await interaction.channel.send({
|
||||||
Discord.TextChannel.prototype.send = oldSend;
|
embeds: [evaledEmbed],
|
||||||
await Promise.all(
|
});
|
||||||
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).map(r =>
|
Discord.TextChannel.prototype.send = oldSend;
|
||||||
mainMessage.react(r)
|
await Promise.all(
|
||||||
)
|
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).map(r =>
|
||||||
);
|
mainMessage.react(r)
|
||||||
const filter = (reaction, user) =>
|
)
|
||||||
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).some(
|
);
|
||||||
e => e === reaction.emoji.name
|
const filter = (reaction, user) =>
|
||||||
) && user.id === interaction.user.id;
|
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).some(
|
||||||
const collector = mainMessage.createReactionCollector({
|
e => e === reaction.emoji.name
|
||||||
filter,
|
) && user.id === interaction.user.id;
|
||||||
time: 999999,
|
const collector = mainMessage.createReactionCollector({
|
||||||
});
|
filter,
|
||||||
collector.on("collect", async reaction => {
|
time: 999999,
|
||||||
switch (reaction.emoji.name) {
|
});
|
||||||
case "❌":
|
collector.on("collect", async reaction => {
|
||||||
await collector.stop();
|
switch (reaction.emoji.name) {
|
||||||
return mainMessage.delete();
|
case "❌":
|
||||||
case "⏪":
|
await collector.stop();
|
||||||
if (evaled.length === 1 || page === 0) return;
|
return mainMessage.delete();
|
||||||
page = 0;
|
case "⏪":
|
||||||
break;
|
if (evaled.length === 1 || page === 0) return;
|
||||||
case "◀️":
|
page = 0;
|
||||||
if (evaled.length === 1) return;
|
break;
|
||||||
if (page === 0) {
|
case "◀️":
|
||||||
page = evaled.length - 1;
|
if (evaled.length === 1) return;
|
||||||
} else {
|
if (page === 0) {
|
||||||
page -= 1;
|
page = evaled.length - 1;
|
||||||
}
|
} else {
|
||||||
break;
|
page -= 1;
|
||||||
case "⏹️":
|
}
|
||||||
await collector.stop();
|
break;
|
||||||
for (const reaction of mainMessage.reactions.cache.map(e => e)) {
|
case "⏹️":
|
||||||
await reaction.users.remove(client.user.id);
|
await collector.stop();
|
||||||
}
|
for (const reaction of mainMessage.reactions.cache.map(e => e)) {
|
||||||
return;
|
await reaction.users.remove(client.user.id);
|
||||||
case "▶️":
|
}
|
||||||
if (evaled.length === 1) return;
|
return;
|
||||||
if (page === evaled.length - 1) {
|
case "▶️":
|
||||||
page = 0;
|
if (evaled.length === 1) return;
|
||||||
} else {
|
if (page === evaled.length - 1) {
|
||||||
page += 1;
|
page = 0;
|
||||||
}
|
} else {
|
||||||
break;
|
page += 1;
|
||||||
case "⏩":
|
}
|
||||||
if (evaled.length === 1 || page === evaled.length - 1) return;
|
break;
|
||||||
page = evaled.length - 1;
|
case "⏩":
|
||||||
break;
|
if (evaled.length === 1 || page === evaled.length - 1) return;
|
||||||
}
|
page = evaled.length - 1;
|
||||||
evaledEmbed = new Discord.EmbedBuilder()
|
break;
|
||||||
.setColor(interaction.guild.me.displayColor)
|
}
|
||||||
.setDescription(`\`\`\`js\n${evaled[page]}\n\`\`\``);
|
evaledEmbed = new Discord.MessageEmbed()
|
||||||
await mainMessage.edit({
|
.setColor(interaction.guild.me.displayColor)
|
||||||
embeds: [evaledEmbed],
|
.setDescription(`\`\`\`js\n${evaled[page]}\n\`\`\``);
|
||||||
});
|
await mainMessage.edit({
|
||||||
});
|
embeds: [evaledEmbed],
|
||||||
},
|
});
|
||||||
};
|
});
|
||||||
function chunk(arr, size) {
|
},
|
||||||
let c;
|
};
|
||||||
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => {
|
function chunk(arr, size) {
|
||||||
c = arr.slice(i * size, i * size + size);
|
let c;
|
||||||
});
|
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => {
|
||||||
return c;
|
c = arr.slice(i * size, i * size + size);
|
||||||
}
|
});
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
|
@ -1,47 +1,47 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "getinvite",
|
name: "getinvite",
|
||||||
category: "Owner",
|
category: "Owner",
|
||||||
usage: "(Guild)",
|
usage: "(Guild)",
|
||||||
description: "Generates an invitation to the server",
|
description: "Generates an invitation to the server",
|
||||||
Owner: true,
|
Owner: true,
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "guild",
|
name: "guild",
|
||||||
description: "The guild you want to get invite (Server ID/Name)",
|
description: "The guild you want to get invite (Server ID/Name)",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction, args) => {
|
run: async (client, interaction, args) => {
|
||||||
let guild = null;
|
let guild = null;
|
||||||
const fetched =
|
const fetched =
|
||||||
client.guilds.cache.find(g => g.name === args.join(" ")) ||
|
client.guilds.cache.find(g => g.name === args.join(" ")) ||
|
||||||
client.guilds.cache.get(args[0]);
|
client.guilds.cache.get(args[0]);
|
||||||
guild = fetched;
|
guild = fetched;
|
||||||
if (guild) {
|
if (guild) {
|
||||||
const tChannel = guild.channels.cache.find(
|
const tChannel = guild.channels.cache.find(
|
||||||
ch =>
|
ch =>
|
||||||
ch.type == "GUILD_TEXT" &&
|
ch.type == "GUILD_TEXT" &&
|
||||||
ch.permissionsFor(ch.guild.me).has("CREATE_INSTANT_INVITE")
|
ch.permissionsFor(ch.guild.me).has("CREATE_INSTANT_INVITE")
|
||||||
);
|
);
|
||||||
if (!tChannel) {
|
if (!tChannel) {
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `\`${args.join(
|
content: `\`${args.join(
|
||||||
" "
|
" "
|
||||||
)}\` - Bot can't get invite since it doesn't get enough permission`,
|
)}\` - Bot can't get invite since it doesn't get enough permission`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const invite = await tChannel
|
const invite = await tChannel
|
||||||
.createInvite({ temporary: false, maxAge: 0 })
|
.createInvite({ temporary: false, maxAge: 0 })
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
interaction.followUp({ content: e.stack });
|
interaction.followUp({ content: e.stack });
|
||||||
});
|
});
|
||||||
interaction.followUp({ content: invite.url });
|
interaction.followUp({ content: invite.url });
|
||||||
} else {
|
} else {
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `\`${args.join(" ")}\` - Bot isn't in that server`,
|
content: `\`${args.join(" ")}\` - Bot isn't in that server`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,45 +1,38 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { MessageEmbed } = require("discord.js");
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "guilds",
|
name: "guilds",
|
||||||
category: "Owner",
|
category: "Owner",
|
||||||
description: "Check top 10 guilds of the bot",
|
description: "Check top 10 guilds of the bot",
|
||||||
Owner: true,
|
Owner: true,
|
||||||
run: async (client, interaction) => {
|
run: async (client, interaction) => {
|
||||||
const guilds = client.guilds.cache
|
const guilds = client.guilds.cache
|
||||||
.sort((a, b) => b.memberCount - a.memberCount)
|
.sort((a, b) => b.memberCount - a.memberCount)
|
||||||
.first(10);
|
.first(10);
|
||||||
const description = guilds
|
const description = guilds
|
||||||
.map((guild, index) => {
|
.map((guild, index) => {
|
||||||
return `**${index + 1}❯** ${guild.name} =❯ ${
|
return `**${index + 1}❯** ${guild.name} =❯ ${
|
||||||
guild.memberCount
|
guild.memberCount
|
||||||
} 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()
|
inline: true,
|
||||||
: "0",
|
},
|
||||||
inline: true,
|
{
|
||||||
},
|
name: `Total Members`,
|
||||||
{
|
value: client.users.cache.size,
|
||||||
name: `Total Members`,
|
inline: true,
|
||||||
value: client.users.cache.size
|
}
|
||||||
? client.users.cache.size.toString()
|
)
|
||||||
: "0",
|
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
|
||||||
inline: true,
|
.setTimestamp();
|
||||||
},
|
interaction.followUp({ embeds: [embed] });
|
||||||
])
|
},
|
||||||
.setFooter({
|
};
|
||||||
text: `Made by ${client.author}`,
|
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
|
||||||
})
|
|
||||||
.setTimestamp();
|
|
||||||
interaction.followUp({ embeds: [embed] });
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "restart",
|
name: "restart",
|
||||||
category: "Owner",
|
category: "Owner",
|
||||||
description: "Restart the bot",
|
description: "Restart the bot",
|
||||||
Owner: true,
|
Owner: true,
|
||||||
run: async (client, interaction, args) => {
|
run: async (client, interaction, args) => {
|
||||||
await interaction.deleteReply();
|
await interaction.deleteReply();
|
||||||
const msg = await interaction.channel.send(
|
const msg = await interaction.channel.send(
|
||||||
"<a:config:896990033561669762> Restarting "
|
"<a:config:896990033561669762> Restarting "
|
||||||
);
|
);
|
||||||
await client.destroy();
|
await client.destroy();
|
||||||
await client.login(process.env.TOKEN);
|
await client.login(process.env.TOKEN);
|
||||||
await msg.delete();
|
await msg.delete();
|
||||||
await interaction.channel.send(
|
await interaction.channel.send(
|
||||||
"<a:nyx_checkmark:897240322411724841> Restarted"
|
"<a:nyx_checkmark:897240322411724841> Restarted"
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
35
command/Utilities/afk.js
Normal file
35
command/Utilities/afk.js
Normal 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] });
|
||||||
|
},
|
||||||
|
};
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue