unix from dos
This commit is contained in:
parent
0e6804fd56
commit
e6ea923687
66 changed files with 27115 additions and 27190 deletions
.env.exampleconfig.js
.github
DockerfileLICENSEclient
command
CODM
Config
Information
Owner
Utilities
events
index.jsmodels
package.jsonutil
|
@ -1,5 +1,5 @@
|
||||||
TOKEN =
|
TOKEN =
|
||||||
MONGO = mongodb://127.0.0.1:27017/test
|
MONGO = mongodb://127.0.0.1:27017/test
|
||||||
mongo =
|
mongo =
|
||||||
cathmongo =
|
cathmongo =
|
||||||
api = http://api.cath.gq
|
api = http://api.cath.gq
|
10
.github/PRIVACY_POLICY.md
vendored
10
.github/PRIVACY_POLICY.md
vendored
|
@ -1,5 +1,5 @@
|
||||||
We know that users take their privacy seriously, so are us, therefore please read our **Privacy Policy**
|
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 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.**
|
**We do not share or sell your personal data to any third party.**
|
||||||
|
|
248
.github/README.md
vendored
248
.github/README.md
vendored
|
@ -1,124 +1,124 @@
|
||||||
<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://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>
|
<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=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://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://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank"><img alt='Licence CC BY-NC-SA 4.0' src ="https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc-sa.svg" width="82">
|
||||||
<a href="https://trello.com/b/dIgR0QNm" target="_blank"><img alt='Trello' src="https://img.shields.io/badge/Trello-5865F2?style=for-the-badge&logo=trello&logoColor=white"></a>
|
<a href="https://trello.com/b/dIgR0QNm" target="_blank"><img alt='Trello' src="https://img.shields.io/badge/Trello-5865F2?style=for-the-badge&logo=trello&logoColor=white"></a>
|
||||||
<a href="https://github.com/night0721/cath"><img alt = 'NPM Package' src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white">
|
<a href="https://github.com/night0721/cath"><img alt = 'NPM Package' src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white">
|
||||||
<a href="https://thunder75.gitbook.io/cath-bot" target="_blank"><img src="https://img.shields.io/static/v1?label=Docs&message=available&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
|
<a href="https://thunder75.gitbook.io/cath-bot" target="_blank"><img src="https://img.shields.io/static/v1?label=Docs&message=available&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
|
||||||
<a href="https://ko-fi.com/I2I35XISJ" target="_blank"><img alt='Kofi' src="https://img.shields.io/static/v1?label=Support%20Us&message=KO.FI&color=ff5e5b&logo=kofi&logoColor=white&style=for-the-badge&scale=1.4"></a> <br>
|
<a href="https://ko-fi.com/I2I35XISJ" target="_blank"><img alt='Kofi' src="https://img.shields.io/static/v1?label=Support%20Us&message=KO.FI&color=ff5e5b&logo=kofi&logoColor=white&style=for-the-badge&scale=1.4"></a> <br>
|
||||||
<a href="https://nyx-bot.statuspage.io/"target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=NYX&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
|
<a href="https://nyx-bot.statuspage.io/"target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=NYX&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
|
||||||
<a href="https://nyx-bot.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=NYX%202&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
|
<a href="https://nyx-bot.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=NYX%202&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
|
||||||
<a href="https://nyx-bot.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=API&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
|
<a href="https://nyx-bot.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=API&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align = "center">
|
<p align = "center">
|
||||||
<a href="https://rebrand.ly/cathSupport"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner2" alt="Support Server" /></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>
|
||||||
|
|
||||||
<!-- description -->
|
<!-- description -->
|
||||||
|
|
||||||
**NYX** _(previously known as Cath)_ is a first and only **COD Mobile Statistics & Gunsmith** Bot which also doubles as a multipurpose discord bot with many features that include but are not limited to Moderation, Music and Economy. <br>
|
**NYX** _(previously known as Cath)_ is a first and only **COD Mobile Statistics & Gunsmith** Bot which also doubles as a multipurpose discord bot with many features that include but are not limited to Moderation, Music and Economy. <br>
|
||||||
The Call of Duty Stats are courtesy of **Stats on Duty** & **Round Table**<br>
|
The Call of Duty Stats are courtesy of **Stats on Duty** & **Round Table**<br>
|
||||||
🔺 **Apex Legends Commands** will be added soon, the player stats command will be added after the global launch when the API supports it.
|
🔺 **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>
|
<br><br>
|
||||||
If you like this bot, feel free to :star: **Star** this repository.<br>
|
If you like this bot, feel free to :star: **Star** this repository.<br>
|
||||||
|
|
||||||
> ⚠ The Verifed bot instance is current called Cath.exe, we are working on getting it changed
|
> ⚠ The Verifed bot instance is current called Cath.exe, we are working on getting it changed
|
||||||
> <br>
|
> <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>
|
🚨 **Moderation** - Classic commands like kick, ban, warn, role and many more. <br>
|
||||||
📈 **Economy** - A Robust economy system, inspired by **pepe bot** <br>
|
📈 **Economy** - A Robust economy system, inspired by **pepe bot** <br>
|
||||||
✨ **Fun Commands** - A massive collection of fun commands `(35+ commands)` <br>
|
✨ **Fun Commands** - A massive collection of fun commands `(35+ commands)` <br>
|
||||||
🎵 **Music** - Classic Music Commands that can play from various sources. <br>
|
🎵 **Music** - Classic Music Commands that can play from various sources. <br>
|
||||||
🛠 **Utility** - A wide range of useful commands `(Around 20)` <br>
|
🛠 **Utility** - A wide range of useful commands `(Around 20)` <br>
|
||||||
🕹 **Games** - Many fun games to spend your time <br>
|
🕹 **Games** - Many fun games to spend your time <br>
|
||||||
🎮 **Call of Duty** - Check the list of Call of Duty Mobile Commands
|
🎮 **Call of Duty** - Check 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**
|
- **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.
|
- **Currated Gunsmith Builds** by various content creators like Jokesta, dHitman, Path.exe, Stats On Duty and more comming soon.
|
||||||
- **Perks** detailed info about the perks.
|
- **Perks** detailed info about the perks.
|
||||||
- **Scorestreak** detailed info about scorestreak with preview videos.
|
- **Scorestreak** detailed info about scorestreak with preview videos.
|
||||||
- **Randomly Generated Class** Wanna try something challenging? try our Randomly Generated Gunsmith builds.
|
- **Randomly Generated Class** Wanna try something challenging? try our Randomly Generated Gunsmith builds.
|
||||||
|
|
||||||
> We also provide access to our database that includes In-depth Weapon statistics & Gunsmith Builds from various Content Creators, & other Call of duty related info, please [contact us](https://rebrand.ly/cathSupport) for more info.
|
> We also provide access to our database that includes In-depth Weapon statistics & Gunsmith Builds from various Content Creators, & other Call of duty related info, please [contact us](https://rebrand.ly/cathSupport) for more info.
|
||||||
|
|
||||||
## <img height="16px" src="../util/assets/images/apex/apex-legends-logo-white.svg"> **Apex Legends Mobile**
|
## <img height="16px" src="../util/assets/images/apex/apex-legends-logo-white.svg"> **Apex Legends Mobile**
|
||||||
|
|
||||||
> ⚠ _Coming Soon™_
|
> ⚠ _Coming Soon™_
|
||||||
|
|
||||||
- **Player Stats** view your in-game stats. <!-- if they support mobile for the stats api -->
|
- **Player Stats** view your in-game stats. <!-- if they support mobile for the stats api -->
|
||||||
- **Legends** detailed info about legends & their abilities.
|
- **Legends** detailed info about legends & their abilities.
|
||||||
- **Guns** detailed info about guns.
|
- **Guns** detailed info about guns.
|
||||||
- **Random Combos** Wanna try something challenging? try to win a game with a random selected legend & Gun combination
|
- **Random Combos** Wanna try something challenging? try to win a game with a random selected legend & Gun combination
|
||||||
- _& many more, coming soon!_
|
- _& many more, coming soon!_
|
||||||
|
|
||||||
## More Info
|
## More Info
|
||||||
|
|
||||||
[](https://github.com/night0721/cath.exe)
|
[](https://github.com/night0721/cath.exe)
|
||||||
[](https://www.codefactor.io/repository/github/night0721/cath.js)
|
[](https://www.codefactor.io/repository/github/night0721/cath.js)
|
||||||
<a href="https://thunder75.gitbook.io/cath-bot/deployment" target="_blank"><img src="https://img.shields.io/static/v1?label=Deployment&message=Guide&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
|
<a href="https://thunder75.gitbook.io/cath-bot/deployment" target="_blank"><img src="https://img.shields.io/static/v1?label=Deployment&message=Guide&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
|
||||||
|
|
||||||
A detailed Deployment guide can be found [here](https://thunder75.gitbook.io/cath-bot/deployment).
|
A detailed Deployment guide can be found [here](https://thunder75.gitbook.io/cath-bot/deployment).
|
||||||
|
|
||||||
<!-- <details>
|
<!-- <details>
|
||||||
<summary>Made With</summary>
|
<summary>Made With</summary>
|
||||||
|
|
||||||
[](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
|
[](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
|
||||||
[](https://nodejs.org/en/)
|
[](https://nodejs.org/en/)
|
||||||
[](https://www.npmjs.com/)
|
[](https://www.npmjs.com/)
|
||||||
[](https://mongodb.com/)
|
[](https://mongodb.com/)
|
||||||
<img src ="https://forthebadge.com/images/badges/built-with-love.svg" width = "122"><br>
|
<img src ="https://forthebadge.com/images/badges/built-with-love.svg" width = "122"><br>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Github Stats</summary>
|
<summary>Github Stats</summary>
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
[](https://github.com/night0721/cath.exe)
|
[](https://github.com/night0721/cath.exe)
|
||||||
<!-- [](https://github.com/night0721/cath.exe)
|
<!-- [](https://github.com/night0721/cath.exe)
|
||||||
|
|
||||||
</details> -->
|
</details> -->
|
||||||
|
|
||||||
<h1 align = "center"> Support, Feature Request & Bug Reports </h1>
|
<h1 align = "center"> Support, Feature Request & Bug Reports </h1>
|
||||||
|
|
||||||
## <img src = "https://cdn.discordapp.com/emojis/867093614403256350.png?v=1" width = 18> Support & Feature Request
|
## <img src = "https://cdn.discordapp.com/emojis/867093614403256350.png?v=1" width = 18> Support & Feature Request
|
||||||
|
|
||||||
Join the official [Support Server](https://rebrand.ly/cathSupport) on Discord & we will be happy to assist you. <br>
|
Join the official [Support Server](https://rebrand.ly/cathSupport) on Discord & we will be happy to assist you. <br>
|
||||||
To Request new features contact us on Discord using the support server.
|
To Request new features contact us on Discord using the support server.
|
||||||
|
|
||||||
## <img src = "https://cdn.discordapp.com/emojis/867093601962950666.png?v=1" width = "18"> Report Bugs
|
## <img src = "https://cdn.discordapp.com/emojis/867093601962950666.png?v=1" width = "18"> Report Bugs
|
||||||
|
|
||||||
You can report bugs or issues by opening a issue in this repository. Alternatevely you can also contact us on Discord using the support server.
|
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.
|
||||||
|
|
||||||
<p align = "center">
|
<p align = "center">
|
||||||
<a href="https://rebrand.ly/cathSupport" target="_blank"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner1"></a>
|
<a href="https://rebrand.ly/cathSupport" target="_blank"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner1"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h1 align="center"> Contributors </h1>
|
<h1 align="center"> Contributors </h1>
|
||||||
|
|
||||||
Contributions are always welcomed, but make sure to read [Contributing.md](/CONTRIBUTING.md) first.
|
Contributions are always welcomed, but make sure to read [Contributing.md](/CONTRIBUTING.md) first.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
<!-- ## Special Thanks to The Roound Table from Cygnoux Familia.
|
<!-- ## Special Thanks to The Roound Table from Cygnoux Familia.
|
||||||
|
|
||||||
<p align = "center">
|
<p align = "center">
|
||||||
<a href="https://discord.gg/mjVwkCsWY7" target="_blank"><img src="https://discordapp.com/api/guilds/756525751594909797/widget.png?style=banner1"></a>
|
<a href="https://discord.gg/mjVwkCsWY7" target="_blank"><img src="https://discordapp.com/api/guilds/756525751594909797/widget.png?style=banner1"></a>
|
||||||
</p> -->
|
</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"> -->
|
<!-- <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"> -->
|
||||||
|
|
10
.github/TOS.md
vendored
10
.github/TOS.md
vendored
|
@ -1,5 +1,5 @@
|
||||||
**Terms of Service**
|
**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.
|
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.
|
For privacy policy, please check out our privacy policy.
|
||||||
|
|
75
.github/changelog.md
vendored
75
.github/changelog.md
vendored
|
@ -1,75 +0,0 @@
|
||||||
<h1 align="center">Changelog</h1>
|
|
||||||
|
|
||||||
# Release v3.3.0 Name Change
|
|
||||||
We have changed the name of our bot from **Cath.exe** to **NYX**. We have not yet decided on changing the backend names that includes the api & package.
|
|
||||||
|
|
||||||
## Added
|
|
||||||
- Added guns to be bought using internal currency.
|
|
||||||
- Added more items in the shops.
|
|
||||||
- Updated names of contributers in the bot info.
|
|
||||||
|
|
||||||
## Changes / Modification
|
|
||||||
- Change the footers of embed as we transition from using the Statistics provided by **Project Lighthouse v2** into using Statistics provided by **Round table**.
|
|
||||||
|
|
||||||
# Release v3.2.6
|
|
||||||
## Added
|
|
||||||
- Tips
|
|
||||||
- Topics
|
|
||||||
## Fixes
|
|
||||||
- Added Bot avatar in the footer
|
|
||||||
- Added timestamps in embeds
|
|
||||||
|
|
||||||
|
|
||||||
# Release v3.2.0
|
|
||||||
In this version we made the starboard to be globalized, means that you can configure the settings for the starboard per server.
|
|
||||||
## Added
|
|
||||||
- drop
|
|
||||||
- announce
|
|
||||||
- emojiadd
|
|
||||||
|
|
||||||
snipe&editsnipe fix
|
|
||||||
To stay up-to-date with our progress, check out our discord server & the Trello page.
|
|
||||||
|
|
||||||
# Release v3.0.0
|
|
||||||
In this version we implement Discord.js v13, which introduces slash commands.
|
|
||||||
we have not implemented all of the commands yet, the moderation commands especially.
|
|
||||||
To stay up-to-date with our progress, check out our discord server & the Trello page.
|
|
||||||
|
|
||||||
# Release v2.1.0
|
|
||||||
New & Improved API for client and commands.
|
|
||||||
## Added
|
|
||||||
|
|
||||||
- Superscript
|
|
||||||
- Doublestruck (Fonts/Symbols generator)
|
|
||||||
- rickroll (For rickroll)
|
|
||||||
- quote
|
|
||||||
- triggered
|
|
||||||
- rank (Image generator)
|
|
||||||
- Emojiadd command(It works normally with image and links)
|
|
||||||
- Emoji not showing normally on help and shop command
|
|
||||||
- Case insensitive prefix
|
|
||||||
- Now it can reply with c. and also C.
|
|
||||||
- Improved economy system
|
|
||||||
|
|
||||||
# Release v2.0.1
|
|
||||||
No Description
|
|
||||||
|
|
||||||
## Added
|
|
||||||
- Docs
|
|
||||||
- Suggest
|
|
||||||
- Dependencies
|
|
||||||
|
|
||||||
## Modified/Updates
|
|
||||||
- Moderation Commands
|
|
||||||
- Ban
|
|
||||||
- Pin
|
|
||||||
- Dependencies
|
|
||||||
|
|
||||||
## Removed
|
|
||||||
- All the Server specific refrences
|
|
||||||
|
|
||||||
# Release v2.0-BETA
|
|
||||||
Initial Commit
|
|
||||||
|
|
||||||
# Release v1.0.0
|
|
||||||
The bot was not open source & only Night worked on it.
|
|
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
|
872
LICENSE
872
LICENSE
|
@ -1,437 +1,437 @@
|
||||||
Attribution-NonCommercial-ShareAlike 4.0 International
|
Attribution-NonCommercial-ShareAlike 4.0 International
|
||||||
|
|
||||||
=======================================================================
|
=======================================================================
|
||||||
|
|
||||||
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
||||||
does not provide legal services or legal advice. Distribution of
|
does not provide legal services or legal advice. Distribution of
|
||||||
Creative Commons public licenses does not create a lawyer-client or
|
Creative Commons public licenses does not create a lawyer-client or
|
||||||
other relationship. Creative Commons makes its licenses and related
|
other relationship. Creative Commons makes its licenses and related
|
||||||
information available on an "as-is" basis. Creative Commons gives no
|
information available on an "as-is" basis. Creative Commons gives no
|
||||||
warranties regarding its licenses, any material licensed under their
|
warranties regarding its licenses, any material licensed under their
|
||||||
terms and conditions, or any related information. Creative Commons
|
terms and conditions, or any related information. Creative Commons
|
||||||
disclaims all liability for damages resulting from their use to the
|
disclaims all liability for damages resulting from their use to the
|
||||||
fullest extent possible.
|
fullest extent possible.
|
||||||
|
|
||||||
Using Creative Commons Public Licenses
|
Using Creative Commons Public Licenses
|
||||||
|
|
||||||
Creative Commons public licenses provide a standard set of terms and
|
Creative Commons public licenses provide a standard set of terms and
|
||||||
conditions that creators and other rights holders may use to share
|
conditions that creators and other rights holders may use to share
|
||||||
original works of authorship and other material subject to copyright
|
original works of authorship and other material subject to copyright
|
||||||
and certain other rights specified in the public license below. The
|
and certain other rights specified in the public license below. The
|
||||||
following considerations are for informational purposes only, are not
|
following considerations are for informational purposes only, are not
|
||||||
exhaustive, and do not form part of our licenses.
|
exhaustive, and do not form part of our licenses.
|
||||||
|
|
||||||
Considerations for licensors: Our public licenses are
|
Considerations for licensors: Our public licenses are
|
||||||
intended for use by those authorized to give the public
|
intended for use by those authorized to give the public
|
||||||
permission to use material in ways otherwise restricted by
|
permission to use material in ways otherwise restricted by
|
||||||
copyright and certain other rights. Our licenses are
|
copyright and certain other rights. Our licenses are
|
||||||
irrevocable. Licensors should read and understand the terms
|
irrevocable. Licensors should read and understand the terms
|
||||||
and conditions of the license they choose before applying it.
|
and conditions of the license they choose before applying it.
|
||||||
Licensors should also secure all rights necessary before
|
Licensors should also secure all rights necessary before
|
||||||
applying our licenses so that the public can reuse the
|
applying our licenses so that the public can reuse the
|
||||||
material as expected. Licensors should clearly mark any
|
material as expected. Licensors should clearly mark any
|
||||||
material not subject to the license. This includes other CC-
|
material not subject to the license. This includes other CC-
|
||||||
licensed material, or material used under an exception or
|
licensed material, or material used under an exception or
|
||||||
limitation to copyright. More considerations for licensors:
|
limitation to copyright. More considerations for licensors:
|
||||||
wiki.creativecommons.org/Considerations_for_licensors
|
wiki.creativecommons.org/Considerations_for_licensors
|
||||||
|
|
||||||
Considerations for the public: By using one of our public
|
Considerations for the public: By using one of our public
|
||||||
licenses, a licensor grants the public permission to use the
|
licenses, a licensor grants the public permission to use the
|
||||||
licensed material under specified terms and conditions. If
|
licensed material under specified terms and conditions. If
|
||||||
the licensor's permission is not necessary for any reason--for
|
the licensor's permission is not necessary for any reason--for
|
||||||
example, because of any applicable exception or limitation to
|
example, because of any applicable exception or limitation to
|
||||||
copyright--then that use is not regulated by the license. Our
|
copyright--then that use is not regulated by the license. Our
|
||||||
licenses grant only permissions under copyright and certain
|
licenses grant only permissions under copyright and certain
|
||||||
other rights that a licensor has authority to grant. Use of
|
other rights that a licensor has authority to grant. Use of
|
||||||
the licensed material may still be restricted for other
|
the licensed material may still be restricted for other
|
||||||
reasons, including because others have copyright or other
|
reasons, including because others have copyright or other
|
||||||
rights in the material. A licensor may make special requests,
|
rights in the material. A licensor may make special requests,
|
||||||
such as asking that all changes be marked or described.
|
such as asking that all changes be marked or described.
|
||||||
Although not required by our licenses, you are encouraged to
|
Although not required by our licenses, you are encouraged to
|
||||||
respect those requests where reasonable. More_considerations
|
respect those requests where reasonable. More_considerations
|
||||||
for the public:
|
for the public:
|
||||||
wiki.creativecommons.org/Considerations_for_licensees
|
wiki.creativecommons.org/Considerations_for_licensees
|
||||||
|
|
||||||
=======================================================================
|
=======================================================================
|
||||||
|
|
||||||
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
|
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
|
||||||
Public License
|
Public License
|
||||||
|
|
||||||
By exercising the Licensed Rights (defined below), You accept and agree
|
By exercising the Licensed Rights (defined below), You accept and agree
|
||||||
to be bound by the terms and conditions of this Creative Commons
|
to be bound by the terms and conditions of this Creative Commons
|
||||||
Attribution-NonCommercial-ShareAlike 4.0 International Public License
|
Attribution-NonCommercial-ShareAlike 4.0 International Public License
|
||||||
("Public License"). To the extent this Public License may be
|
("Public License"). To the extent this Public License may be
|
||||||
interpreted as a contract, You are granted the Licensed Rights in
|
interpreted as a contract, You are granted the Licensed Rights in
|
||||||
consideration of Your acceptance of these terms and conditions, and the
|
consideration of Your acceptance of these terms and conditions, and the
|
||||||
Licensor grants You such rights in consideration of benefits the
|
Licensor grants You such rights in consideration of benefits the
|
||||||
Licensor receives from making the Licensed Material available under
|
Licensor receives from making the Licensed Material available under
|
||||||
these terms and conditions.
|
these terms and conditions.
|
||||||
|
|
||||||
|
|
||||||
Section 1 -- Definitions.
|
Section 1 -- Definitions.
|
||||||
|
|
||||||
a. Adapted Material means material subject to Copyright and Similar
|
a. Adapted Material means material subject to Copyright and Similar
|
||||||
Rights that is derived from or based upon the Licensed Material
|
Rights that is derived from or based upon the Licensed Material
|
||||||
and in which the Licensed Material is translated, altered,
|
and in which the Licensed Material is translated, altered,
|
||||||
arranged, transformed, or otherwise modified in a manner requiring
|
arranged, transformed, or otherwise modified in a manner requiring
|
||||||
permission under the Copyright and Similar Rights held by the
|
permission under the Copyright and Similar Rights held by the
|
||||||
Licensor. For purposes of this Public License, where the Licensed
|
Licensor. For purposes of this Public License, where the Licensed
|
||||||
Material is a musical work, performance, or sound recording,
|
Material is a musical work, performance, or sound recording,
|
||||||
Adapted Material is always produced where the Licensed Material is
|
Adapted Material is always produced where the Licensed Material is
|
||||||
synched in timed relation with a moving image.
|
synched in timed relation with a moving image.
|
||||||
|
|
||||||
b. Adapter's License means the license You apply to Your Copyright
|
b. Adapter's License means the license You apply to Your Copyright
|
||||||
and Similar Rights in Your contributions to Adapted Material in
|
and Similar Rights in Your contributions to Adapted Material in
|
||||||
accordance with the terms and conditions of this Public License.
|
accordance with the terms and conditions of this Public License.
|
||||||
|
|
||||||
c. BY-NC-SA Compatible License means a license listed at
|
c. BY-NC-SA Compatible License means a license listed at
|
||||||
creativecommons.org/compatiblelicenses, approved by Creative
|
creativecommons.org/compatiblelicenses, approved by Creative
|
||||||
Commons as essentially the equivalent of this Public License.
|
Commons as essentially the equivalent of this Public License.
|
||||||
|
|
||||||
d. Copyright and Similar Rights means copyright and/or similar rights
|
d. Copyright and Similar Rights means copyright and/or similar rights
|
||||||
closely related to copyright including, without limitation,
|
closely related to copyright including, without limitation,
|
||||||
performance, broadcast, sound recording, and Sui Generis Database
|
performance, broadcast, sound recording, and Sui Generis Database
|
||||||
Rights, without regard to how the rights are labeled or
|
Rights, without regard to how the rights are labeled or
|
||||||
categorized. For purposes of this Public License, the rights
|
categorized. For purposes of this Public License, the rights
|
||||||
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
||||||
Rights.
|
Rights.
|
||||||
|
|
||||||
e. Effective Technological Measures means those measures that, in the
|
e. Effective Technological Measures means those measures that, in the
|
||||||
absence of proper authority, may not be circumvented under laws
|
absence of proper authority, may not be circumvented under laws
|
||||||
fulfilling obligations under Article 11 of the WIPO Copyright
|
fulfilling obligations under Article 11 of the WIPO Copyright
|
||||||
Treaty adopted on December 20, 1996, and/or similar international
|
Treaty adopted on December 20, 1996, and/or similar international
|
||||||
agreements.
|
agreements.
|
||||||
|
|
||||||
f. Exceptions and Limitations means fair use, fair dealing, and/or
|
f. Exceptions and Limitations means fair use, fair dealing, and/or
|
||||||
any other exception or limitation to Copyright and Similar Rights
|
any other exception or limitation to Copyright and Similar Rights
|
||||||
that applies to Your use of the Licensed Material.
|
that applies to Your use of the Licensed Material.
|
||||||
|
|
||||||
g. License Elements means the license attributes listed in the name
|
g. License Elements means the license attributes listed in the name
|
||||||
of a Creative Commons Public License. The License Elements of this
|
of a Creative Commons Public License. The License Elements of this
|
||||||
Public License are Attribution, NonCommercial, and ShareAlike.
|
Public License are Attribution, NonCommercial, and ShareAlike.
|
||||||
|
|
||||||
h. Licensed Material means the artistic or literary work, database,
|
h. Licensed Material means the artistic or literary work, database,
|
||||||
or other material to which the Licensor applied this Public
|
or other material to which the Licensor applied this Public
|
||||||
License.
|
License.
|
||||||
|
|
||||||
i. Licensed Rights means the rights granted to You subject to the
|
i. Licensed Rights means the rights granted to You subject to the
|
||||||
terms and conditions of this Public License, which are limited to
|
terms and conditions of this Public License, which are limited to
|
||||||
all Copyright and Similar Rights that apply to Your use of the
|
all Copyright and Similar Rights that apply to Your use of the
|
||||||
Licensed Material and that the Licensor has authority to license.
|
Licensed Material and that the Licensor has authority to license.
|
||||||
|
|
||||||
j. Licensor means the individual(s) or entity(ies) granting rights
|
j. Licensor means the individual(s) or entity(ies) granting rights
|
||||||
under this Public License.
|
under this Public License.
|
||||||
|
|
||||||
k. NonCommercial means not primarily intended for or directed towards
|
k. NonCommercial means not primarily intended for or directed towards
|
||||||
commercial advantage or monetary compensation. For purposes of
|
commercial advantage or monetary compensation. For purposes of
|
||||||
this Public License, the exchange of the Licensed Material for
|
this Public License, the exchange of the Licensed Material for
|
||||||
other material subject to Copyright and Similar Rights by digital
|
other material subject to Copyright and Similar Rights by digital
|
||||||
file-sharing or similar means is NonCommercial provided there is
|
file-sharing or similar means is NonCommercial provided there is
|
||||||
no payment of monetary compensation in connection with the
|
no payment of monetary compensation in connection with the
|
||||||
exchange.
|
exchange.
|
||||||
|
|
||||||
l. Share means to provide material to the public by any means or
|
l. Share means to provide material to the public by any means or
|
||||||
process that requires permission under the Licensed Rights, such
|
process that requires permission under the Licensed Rights, such
|
||||||
as reproduction, public display, public performance, distribution,
|
as reproduction, public display, public performance, distribution,
|
||||||
dissemination, communication, or importation, and to make material
|
dissemination, communication, or importation, and to make material
|
||||||
available to the public including in ways that members of the
|
available to the public including in ways that members of the
|
||||||
public may access the material from a place and at a time
|
public may access the material from a place and at a time
|
||||||
individually chosen by them.
|
individually chosen by them.
|
||||||
|
|
||||||
m. Sui Generis Database Rights means rights other than copyright
|
m. Sui Generis Database Rights means rights other than copyright
|
||||||
resulting from Directive 96/9/EC of the European Parliament and of
|
resulting from Directive 96/9/EC of the European Parliament and of
|
||||||
the Council of 11 March 1996 on the legal protection of databases,
|
the Council of 11 March 1996 on the legal protection of databases,
|
||||||
as amended and/or succeeded, as well as other essentially
|
as amended and/or succeeded, as well as other essentially
|
||||||
equivalent rights anywhere in the world.
|
equivalent rights anywhere in the world.
|
||||||
|
|
||||||
n. You means the individual or entity exercising the Licensed Rights
|
n. You means the individual or entity exercising the Licensed Rights
|
||||||
under this Public License. Your has a corresponding meaning.
|
under this Public License. Your has a corresponding meaning.
|
||||||
|
|
||||||
|
|
||||||
Section 2 -- Scope.
|
Section 2 -- Scope.
|
||||||
|
|
||||||
a. License grant.
|
a. License grant.
|
||||||
|
|
||||||
1. Subject to the terms and conditions of this Public License,
|
1. Subject to the terms and conditions of this Public License,
|
||||||
the Licensor hereby grants You a worldwide, royalty-free,
|
the Licensor hereby grants You a worldwide, royalty-free,
|
||||||
non-sublicensable, non-exclusive, irrevocable license to
|
non-sublicensable, non-exclusive, irrevocable license to
|
||||||
exercise the Licensed Rights in the Licensed Material to:
|
exercise the Licensed Rights in the Licensed Material to:
|
||||||
|
|
||||||
a. reproduce and Share the Licensed Material, in whole or
|
a. reproduce and Share the Licensed Material, in whole or
|
||||||
in part, for NonCommercial purposes only; and
|
in part, for NonCommercial purposes only; and
|
||||||
|
|
||||||
b. produce, reproduce, and Share Adapted Material for
|
b. produce, reproduce, and Share Adapted Material for
|
||||||
NonCommercial purposes only.
|
NonCommercial purposes only.
|
||||||
|
|
||||||
2. Exceptions and Limitations. For the avoidance of doubt, where
|
2. Exceptions and Limitations. For the avoidance of doubt, where
|
||||||
Exceptions and Limitations apply to Your use, this Public
|
Exceptions and Limitations apply to Your use, this Public
|
||||||
License does not apply, and You do not need to comply with
|
License does not apply, and You do not need to comply with
|
||||||
its terms and conditions.
|
its terms and conditions.
|
||||||
|
|
||||||
3. Term. The term of this Public License is specified in Section
|
3. Term. The term of this Public License is specified in Section
|
||||||
6(a).
|
6(a).
|
||||||
|
|
||||||
4. Media and formats; technical modifications allowed. The
|
4. Media and formats; technical modifications allowed. The
|
||||||
Licensor authorizes You to exercise the Licensed Rights in
|
Licensor authorizes You to exercise the Licensed Rights in
|
||||||
all media and formats whether now known or hereafter created,
|
all media and formats whether now known or hereafter created,
|
||||||
and to make technical modifications necessary to do so. The
|
and to make technical modifications necessary to do so. The
|
||||||
Licensor waives and/or agrees not to assert any right or
|
Licensor waives and/or agrees not to assert any right or
|
||||||
authority to forbid You from making technical modifications
|
authority to forbid You from making technical modifications
|
||||||
necessary to exercise the Licensed Rights, including
|
necessary to exercise the Licensed Rights, including
|
||||||
technical modifications necessary to circumvent Effective
|
technical modifications necessary to circumvent Effective
|
||||||
Technological Measures. For purposes of this Public License,
|
Technological Measures. For purposes of this Public License,
|
||||||
simply making modifications authorized by this Section 2(a)
|
simply making modifications authorized by this Section 2(a)
|
||||||
(4) never produces Adapted Material.
|
(4) never produces Adapted Material.
|
||||||
|
|
||||||
5. Downstream recipients.
|
5. Downstream recipients.
|
||||||
|
|
||||||
a. Offer from the Licensor -- Licensed Material. Every
|
a. Offer from the Licensor -- Licensed Material. Every
|
||||||
recipient of the Licensed Material automatically
|
recipient of the Licensed Material automatically
|
||||||
receives an offer from the Licensor to exercise the
|
receives an offer from the Licensor to exercise the
|
||||||
Licensed Rights under the terms and conditions of this
|
Licensed Rights under the terms and conditions of this
|
||||||
Public License.
|
Public License.
|
||||||
|
|
||||||
b. Additional offer from the Licensor -- Adapted Material.
|
b. Additional offer from the Licensor -- Adapted Material.
|
||||||
Every recipient of Adapted Material from You
|
Every recipient of Adapted Material from You
|
||||||
automatically receives an offer from the Licensor to
|
automatically receives an offer from the Licensor to
|
||||||
exercise the Licensed Rights in the Adapted Material
|
exercise the Licensed Rights in the Adapted Material
|
||||||
under the conditions of the Adapter's License You apply.
|
under the conditions of the Adapter's License You apply.
|
||||||
|
|
||||||
c. No downstream restrictions. You may not offer or impose
|
c. No downstream restrictions. You may not offer or impose
|
||||||
any additional or different terms or conditions on, or
|
any additional or different terms or conditions on, or
|
||||||
apply any Effective Technological Measures to, the
|
apply any Effective Technological Measures to, the
|
||||||
Licensed Material if doing so restricts exercise of the
|
Licensed Material if doing so restricts exercise of the
|
||||||
Licensed Rights by any recipient of the Licensed
|
Licensed Rights by any recipient of the Licensed
|
||||||
Material.
|
Material.
|
||||||
|
|
||||||
6. No endorsement. Nothing in this Public License constitutes or
|
6. No endorsement. Nothing in this Public License constitutes or
|
||||||
may be construed as permission to assert or imply that You
|
may be construed as permission to assert or imply that You
|
||||||
are, or that Your use of the Licensed Material is, connected
|
are, or that Your use of the Licensed Material is, connected
|
||||||
with, or sponsored, endorsed, or granted official status by,
|
with, or sponsored, endorsed, or granted official status by,
|
||||||
the Licensor or others designated to receive attribution as
|
the Licensor or others designated to receive attribution as
|
||||||
provided in Section 3(a)(1)(A)(i).
|
provided in Section 3(a)(1)(A)(i).
|
||||||
|
|
||||||
b. Other rights.
|
b. Other rights.
|
||||||
|
|
||||||
1. Moral rights, such as the right of integrity, are not
|
1. Moral rights, such as the right of integrity, are not
|
||||||
licensed under this Public License, nor are publicity,
|
licensed under this Public License, nor are publicity,
|
||||||
privacy, and/or other similar personality rights; however, to
|
privacy, and/or other similar personality rights; however, to
|
||||||
the extent possible, the Licensor waives and/or agrees not to
|
the extent possible, the Licensor waives and/or agrees not to
|
||||||
assert any such rights held by the Licensor to the limited
|
assert any such rights held by the Licensor to the limited
|
||||||
extent necessary to allow You to exercise the Licensed
|
extent necessary to allow You to exercise the Licensed
|
||||||
Rights, but not otherwise.
|
Rights, but not otherwise.
|
||||||
|
|
||||||
2. Patent and trademark rights are not licensed under this
|
2. Patent and trademark rights are not licensed under this
|
||||||
Public License.
|
Public License.
|
||||||
|
|
||||||
3. To the extent possible, the Licensor waives any right to
|
3. To the extent possible, the Licensor waives any right to
|
||||||
collect royalties from You for the exercise of the Licensed
|
collect royalties from You for the exercise of the Licensed
|
||||||
Rights, whether directly or through a collecting society
|
Rights, whether directly or through a collecting society
|
||||||
under any voluntary or waivable statutory or compulsory
|
under any voluntary or waivable statutory or compulsory
|
||||||
licensing scheme. In all other cases the Licensor expressly
|
licensing scheme. In all other cases the Licensor expressly
|
||||||
reserves any right to collect such royalties, including when
|
reserves any right to collect such royalties, including when
|
||||||
the Licensed Material is used other than for NonCommercial
|
the Licensed Material is used other than for NonCommercial
|
||||||
purposes.
|
purposes.
|
||||||
|
|
||||||
|
|
||||||
Section 3 -- License Conditions.
|
Section 3 -- License Conditions.
|
||||||
|
|
||||||
Your exercise of the Licensed Rights is expressly made subject to the
|
Your exercise of the Licensed Rights is expressly made subject to the
|
||||||
following conditions.
|
following conditions.
|
||||||
|
|
||||||
a. Attribution.
|
a. Attribution.
|
||||||
|
|
||||||
1. If You Share the Licensed Material (including in modified
|
1. If You Share the Licensed Material (including in modified
|
||||||
form), You must:
|
form), You must:
|
||||||
|
|
||||||
a. retain the following if it is supplied by the Licensor
|
a. retain the following if it is supplied by the Licensor
|
||||||
with the Licensed Material:
|
with the Licensed Material:
|
||||||
|
|
||||||
i. identification of the creator(s) of the Licensed
|
i. identification of the creator(s) of the Licensed
|
||||||
Material and any others designated to receive
|
Material and any others designated to receive
|
||||||
attribution, in any reasonable manner requested by
|
attribution, in any reasonable manner requested by
|
||||||
the Licensor (including by pseudonym if
|
the Licensor (including by pseudonym if
|
||||||
designated);
|
designated);
|
||||||
|
|
||||||
ii. a copyright notice;
|
ii. a copyright notice;
|
||||||
|
|
||||||
iii. a notice that refers to this Public License;
|
iii. a notice that refers to this Public License;
|
||||||
|
|
||||||
iv. a notice that refers to the disclaimer of
|
iv. a notice that refers to the disclaimer of
|
||||||
warranties;
|
warranties;
|
||||||
|
|
||||||
v. a URI or hyperlink to the Licensed Material to the
|
v. a URI or hyperlink to the Licensed Material to the
|
||||||
extent reasonably practicable;
|
extent reasonably practicable;
|
||||||
|
|
||||||
b. indicate if You modified the Licensed Material and
|
b. indicate if You modified the Licensed Material and
|
||||||
retain an indication of any previous modifications; and
|
retain an indication of any previous modifications; and
|
||||||
|
|
||||||
c. indicate the Licensed Material is licensed under this
|
c. indicate the Licensed Material is licensed under this
|
||||||
Public License, and include the text of, or the URI or
|
Public License, and include the text of, or the URI or
|
||||||
hyperlink to, this Public License.
|
hyperlink to, this Public License.
|
||||||
|
|
||||||
2. You may satisfy the conditions in Section 3(a)(1) in any
|
2. You may satisfy the conditions in Section 3(a)(1) in any
|
||||||
reasonable manner based on the medium, means, and context in
|
reasonable manner based on the medium, means, and context in
|
||||||
which You Share the Licensed Material. For example, it may be
|
which You Share the Licensed Material. For example, it may be
|
||||||
reasonable to satisfy the conditions by providing a URI or
|
reasonable to satisfy the conditions by providing a URI or
|
||||||
hyperlink to a resource that includes the required
|
hyperlink to a resource that includes the required
|
||||||
information.
|
information.
|
||||||
3. If requested by the Licensor, You must remove any of the
|
3. If requested by the Licensor, You must remove any of the
|
||||||
information required by Section 3(a)(1)(A) to the extent
|
information required by Section 3(a)(1)(A) to the extent
|
||||||
reasonably practicable.
|
reasonably practicable.
|
||||||
|
|
||||||
b. ShareAlike.
|
b. ShareAlike.
|
||||||
|
|
||||||
In addition to the conditions in Section 3(a), if You Share
|
In addition to the conditions in Section 3(a), if You Share
|
||||||
Adapted Material You produce, the following conditions also apply.
|
Adapted Material You produce, the following conditions also apply.
|
||||||
|
|
||||||
1. The Adapter's License You apply must be a Creative Commons
|
1. The Adapter's License You apply must be a Creative Commons
|
||||||
license with the same License Elements, this version or
|
license with the same License Elements, this version or
|
||||||
later, or a BY-NC-SA Compatible License.
|
later, or a BY-NC-SA Compatible License.
|
||||||
|
|
||||||
2. You must include the text of, or the URI or hyperlink to, the
|
2. You must include the text of, or the URI or hyperlink to, the
|
||||||
Adapter's License You apply. You may satisfy this condition
|
Adapter's License You apply. You may satisfy this condition
|
||||||
in any reasonable manner based on the medium, means, and
|
in any reasonable manner based on the medium, means, and
|
||||||
context in which You Share Adapted Material.
|
context in which You Share Adapted Material.
|
||||||
|
|
||||||
3. You may not offer or impose any additional or different terms
|
3. You may not offer or impose any additional or different terms
|
||||||
or conditions on, or apply any Effective Technological
|
or conditions on, or apply any Effective Technological
|
||||||
Measures to, Adapted Material that restrict exercise of the
|
Measures to, Adapted Material that restrict exercise of the
|
||||||
rights granted under the Adapter's License You apply.
|
rights granted under the Adapter's License You apply.
|
||||||
|
|
||||||
|
|
||||||
Section 4 -- Sui Generis Database Rights.
|
Section 4 -- Sui Generis Database Rights.
|
||||||
|
|
||||||
Where the Licensed Rights include Sui Generis Database Rights that
|
Where the Licensed Rights include Sui Generis Database Rights that
|
||||||
apply to Your use of the Licensed Material:
|
apply to Your use of the Licensed Material:
|
||||||
|
|
||||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
||||||
to extract, reuse, reproduce, and Share all or a substantial
|
to extract, reuse, reproduce, and Share all or a substantial
|
||||||
portion of the contents of the database for NonCommercial purposes
|
portion of the contents of the database for NonCommercial purposes
|
||||||
only;
|
only;
|
||||||
|
|
||||||
b. if You include all or a substantial portion of the database
|
b. if You include all or a substantial portion of the database
|
||||||
contents in a database in which You have Sui Generis Database
|
contents in a database in which You have Sui Generis Database
|
||||||
Rights, then the database in which You have Sui Generis Database
|
Rights, then the database in which You have Sui Generis Database
|
||||||
Rights (but not its individual contents) is Adapted Material,
|
Rights (but not its individual contents) is Adapted Material,
|
||||||
including for purposes of Section 3(b); and
|
including for purposes of Section 3(b); and
|
||||||
|
|
||||||
c. You must comply with the conditions in Section 3(a) if You Share
|
c. You must comply with the conditions in Section 3(a) if You Share
|
||||||
all or a substantial portion of the contents of the database.
|
all or a substantial portion of the contents of the database.
|
||||||
|
|
||||||
For the avoidance of doubt, this Section 4 supplements and does not
|
For the avoidance of doubt, this Section 4 supplements and does not
|
||||||
replace Your obligations under this Public License where the Licensed
|
replace Your obligations under this Public License where the Licensed
|
||||||
Rights include other Copyright and Similar Rights.
|
Rights include other Copyright and Similar Rights.
|
||||||
|
|
||||||
|
|
||||||
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
||||||
|
|
||||||
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
||||||
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
||||||
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
||||||
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
||||||
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
||||||
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||||
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
||||||
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
||||||
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
||||||
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
||||||
|
|
||||||
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
||||||
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
||||||
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
||||||
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
||||||
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
||||||
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
||||||
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
||||||
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
||||||
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
||||||
|
|
||||||
c. The disclaimer of warranties and limitation of liability provided
|
c. The disclaimer of warranties and limitation of liability provided
|
||||||
above shall be interpreted in a manner that, to the extent
|
above shall be interpreted in a manner that, to the extent
|
||||||
possible, most closely approximates an absolute disclaimer and
|
possible, most closely approximates an absolute disclaimer and
|
||||||
waiver of all liability.
|
waiver of all liability.
|
||||||
|
|
||||||
|
|
||||||
Section 6 -- Term and Termination.
|
Section 6 -- Term and Termination.
|
||||||
|
|
||||||
a. This Public License applies for the term of the Copyright and
|
a. This Public License applies for the term of the Copyright and
|
||||||
Similar Rights licensed here. However, if You fail to comply with
|
Similar Rights licensed here. However, if You fail to comply with
|
||||||
this Public License, then Your rights under this Public License
|
this Public License, then Your rights under this Public License
|
||||||
terminate automatically.
|
terminate automatically.
|
||||||
|
|
||||||
b. Where Your right to use the Licensed Material has terminated under
|
b. Where Your right to use the Licensed Material has terminated under
|
||||||
Section 6(a), it reinstates:
|
Section 6(a), it reinstates:
|
||||||
|
|
||||||
1. automatically as of the date the violation is cured, provided
|
1. automatically as of the date the violation is cured, provided
|
||||||
it is cured within 30 days of Your discovery of the
|
it is cured within 30 days of Your discovery of the
|
||||||
violation; or
|
violation; or
|
||||||
|
|
||||||
2. upon express reinstatement by the Licensor.
|
2. upon express reinstatement by the Licensor.
|
||||||
|
|
||||||
For the avoidance of doubt, this Section 6(b) does not affect any
|
For the avoidance of doubt, this Section 6(b) does not affect any
|
||||||
right the Licensor may have to seek remedies for Your violations
|
right the Licensor may have to seek remedies for Your violations
|
||||||
of this Public License.
|
of this Public License.
|
||||||
|
|
||||||
c. For the avoidance of doubt, the Licensor may also offer the
|
c. For the avoidance of doubt, the Licensor may also offer the
|
||||||
Licensed Material under separate terms or conditions or stop
|
Licensed Material under separate terms or conditions or stop
|
||||||
distributing the Licensed Material at any time; however, doing so
|
distributing the Licensed Material at any time; however, doing so
|
||||||
will not terminate this Public License.
|
will not terminate this Public License.
|
||||||
|
|
||||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
||||||
License.
|
License.
|
||||||
|
|
||||||
|
|
||||||
Section 7 -- Other Terms and Conditions.
|
Section 7 -- Other Terms and Conditions.
|
||||||
|
|
||||||
a. The Licensor shall not be bound by any additional or different
|
a. The Licensor shall not be bound by any additional or different
|
||||||
terms or conditions communicated by You unless expressly agreed.
|
terms or conditions communicated by You unless expressly agreed.
|
||||||
|
|
||||||
b. Any arrangements, understandings, or agreements regarding the
|
b. Any arrangements, understandings, or agreements regarding the
|
||||||
Licensed Material not stated herein are separate from and
|
Licensed Material not stated herein are separate from and
|
||||||
independent of the terms and conditions of this Public License.
|
independent of the terms and conditions of this Public License.
|
||||||
|
|
||||||
|
|
||||||
Section 8 -- Interpretation.
|
Section 8 -- Interpretation.
|
||||||
|
|
||||||
a. For the avoidance of doubt, this Public License does not, and
|
a. For the avoidance of doubt, this Public License does not, and
|
||||||
shall not be interpreted to, reduce, limit, restrict, or impose
|
shall not be interpreted to, reduce, limit, restrict, or impose
|
||||||
conditions on any use of the Licensed Material that could lawfully
|
conditions on any use of the Licensed Material that could lawfully
|
||||||
be made without permission under this Public License.
|
be made without permission under this Public License.
|
||||||
|
|
||||||
b. To the extent possible, if any provision of this Public License is
|
b. To the extent possible, if any provision of this Public License is
|
||||||
deemed unenforceable, it shall be automatically reformed to the
|
deemed unenforceable, it shall be automatically reformed to the
|
||||||
minimum extent necessary to make it enforceable. If the provision
|
minimum extent necessary to make it enforceable. If the provision
|
||||||
cannot be reformed, it shall be severed from this Public License
|
cannot be reformed, it shall be severed from this Public License
|
||||||
without affecting the enforceability of the remaining terms and
|
without affecting the enforceability of the remaining terms and
|
||||||
conditions.
|
conditions.
|
||||||
|
|
||||||
c. No term or condition of this Public License will be waived and no
|
c. No term or condition of this Public License will be waived and no
|
||||||
failure to comply consented to unless expressly agreed to by the
|
failure to comply consented to unless expressly agreed to by the
|
||||||
Licensor.
|
Licensor.
|
||||||
|
|
||||||
d. Nothing in this Public License constitutes or may be interpreted
|
d. Nothing in this Public License constitutes or may be interpreted
|
||||||
as a limitation upon, or waiver of, any privileges and immunities
|
as a limitation upon, or waiver of, any privileges and immunities
|
||||||
that apply to the Licensor or You, including from the legal
|
that apply to the Licensor or You, including from the legal
|
||||||
processes of any jurisdiction or authority.
|
processes of any jurisdiction or authority.
|
||||||
|
|
||||||
=======================================================================
|
=======================================================================
|
||||||
|
|
||||||
Creative Commons is not a party to its public
|
Creative Commons is not a party to its public
|
||||||
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
||||||
its public licenses to material it publishes and in those instances
|
its public licenses to material it publishes and in those instances
|
||||||
will be considered the “Licensor.” The text of the Creative Commons
|
will be considered the “Licensor.” The text of the Creative Commons
|
||||||
public licenses is dedicated to the public domain under the CC0 Public
|
public licenses is dedicated to the public domain under the CC0 Public
|
||||||
Domain Dedication. Except for the limited purpose of indicating that
|
Domain Dedication. Except for the limited purpose of indicating that
|
||||||
material is shared under a Creative Commons public license or as
|
material is shared under a Creative Commons public license or as
|
||||||
otherwise permitted by the Creative Commons policies published at
|
otherwise permitted by the Creative Commons policies published at
|
||||||
creativecommons.org/policies, Creative Commons does not authorize the
|
creativecommons.org/policies, Creative Commons does not authorize the
|
||||||
use of the trademark "Creative Commons" or any other trademark or logo
|
use of the trademark "Creative Commons" or any other trademark or logo
|
||||||
of Creative Commons without its prior written consent including,
|
of Creative Commons without its prior written consent including,
|
||||||
without limitation, in connection with any unauthorized modifications
|
without limitation, in connection with any unauthorized modifications
|
||||||
to any of its public licenses or any other arrangements,
|
to any of its public licenses or any other arrangements,
|
||||||
understandings, or agreements concerning use of licensed material. For
|
understandings, or agreements concerning use of licensed material. For
|
||||||
the avoidance of doubt, this paragraph does not form part of the
|
the avoidance of doubt, this paragraph does not form part of the
|
||||||
public licenses.
|
public licenses.
|
||||||
|
|
||||||
Creative Commons may be contacted at creativecommons.org.
|
Creative Commons may be contacted at creativecommons.org.
|
|
@ -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);
|
||||||
|
|
204
client/NYX.js
204
client/NYX.js
|
@ -1,102 +1,102 @@
|
||||||
const {
|
const {
|
||||||
Client,
|
Client,
|
||||||
Collection,
|
Collection,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
GatewayIntentBits,
|
GatewayIntentBits,
|
||||||
Partials,
|
Partials,
|
||||||
} = require("discord.js");
|
} = require("discord.js");
|
||||||
const config = require("../config");
|
const config = require("../config");
|
||||||
require("dotenv").config();
|
require("dotenv").config();
|
||||||
|
|
||||||
class NYX extends Client {
|
class NYX extends Client {
|
||||||
/**
|
/**
|
||||||
* @param {Client.options} options
|
* @param {Client.options} options
|
||||||
*/
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
options = {
|
options = {
|
||||||
presence: {
|
presence: {
|
||||||
activities: [
|
activities: [
|
||||||
{
|
{
|
||||||
name: `/help`,
|
name: `/help`,
|
||||||
type: 1,
|
type: 1,
|
||||||
url: "https://www.youtube.com/watch?v=YSKDu1gKntY",
|
url: "https://www.youtube.com/watch?v=YSKDu1gKntY",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
shards: "auto",
|
shards: "auto",
|
||||||
partials: [
|
partials: [
|
||||||
Partials.Message,
|
Partials.Message,
|
||||||
Partials.Channel,
|
Partials.Channel,
|
||||||
Partials.Reaction,
|
Partials.Reaction,
|
||||||
Partials.GuildMember,
|
Partials.GuildMember,
|
||||||
],
|
],
|
||||||
intents: [
|
intents: [
|
||||||
GatewayIntentBits.Guilds,
|
GatewayIntentBits.Guilds,
|
||||||
// GatewayIntentBits.GuildMembers,
|
GatewayIntentBits.GuildMembers,
|
||||||
// GatewayIntentBits.MessageContent,
|
// GatewayIntentBits.MessageContent,
|
||||||
GatewayIntentBits.GuildMessages,
|
GatewayIntentBits.GuildMessages,
|
||||||
GatewayIntentBits.DirectMessageTyping,
|
GatewayIntentBits.DirectMessageTyping,
|
||||||
GatewayIntentBits.DirectMessages,
|
GatewayIntentBits.DirectMessages,
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
super(options);
|
super(options);
|
||||||
this.slashCommands = new Collection();
|
this.slashCommands = new Collection();
|
||||||
this.hide = new Collection();
|
this.hide = new Collection();
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.data = require("../util/functions/mongoose");
|
this.data = require("../util/functions/mongoose");
|
||||||
this.color = config.color;
|
this.color = config.color;
|
||||||
this.author = "Team NYX";
|
this.author = "Team NYX";
|
||||||
this.invite = "https://discord.gg/SbQHChmGcp";
|
this.invite = "https://discord.gg/SbQHChmGcp";
|
||||||
this.docs = "https://thunder75.gitbook.io/nyx/";
|
this.docs = "https://thunder75.gitbook.io/nyx/";
|
||||||
this.web = config.URL;
|
this.web = config.URL;
|
||||||
this.owners = [
|
this.owners = [
|
||||||
"452076196419600394", // Night
|
"452076196419600394", // Night
|
||||||
"534027706325532694", // Cat drinking a cat
|
"534027706325532694", // Cat drinking a cat
|
||||||
"381442059111759883", // Thunder
|
"381442059111759883", // Thunder
|
||||||
"556808365574193194", // chunchunmaru
|
"556808365574193194", // chunchunmaru
|
||||||
"687622268037365774", // Tac Shadow
|
"687622268037365774", // Tac Shadow
|
||||||
"309681798957498368", // Sideload
|
"309681798957498368", // Sideload
|
||||||
"707177879984668673", // Random rock
|
"707177879984668673", // Random rock
|
||||||
"757530324686340197", // Madhav
|
"757530324686340197", // Madhav
|
||||||
"804712098625486848", // hcs
|
"804712098625486848", // hcs
|
||||||
"1078015817184182414", // gaba
|
"1078015817184182414", // gaba
|
||||||
"774390900411465769" // Alphaus
|
"774390900411465769", // Alphaus
|
||||||
];
|
];
|
||||||
this.currency = "<:nyx_currency:918584872333893703>";
|
this.currency = "<:nyx_currency:918584872333893703>";
|
||||||
this.xp = "<:nyx_xp:900309007472926720>";
|
this.xp = "<:nyx_xp:900309007472926720>";
|
||||||
this.dev = "<:discord_bot_dev:840231906200387666>"
|
this.dev = "<:discord_bot_dev:840231906200387666>";
|
||||||
this.path = [
|
this.path = [
|
||||||
"614423108388126731", // Camper on Duty
|
"614423108388126731", // Camper on Duty
|
||||||
"767173194943168542", // Dark Bonker
|
"767173194943168542", // Dark Bonker
|
||||||
"718762019586572341", // NYX Nation
|
"718762019586572341", // NYX Nation
|
||||||
"840225563193114624", // Command Test
|
"840225563193114624", // Command Test
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
require("../util/dist/handler")(this);
|
require("../util/dist/handler")(this);
|
||||||
this.login(
|
this.login(
|
||||||
process.argv[2] == "--dev" ? process.env.DEV : process.env.TOKEN
|
process.argv[2] == "--dev" ? process.env.DEV : process.env.TOKEN
|
||||||
);
|
);
|
||||||
this.data
|
this.data
|
||||||
.connect(process.env.MONGO)
|
.connect(process.env.MONGO)
|
||||||
.then(() => console.log("Connected to MongoDB ✅"))
|
.then(() => console.log("Connected to MongoDB ✅"))
|
||||||
.catch(e => console.log(e));
|
.catch(e => console.log(e));
|
||||||
}
|
}
|
||||||
err(interaction, error) {
|
err(interaction, error) {
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle("An Error Occured")
|
.setTitle("An Error Occured")
|
||||||
.setColor("Red")
|
.setColor("Red")
|
||||||
.setDescription(`❌ | ${error}`)
|
.setDescription(`❌ | ${error}`)
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${this.author}`,
|
text: `Made by ${this.author}`,
|
||||||
iconURL: this.user.displayAvatarURL({ dynamic: true }),
|
iconURL: this.user.displayAvatarURL({ dynamic: true }),
|
||||||
});
|
});
|
||||||
interaction.channel.send({ embeds: [embed] });
|
interaction.channel.send({ embeds: [embed] });
|
||||||
this.channels.cache.get(this.config.ErrorLog).send({ embeds: [embed] });
|
this.channels.cache.get(this.config.ErrorLog).send({ embeds: [embed] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = NYX;
|
module.exports = NYX;
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,55 +1,55 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { EmbedBuilder } = 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 weapons = d.Primary[0][d.Categories.random()];
|
||||||
return `${weapons.random()}`;
|
return `${weapons.random()}`;
|
||||||
};
|
};
|
||||||
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 EmbedBuilder()
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setTitle(`🎲 A Randomly Generated Class for ${primary_weapon} 🎲`)
|
.setTitle(`🎲 A Randomly Generated Class for ${primary_weapon} 🎲`)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Attachments**\n**${getAttachment(
|
`**Attachments**\n**${getAttachment(
|
||||||
primary,
|
primary,
|
||||||
slot_1
|
slot_1
|
||||||
)}**\n**${getAttachment(primary, slot_2)}**\n**${getAttachment(
|
)}**\n**${getAttachment(primary, slot_2)}**\n**${getAttachment(
|
||||||
primary,
|
primary,
|
||||||
slot_3
|
slot_3
|
||||||
)}**\n**${getAttachment(primary, slot_4)}**\n**${getAttachment(
|
)}**\n**${getAttachment(primary, slot_4)}**\n**${getAttachment(
|
||||||
primary,
|
primary,
|
||||||
slot_5
|
slot_5
|
||||||
)}**`
|
)}**`
|
||||||
)
|
)
|
||||||
.setURL(client.web)
|
.setURL(client.web)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: 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.random();
|
return ca.random();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -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 +1,74 @@
|
||||||
const { EmbedBuilder } = require("discord.js"); //@night0721 You need to make this
|
const { EmbedBuilder } = 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: "loadout",
|
name: "loadout",
|
||||||
description: "Generate A Random Loadout",
|
description: "Generate A Random Loadout",
|
||||||
category: "CODM",
|
category: "CODM",
|
||||||
run: async (client, interaction) => {
|
run: async (client, interaction) => {
|
||||||
const secondary =
|
const secondary =
|
||||||
items.secondary[Math.floor(Math.random() * items.secondary.length)];
|
items.secondary[Math.floor(Math.random() * items.secondary.length)];
|
||||||
const red = items.perk_1[Math.floor(Math.random() * items.perk_1.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 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 blue = items.perk_3[Math.floor(Math.random() * items.perk_3.length)];
|
||||||
const operator =
|
const operator =
|
||||||
items.operator_skill[
|
items.operator_skill[
|
||||||
Math.floor(Math.random() * items.operator_skill.length)
|
Math.floor(Math.random() * items.operator_skill.length)
|
||||||
];
|
];
|
||||||
const slots = shuffle(items.scorestreak);
|
const slots = shuffle(items.scorestreak);
|
||||||
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;
|
||||||
const result = new EmbedBuilder()
|
const result = new EmbedBuilder()
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.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, \`\`\`/class\`\`\` to get a randomally generated primary weapon gunsmith build`
|
||||||
)
|
)
|
||||||
.addFields(
|
.addFields(
|
||||||
{
|
{
|
||||||
name: "Secondary Weapon",
|
name: "Secondary Weapon",
|
||||||
value: secondary,
|
value: secondary,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Operator Skill",
|
name: "Operator Skill",
|
||||||
value: operator,
|
value: operator,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Scorestreak",
|
name: "Scorestreak",
|
||||||
value: `${slot_1}\n${slot_2}\n${slot_3}`,
|
value: `${slot_1}\n${slot_2}\n${slot_3}`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Red Perk",
|
name: "Red Perk",
|
||||||
value: red,
|
value: red,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Green Perk",
|
name: "Green Perk",
|
||||||
value: green,
|
value: green,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Blue Perk",
|
name: "Blue Perk",
|
||||||
value: blue,
|
value: blue,
|
||||||
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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,198 +1,198 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { EmbedBuilder } = 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",
|
||||||
|
|
||||||
usage: "{Perk}",
|
usage: "{Perk}",
|
||||||
category: "CODM",
|
category: "CODM",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 1,
|
type: 1,
|
||||||
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: 1,
|
||||||
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: 1,
|
||||||
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 EmbedBuilder()
|
||||||
.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({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setTitle(d.perk)
|
.setTitle(d.perk)
|
||||||
.addFields({ name: "Effects", value: d.effects });
|
.addFields({ name: "Effects", value: d.effects });
|
||||||
interaction.followUp({ embeds: [embed] });
|
interaction.followUp({ embeds: [embed] });
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,169 +1,169 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { EmbedBuilder } = 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}",
|
usage: "{Scorestreak}",
|
||||||
category: "CODM",
|
category: "CODM",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 1,
|
type: 1,
|
||||||
name: "lethal",
|
name: "lethal",
|
||||||
description: "Lethal Scorestreak",
|
description: "Lethal Scorestreak",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "scorestreak",
|
name: "scorestreak",
|
||||||
description: "Select a lethal scorestreak",
|
description: "Select a lethal scorestreak",
|
||||||
required: true,
|
required: true,
|
||||||
choices: [
|
choices: [
|
||||||
{
|
{
|
||||||
name: "Shield Turret",
|
name: "Shield Turret",
|
||||||
value: "shieldturret",
|
value: "shieldturret",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Hunter Killer Drone",
|
name: "Hunter Killer Drone",
|
||||||
value: "hunterkillerdrone",
|
value: "hunterkillerdrone",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "MQ-27 Dragonfire",
|
name: "MQ-27 Dragonfire",
|
||||||
value: "mq27dragonfire",
|
value: "mq27dragonfire",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Predator Missile",
|
name: "Predator Missile",
|
||||||
value: "predatormissile",
|
value: "predatormissile",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Hawk X3",
|
name: "Hawk X3",
|
||||||
value: "hawkx3",
|
value: "hawkx3",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Sentry Gun",
|
name: "Sentry Gun",
|
||||||
value: "sentrygun",
|
value: "sentrygun",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Lightning Strike",
|
name: "Lightning Strike",
|
||||||
value: "lightningstrike",
|
value: "lightningstrike",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Orbital Laser",
|
name: "Orbital Laser",
|
||||||
value: "orbitallaser",
|
value: "orbitallaser",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "XS1 Goliath",
|
name: "XS1 Goliath",
|
||||||
value: "xs1goliath",
|
value: "xs1goliath",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Cluster Strike",
|
name: "Cluster Strike",
|
||||||
value: "clusterstrike",
|
value: "clusterstrike",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Chopper Gunner",
|
name: "Chopper Gunner",
|
||||||
value: "choppergunner",
|
value: "choppergunner",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Stealth Chopper",
|
name: "Stealth Chopper",
|
||||||
value: "stealthchopper",
|
value: "stealthchopper",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Swarm",
|
name: "Swarm",
|
||||||
value: "swarm",
|
value: "swarm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Napalm",
|
name: "Napalm",
|
||||||
value: "napalm",
|
value: "napalm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "VTOL",
|
name: "VTOL",
|
||||||
value: "vtol",
|
value: "vtol",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 1,
|
type: 1,
|
||||||
name: "support",
|
name: "support",
|
||||||
description: "Support Scorestreak",
|
description: "Support Scorestreak",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "scorestreak",
|
name: "scorestreak",
|
||||||
description: "Select a Support Scorestreak",
|
description: "Select a Support Scorestreak",
|
||||||
required: true,
|
required: true,
|
||||||
choices: [
|
choices: [
|
||||||
{
|
{
|
||||||
name: "UAV",
|
name: "UAV",
|
||||||
value: "uav",
|
value: "uav",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Shock RC",
|
name: "Shock RC",
|
||||||
value: "shockrc",
|
value: "shockrc",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Care Package",
|
name: "Care Package",
|
||||||
value: "carepackage",
|
value: "carepackage",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Counter UAV",
|
name: "Counter UAV",
|
||||||
value: "cuav",
|
value: "cuav",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "SAM Turret",
|
name: "SAM Turret",
|
||||||
value: "samturret",
|
value: "samturret",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Advance UAV",
|
name: "Advance UAV",
|
||||||
value: "auav",
|
value: "auav",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "EMP Systems",
|
name: "EMP Systems",
|
||||||
value: "empsystems",
|
value: "empsystems",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction, args) => {
|
run: async (client, interaction, args) => {
|
||||||
const val = args[1];
|
const val = args[1];
|
||||||
const d = await c.getscorestreak(val);
|
const d = await c.getscorestreak(val);
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle(d.name)
|
.setTitle(d.name)
|
||||||
.setURL(d.preview_video)
|
.setURL(d.preview_video)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`<:nyx_description:897379659665264650> **Description** \`\`\`\n${d.description}\`\`\``
|
`<:nyx_description:897379659665264650> **Description** \`\`\`\n${d.description}\`\`\``
|
||||||
)
|
)
|
||||||
.addFields(
|
.addFields(
|
||||||
{
|
{
|
||||||
name: "Cost",
|
name: "Cost",
|
||||||
value: `${d.cost}`,
|
value: `${d.cost}`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "AI-Assisted",
|
name: "AI-Assisted",
|
||||||
value: `
|
value: `
|
||||||
${
|
${
|
||||||
d.manual
|
d.manual
|
||||||
? "<a:nyx_cross:897244999211696198> No"
|
? "<a:nyx_cross:897244999211696198> No"
|
||||||
: "<a:nyx_checkmark:897240322411724841> Yes"
|
: "<a:nyx_checkmark:897240322411724841> Yes"
|
||||||
}`,
|
}`,
|
||||||
inline: true,
|
inline: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.setThumbnail(d.preview)
|
.setThumbnail(d.preview)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setColor(
|
.setColor(
|
||||||
d.type == "lethal"
|
d.type == "lethal"
|
||||||
? "FF2222"
|
? "FF2222"
|
||||||
: d.type == "assist"
|
: d.type == "assist"
|
||||||
? "22FF4A"
|
? "22FF4A"
|
||||||
: client.color
|
: client.color
|
||||||
)
|
)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
interaction.followUp({ embeds: [embed] });
|
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,297 @@
|
||||||
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 { EmbedBuilder } = 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 = {
|
module.exports = {
|
||||||
name: "stats",
|
name: "stats",
|
||||||
description: "Check gun stats",
|
description: "Check gun stats",
|
||||||
usage: "(Gun)",
|
usage: "(Gun)",
|
||||||
category: "CODM",
|
category: "CODM",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "gun_name",
|
name: "gun_name",
|
||||||
description: "Name of the gun",
|
description: "Name of the gun",
|
||||||
required: true,
|
required: true,
|
||||||
choices: [],
|
choices: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "1st_attchment",
|
name: "1st_attchment",
|
||||||
description: "First attachment",
|
description: "First attachment",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "2nd_attchment",
|
name: "2nd_attchment",
|
||||||
description: "Second attachment",
|
description: "Second attachment",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "3rd_attchment",
|
name: "3rd_attchment",
|
||||||
description: "Third attachment",
|
description: "Third attachment",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "4th_attchment",
|
name: "4th_attchment",
|
||||||
description: "Forth attachment",
|
description: "Forth attachment",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "5th_attchment",
|
name: "5th_attchment",
|
||||||
description: "Fifth attachment",
|
description: "Fifth attachment",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction, args) => {
|
run: async (client, interaction, args) => {
|
||||||
repEmb = null;
|
repEmb = null;
|
||||||
recoilAvailable = false;
|
recoilAvailable = false;
|
||||||
hasError = false;
|
hasError = false;
|
||||||
if (args.length == 1)
|
if (args.length == 1)
|
||||||
repEmb = statsHandler(args.join(" ").replace("\n", " "));
|
repEmb = statsHandler(args.join(" ").replace("\n", " "));
|
||||||
else repEmb = statsHandler(args.join(" + ").replace("\n", " "));
|
else repEmb = statsHandler(args.join(" + ").replace("\n", " "));
|
||||||
if (hasError) {
|
if (hasError) {
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `**${repEmb || "An error has occured"}**`,
|
content: `**${repEmb || "An error has occured"}**`,
|
||||||
});
|
});
|
||||||
} 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 EmbedBuilder(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", //0
|
"Pellets", //0
|
||||||
"Detonation Range", //1
|
"Detonation Range", //1
|
||||||
"Explosion Radius", //2
|
"Explosion Radius", //2
|
||||||
"Explosion Damage", //3
|
"Explosion Damage", //3
|
||||||
"Firing Mode", //4
|
"Firing Mode", //4
|
||||||
"Rate of Fire", //5
|
"Rate of Fire", //5
|
||||||
"Bullet in Burst", //6
|
"Bullet in Burst", //6
|
||||||
"Time Between Burst", //7
|
"Time Between Burst", //7
|
||||||
"Bullet Speed", //8
|
"Bullet Speed", //8
|
||||||
"Penetration Level", //9
|
"Penetration Level", //9
|
||||||
"Bullet Spread", //10
|
"Bullet Spread", //10
|
||||||
"Idle Sway", //11
|
"Idle Sway", //11
|
||||||
"Hipfire Pellet Spread", //12
|
"Hipfire Pellet Spread", //12
|
||||||
"ADS Pellet Spread", //13
|
"ADS Pellet Spread", //13
|
||||||
"ADS Time", //14
|
"ADS Time", //14
|
||||||
"Sprint-to-Fire Time", //15
|
"Sprint-to-Fire Time", //15
|
||||||
"ADS Zoom", //16
|
"ADS Zoom", //16
|
||||||
"Magazine", //17
|
"Magazine", //17
|
||||||
"Reserve", //18
|
"Reserve", //18
|
||||||
"Reload Type", //19
|
"Reload Type", //19
|
||||||
"Cancel Reload Time", //20
|
"Cancel Reload Time", //20
|
||||||
"Reload Time", //21
|
"Reload Time", //21
|
||||||
"Full Reload Time", //22
|
"Full Reload Time", //22
|
||||||
"Drop Time", //23
|
"Drop Time", //23
|
||||||
"Raise Time", //24
|
"Raise Time", //24
|
||||||
"Sprinting Speed", //25
|
"Sprinting Speed", //25
|
||||||
"Walking Speed", //26
|
"Walking Speed", //26
|
||||||
"Straifing Speed", //27
|
"Straifing Speed", //27
|
||||||
"Damage per Tick", //28
|
"Damage per Tick", //28
|
||||||
"Number of Ticks", //29
|
"Number of Ticks", //29
|
||||||
"Time Between Ticks", //30
|
"Time Between Ticks", //30
|
||||||
"Breath Hold Time", //31
|
"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 7:
|
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 25:
|
case 25:
|
||||||
case 26:
|
case 26:
|
||||||
case 27:
|
case 27:
|
||||||
case 28:
|
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 6:
|
case 6:
|
||||||
return " Rounds";
|
return " Rounds";
|
||||||
case 5:
|
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 recoilAvailable = false;
|
} else recoilAvailable = false;
|
||||||
|
|
||||||
if (chart == "none") recoilAvailable = false;
|
if (chart == "none") recoilAvailable = false;
|
||||||
if (chart == "err") hasError = true;
|
if (chart == "err") hasError = true;
|
||||||
|
|
||||||
const dmg =
|
const dmg =
|
||||||
common.damageHandler(
|
common.damageHandler(
|
||||||
currDRM.damage,
|
currDRM.damage,
|
||||||
currDRM.range,
|
currDRM.range,
|
||||||
1,
|
1,
|
||||||
100,
|
100,
|
||||||
60000 / currStats[5],
|
60000 / currStats[5],
|
||||||
currStats[7],
|
currStats[7],
|
||||||
currStats[6],
|
currStats[6],
|
||||||
currStats[0]
|
currStats[0]
|
||||||
) || "```This should never happen```";
|
) || "```This should never happen```";
|
||||||
out = [
|
out = [
|
||||||
currGun.description
|
currGun.description
|
||||||
? {
|
? {
|
||||||
name: "**Description:**",
|
name: "**Description:**",
|
||||||
value: `\`\`\`\n${currGun.description}\`\`\``,
|
value: `\`\`\`\n${currGun.description}\`\`\``,
|
||||||
}
|
}
|
||||||
: {},
|
: {},
|
||||||
{ name: "**Damage Profile:**", value: dmg },
|
{ name: "**Damage Profile:**", value: dmg },
|
||||||
...out,
|
...out,
|
||||||
];
|
];
|
||||||
out = out.filter(x => x.value);
|
out = out.filter(x => x.value);
|
||||||
return {
|
return {
|
||||||
title: interpretion,
|
title: interpretion,
|
||||||
color: 5814783,
|
color: 5814783,
|
||||||
fields: out,
|
fields: out,
|
||||||
footer: {
|
footer: {
|
||||||
text: "[OUTDATED] All data courtesy of Project Lighthouse 2.0 and CoDM Research Crew",
|
text: "[OUTDATED] All data courtesy of Project Lighthouse 2.0 and CoDM Research Crew",
|
||||||
icon_url:
|
icon_url:
|
||||||
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png",
|
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,128 +1,128 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { EmbedBuilder } = 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")) {
|
||||||
if (guild.Premium) {
|
if (guild.Premium) {
|
||||||
return interaction.followUp({
|
return interaction.followUp({
|
||||||
content: "This server is already premium",
|
content: "This server is already premium",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
(user.Tier == 1 && user.PremiumServers.length >= 5) ||
|
(user.Tier == 1 && user.PremiumServers.length >= 5) ||
|
||||||
(user.Tier == 2 && user.PremiumServers.length >= 2) ||
|
(user.Tier == 2 && user.PremiumServers.length >= 2) ||
|
||||||
(user.Tier == 3 && user.PremiumServers.length >= 0)
|
(user.Tier == 3 && user.PremiumServers.length >= 0)
|
||||||
) {
|
) {
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content:
|
content:
|
||||||
"You have already reached the maximum amount of premium servers",
|
"You have already reached the maximum amount of premium servers",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
await client.data.setPremium(interaction.guild.id, "true");
|
await client.data.setPremium(interaction.guild.id, "true");
|
||||||
await client.data.pushGuild(
|
await client.data.pushGuild(
|
||||||
interaction.user.id,
|
interaction.user.id,
|
||||||
interaction.guild.id,
|
interaction.guild.id,
|
||||||
"push"
|
"push"
|
||||||
);
|
);
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setTitle("Success!")
|
.setTitle("Success!")
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`Premium added to **${interaction.guild.name}**! \n`
|
`Premium added to **${interaction.guild.name}**! \n`
|
||||||
)
|
)
|
||||||
.setFooter({ text: "Thank you for supporting Cath!" })
|
.setFooter({ text: "Thank you for supporting Cath!" })
|
||||||
.setColor("Green")
|
.setColor("Green")
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.user.tag,
|
name: interaction.user.tag,
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
client.channels.cache.get(client.config.ServerLog).send({
|
client.channels.cache.get(client.config.ServerLog).send({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setTitle("New Premium Server")
|
.setTitle("New Premium Server")
|
||||||
.addFields({
|
.addFields({
|
||||||
name: "Server Info",
|
name: "Server Info",
|
||||||
value: `**>Server Name**: \n${interaction.guild.name}
|
value: `**>Server Name**: \n${interaction.guild.name}
|
||||||
**>Server ID**: \n${interaction.guild.id}
|
**>Server ID**: \n${interaction.guild.id}
|
||||||
**>Server Member Count**: \n${interaction.guild.memberCount}`,
|
**>Server Member Count**: \n${interaction.guild.memberCount}`,
|
||||||
})
|
})
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setThumbnail(interaction.guild.iconURL({ dynamic: true }))
|
.setThumbnail(interaction.guild.iconURL({ dynamic: true }))
|
||||||
.setColor("Green"),
|
.setColor("Green"),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!guild.Premium) {
|
if (!guild.Premium) {
|
||||||
return interaction.followUp({
|
return interaction.followUp({
|
||||||
content: "This server isn't premium yet",
|
content: "This server isn't premium yet",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!user.PremiumServers.includes(interaction.guild.id)) {
|
if (!user.PremiumServers.includes(interaction.guild.id)) {
|
||||||
return interaction.followUp({
|
return interaction.followUp({
|
||||||
content:
|
content:
|
||||||
"You can't remove due to you aren't the person who made the server premium",
|
"You can't remove due to you aren't the person who made the server premium",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
await client.data.setPremium(interaction.guild.id, "false");
|
await client.data.setPremium(interaction.guild.id, "false");
|
||||||
await client.data.pushGuild(
|
await client.data.pushGuild(
|
||||||
interaction.user.id,
|
interaction.user.id,
|
||||||
interaction.guild.id,
|
interaction.guild.id,
|
||||||
"splice"
|
"splice"
|
||||||
);
|
);
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setTitle("Removed!")
|
.setTitle("Removed!")
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`Premium removed from **${interaction.guild.name}**! \n`
|
`Premium removed from **${interaction.guild.name}**! \n`
|
||||||
)
|
)
|
||||||
.setColor("Red")
|
.setColor("Red")
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.user.tag,
|
name: interaction.user.tag,
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
client.channels.cache.get(client.config.ServerLog).send({
|
client.channels.cache.get(client.config.ServerLog).send({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setTitle("Premium Server Removed")
|
.setTitle("Premium Server Removed")
|
||||||
.addFields({
|
.addFields({
|
||||||
name: "Server Info",
|
name: "Server Info",
|
||||||
value: `**>Server Name**: \n${interaction.guild.name}
|
value: `**>Server Name**: \n${interaction.guild.name}
|
||||||
**>Server ID**: \n${interaction.guild.id}
|
**>Server ID**: \n${interaction.guild.id}
|
||||||
**>Server Member Count**: \n${interaction.guild.memberCount}`,
|
**>Server Member Count**: \n${interaction.guild.memberCount}`,
|
||||||
})
|
})
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setThumbnail(interaction.guild.iconURL({ dynamic: true }))
|
.setThumbnail(interaction.guild.iconURL({ dynamic: true }))
|
||||||
.setColor("Red"),
|
.setColor("Red"),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
interaction.followUp({ content: `**Error**: ${e.message}` });
|
interaction.followUp({ content: `**Error**: ${e.message}` });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,246 +1,246 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { EmbedBuilder } = require("discord.js");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "settings",
|
name: "settings",
|
||||||
description: "Configure settings for the server",
|
description: "Configure settings for the server",
|
||||||
UserPerms: ["ADMINISTRATOR"],
|
UserPerms: ["ADMINISTRATOR"],
|
||||||
category: "Config",
|
category: "Config",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 2,
|
type: 2,
|
||||||
name: "enable",
|
name: "enable",
|
||||||
description: "Enable commands/category for the server",
|
description: "Enable commands/category for the server",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 1,
|
type: 1,
|
||||||
name: "command",
|
name: "command",
|
||||||
description: "To enable commands",
|
description: "To enable commands",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "name",
|
name: "name",
|
||||||
description: "The command name to be enabled",
|
description: "The command name to be enabled",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 1,
|
type: 1,
|
||||||
name: "category",
|
name: "category",
|
||||||
description: "To enable categories",
|
description: "To enable categories",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "name",
|
name: "name",
|
||||||
description: "The category name to be enabled",
|
description: "The category name to be enabled",
|
||||||
required: true,
|
required: true,
|
||||||
choices: [
|
choices: [
|
||||||
{
|
{
|
||||||
name: "codm",
|
name: "codm",
|
||||||
value: "CODM",
|
value: "CODM",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "config",
|
name: "config",
|
||||||
value: "Config",
|
value: "Config",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "information",
|
name: "information",
|
||||||
value: "Information",
|
value: "Information",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "utilities",
|
name: "utilities",
|
||||||
value: "Utilities",
|
value: "Utilities",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 2,
|
type: 2,
|
||||||
name: "disable",
|
name: "disable",
|
||||||
description: "Disable commands/category for the server",
|
description: "Disable commands/category for the server",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 1,
|
type: 1,
|
||||||
name: "command",
|
name: "command",
|
||||||
description: "To disable commands",
|
description: "To disable commands",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "name",
|
name: "name",
|
||||||
description: "The command name to be disabled",
|
description: "The command name to be disabled",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 1,
|
type: 1,
|
||||||
name: "category",
|
name: "category",
|
||||||
description: "To disable categories",
|
description: "To disable categories",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "name",
|
name: "name",
|
||||||
description: "The category name to be disabled",
|
description: "The category name to be disabled",
|
||||||
required: true,
|
required: true,
|
||||||
choices: [
|
choices: [
|
||||||
{
|
{
|
||||||
name: "codm",
|
name: "codm",
|
||||||
value: "CODM",
|
value: "CODM",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "config",
|
name: "config",
|
||||||
value: "Config",
|
value: "Config",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "information",
|
name: "information",
|
||||||
value: "Information",
|
value: "Information",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "utilities",
|
name: "utilities",
|
||||||
value: "Utilities",
|
value: "Utilities",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 1,
|
type: 1,
|
||||||
name: "tips",
|
name: "tips",
|
||||||
description: "Configure tips settings for the server",
|
description: "Configure tips settings for the server",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 5,
|
type: 5,
|
||||||
name: "choice",
|
name: "choice",
|
||||||
description: "Set whether tips system is activated for the server",
|
description: "Set whether tips system is activated for the server",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 1,
|
type: 1,
|
||||||
name: "overall",
|
name: "overall",
|
||||||
description: "See overall settings for the server",
|
description: "See overall settings for the server",
|
||||||
options: [],
|
options: [],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction, args, utils, data) => {
|
run: async (client, interaction, args, utils, data) => {
|
||||||
if (args[0].toLowerCase() === "tips") {
|
if (args[0].toLowerCase() === "tips") {
|
||||||
if (args[1]) {
|
if (args[1]) {
|
||||||
await client.data.setTips(interaction.guild.id, "true");
|
await client.data.setTips(interaction.guild.id, "true");
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `Tips is enabled in this server now.`,
|
content: `Tips is enabled in this server now.`,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
await client.data.setTips(interaction.guild.id, "false");
|
await client.data.setTips(interaction.guild.id, "false");
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `Tips is disabled in this server now.`,
|
content: `Tips is disabled in this server now.`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (args[0].toLowerCase() === "enable") {
|
} else if (args[0].toLowerCase() === "enable") {
|
||||||
const type = args[1].toLowerCase();
|
const type = args[1].toLowerCase();
|
||||||
const name = args[2].toLowerCase();
|
const name = args[2].toLowerCase();
|
||||||
if (type === "command") {
|
if (type === "command") {
|
||||||
if (!!client.slashCommands.get(name) === false) {
|
if (!!client.slashCommands.get(name) === false) {
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `There isn't any command/category named \`${name}\``,
|
content: `There isn't any command/category named \`${name}\``,
|
||||||
});
|
});
|
||||||
} else if (!data.Guild.Commands.includes(name)) {
|
} else if (!data.Guild.Commands.includes(name)) {
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `\`${args[2]}\` command had already been enabled`,
|
content: `\`${args[2]}\` command had already been enabled`,
|
||||||
});
|
});
|
||||||
} else if (
|
} else if (
|
||||||
data.Guild.Commands.includes(name) &&
|
data.Guild.Commands.includes(name) &&
|
||||||
!!client.slashCommands.get(name) === true
|
!!client.slashCommands.get(name) === true
|
||||||
) {
|
) {
|
||||||
await client.data.enable(interaction.guild.id, "command", name);
|
await client.data.enable(interaction.guild.id, "command", name);
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `\`${args[2]}\` command is now enabled`,
|
content: `\`${args[2]}\` command is now enabled`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type === "category") {
|
if (type === "category") {
|
||||||
const category = fs.readdirSync("./command");
|
const category = fs.readdirSync("./command");
|
||||||
if (!data.Guild.Category.includes(args[2])) {
|
if (!data.Guild.Category.includes(args[2])) {
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `\`${args[2]}\` category had already been enabled`,
|
content: `\`${args[2]}\` category had already been enabled`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
data.Guild.Category.includes(args[2]) &&
|
data.Guild.Category.includes(args[2]) &&
|
||||||
category.includes(args[2])
|
category.includes(args[2])
|
||||||
) {
|
) {
|
||||||
await client.data.enable(interaction.guild.id, "category", args[2]);
|
await client.data.enable(interaction.guild.id, "category", args[2]);
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `\`${args[2]}\` category is now enabled`,
|
content: `\`${args[2]}\` category is now enabled`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (args[0].toLowerCase() === "disable") {
|
} else if (args[0].toLowerCase() === "disable") {
|
||||||
const type = args[1].toLowerCase();
|
const type = args[1].toLowerCase();
|
||||||
const name = args[2].toLowerCase();
|
const name = args[2].toLowerCase();
|
||||||
if (type === "command") {
|
if (type === "command") {
|
||||||
if (!!client.slashCommands.get(name) === false) {
|
if (!!client.slashCommands.get(name) === false) {
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `There isn't any command/category named \`${name}\``,
|
content: `There isn't any command/category named \`${name}\``,
|
||||||
});
|
});
|
||||||
} else if (data.Guild.Commands.includes(name)) {
|
} else if (data.Guild.Commands.includes(name)) {
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `\`${args[2]}\` command had already been disabled`,
|
content: `\`${args[2]}\` command had already been disabled`,
|
||||||
});
|
});
|
||||||
} else if (
|
} else if (
|
||||||
!data.Guild.Commands.includes(name) &&
|
!data.Guild.Commands.includes(name) &&
|
||||||
!!client.slashCommands.get(name) === true
|
!!client.slashCommands.get(name) === true
|
||||||
) {
|
) {
|
||||||
await client.data.disable(interaction.guild.id, "command", name);
|
await client.data.disable(interaction.guild.id, "command", name);
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `\`${args[2]}\` command is now disabled`,
|
content: `\`${args[2]}\` command is now disabled`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type === "category") {
|
if (type === "category") {
|
||||||
const category = fs.readdirSync("./command");
|
const category = fs.readdirSync("./command");
|
||||||
if (data.Guild.Category.includes(args[2])) {
|
if (data.Guild.Category.includes(args[2])) {
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `\`${args[2]}\` category had already been disabled`,
|
content: `\`${args[2]}\` category had already been disabled`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
!data.Guild.Category.includes(args[2]) &&
|
!data.Guild.Category.includes(args[2]) &&
|
||||||
category.includes(args[2])
|
category.includes(args[2])
|
||||||
) {
|
) {
|
||||||
await client.data.disable(interaction.guild.id, "category", args[2]);
|
await client.data.disable(interaction.guild.id, "category", args[2]);
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `\`${args[2]}\` category is now disabled`,
|
content: `\`${args[2]}\` category is now disabled`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const d = `
|
const d = `
|
||||||
**Prefix**: ${data.Guild.Prefix ? data.Guild.Prefix : "C."}
|
**Prefix**: ${data.Guild.Prefix ? data.Guild.Prefix : "C."}
|
||||||
**Tips**: ${data.Guild.Tips ? "Enable" : "Disabled"}
|
**Tips**: ${data.Guild.Tips ? "Enable" : "Disabled"}
|
||||||
**Disabled Commands**: ${
|
**Disabled Commands**: ${
|
||||||
data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None"
|
data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None"
|
||||||
}
|
}
|
||||||
**Disabled Categories**: ${
|
**Disabled Categories**: ${
|
||||||
data.Guild.Category.length ? data.Guilds.Category.join(",") : "None"
|
data.Guild.Category.length ? data.Guilds.Category.join(",") : "None"
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle(`**${interaction.guild.name}** Settings`)
|
.setTitle(`**${interaction.guild.name}** Settings`)
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setDescription(d);
|
.setDescription(d);
|
||||||
interaction.followUp({ embeds: [embed] });
|
interaction.followUp({ embeds: [embed] });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,50 +1,50 @@
|
||||||
const {
|
const {
|
||||||
Client,
|
Client,
|
||||||
CommandInteraction,
|
CommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
ImageFormat,
|
ImageFormat,
|
||||||
} = require("discord.js");
|
} = require("discord.js");
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "avatar",
|
name: "avatar",
|
||||||
description: "Show user's avatar in different formats",
|
description: "Show user's avatar in different formats",
|
||||||
usage: "{User}",
|
usage: "{User}",
|
||||||
category: "Information",
|
category: "Information",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 6,
|
type: 6,
|
||||||
name: "user",
|
name: "user",
|
||||||
description: "The user you want to see",
|
description: "The user you want to see",
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {Client} client
|
* @param {Client} client
|
||||||
* @param {CommandInteraction} interaction
|
* @param {CommandInteraction} interaction
|
||||||
* @param {String[]} args
|
* @param {String[]} args
|
||||||
*/ run: async (client, interaction, args) => {
|
*/ run: async (client, interaction, args) => {
|
||||||
const member =
|
const member =
|
||||||
interaction.guild.members.cache.get(args[0]) || interaction.member;
|
interaction.guild.members.cache.get(args[0]) || interaction.member;
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: member.user.tag,
|
name: member.user.tag,
|
||||||
iconURL: member.user.displayAvatarURL({ dynamic: true, size: 1024 }),
|
iconURL: member.user.displayAvatarURL({ dynamic: true, size: 1024 }),
|
||||||
})
|
})
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setTitle(`${member.user.username}'s Avatar`)
|
.setTitle(`${member.user.username}'s Avatar`)
|
||||||
.setImage(
|
.setImage(
|
||||||
member.user.displayAvatarURL({
|
member.user.displayAvatarURL({
|
||||||
size: 2048,
|
size: 2048,
|
||||||
dynamic: true,
|
dynamic: true,
|
||||||
format: "png",
|
format: "png",
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setURL(client.web)
|
.setURL(client.web)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
interaction.followUp({ embeds: [embed] });
|
interaction.followUp({ embeds: [embed] });
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,60 +1,60 @@
|
||||||
const { EmbedBuilder, version: djsversion } = require("discord.js");
|
const { EmbedBuilder, version: djsversion } = require("discord.js");
|
||||||
const version = require("../../package.json").version;
|
const version = require("../../package.json").version;
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "botinfo",
|
name: "botinfo",
|
||||||
description: "Check the info of the bot",
|
description: "Check the info of the bot",
|
||||||
category: "Information",
|
category: "Information",
|
||||||
run: async (client, interaction, args, utils) => {
|
run: async (client, interaction, args, utils) => {
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle(`NYX - CODM Gunsmith Bot`)
|
.setTitle(`NYX - CODM Gunsmith Bot`)
|
||||||
.setURL(utils.inviteLink(client.user.id))
|
.setURL(utils.inviteLink(client.user.id))
|
||||||
.setThumbnail(
|
.setThumbnail(
|
||||||
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
|
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
|
||||||
)
|
)
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.addFields([
|
.addFields([
|
||||||
{
|
{
|
||||||
name: `General`,
|
name: `General`,
|
||||||
value: `
|
value: `
|
||||||
<:nyx_owner:897418259433943120> Owner ❯ <@452076196419600394>
|
<:nyx_owner:897418259433943120> Owner ❯ <@452076196419600394>
|
||||||
Bot ❯ ${client.user.tag}
|
Bot ❯ ${client.user.tag}
|
||||||
Bot ID ❯ \`${client.user.id}\`
|
Bot ID ❯ \`${client.user.id}\`
|
||||||
Created on ❯ \`${utils.botDate(
|
Created on ❯ \`${utils.botDate(
|
||||||
new Date(client.user.createdTimestamp)
|
new Date(client.user.createdTimestamp)
|
||||||
)}\``,
|
)}\``,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: `Bot Stats`,
|
name: `Bot Stats`,
|
||||||
value: `
|
value: `
|
||||||
Servers ❯ ${client.guilds.cache.size.toLocaleString()}
|
Servers ❯ ${client.guilds.cache.size.toLocaleString()}
|
||||||
Users ❯ ${client.guilds.cache
|
Users ❯ ${client.guilds.cache
|
||||||
.reduce((a, b) => a + b.memberCount, 0)
|
.reduce((a, b) => a + b.memberCount, 0)
|
||||||
.toLocaleString()}
|
.toLocaleString()}
|
||||||
Channels ❯ \`${client.channels.cache.size.toLocaleString()}\`
|
Channels ❯ \`${client.channels.cache.size.toLocaleString()}\`
|
||||||
Commands ❯ \`${client.slashCommands.size}\`
|
Commands ❯ \`${client.slashCommands.size}\`
|
||||||
`,
|
`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: `Platform`,
|
name: `Platform`,
|
||||||
value: `
|
value: `
|
||||||
NYX ❯ \`v${version}\`
|
NYX ❯ \`v${version}\`
|
||||||
Discord.js ❯ \`v${djsversion}\`
|
Discord.js ❯ \`v${djsversion}\`
|
||||||
Node.js ❯ \`${process.version}\``,
|
Node.js ❯ \`${process.version}\``,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: `**${client.author}**`,
|
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
|
value: `**Development Management**\n\u3000Ń1ght#0001\n\u3000Cat drinking a cat#0795\n\u3000mightyful#6536\n\u3000Thunder#2128\n\u3000mobo#9277\n
|
||||||
**Research & Documentation**\n\u3000Thunder#2128\n
|
**Research & Documentation**\n\u3000Thunder#2128\n
|
||||||
**Website**\n\u3000Chunchunmaru#8570`,
|
**Website**\n\u3000Chunchunmaru#8570`,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
interaction.followUp({ embeds: [embed] });
|
interaction.followUp({ embeds: [embed] });
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,204 +1,204 @@
|
||||||
const {
|
const {
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
Client,
|
Client,
|
||||||
CommandInteraction,
|
CommandInteraction,
|
||||||
ActionRowBuilder,
|
ActionRowBuilder,
|
||||||
StringSelectMenuBuilder,
|
StringSelectMenuBuilder,
|
||||||
ComponentType,
|
ComponentType,
|
||||||
} = require("discord.js");
|
} = require("discord.js");
|
||||||
const Utils = require("../../util/functions/function");
|
const Utils = require("../../util/functions/function");
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "help",
|
name: "help",
|
||||||
usage: "(Command/Category)",
|
usage: "(Command/Category)",
|
||||||
description: "Shows all available bot commands",
|
description: "Shows all available bot commands",
|
||||||
category: "Information",
|
category: "Information",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "command",
|
name: "command",
|
||||||
description: "The command you want to see",
|
description: "The command you want to see",
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {Client} client
|
* @param {Client} client
|
||||||
* @param {CommandInteraction} interaction
|
* @param {CommandInteraction} interaction
|
||||||
* @param {String[]} args
|
* @param {String[]} args
|
||||||
* @param {Utils} utils
|
* @param {Utils} utils
|
||||||
*/
|
*/
|
||||||
run: async (client, interaction, args, utils) => {
|
run: async (client, interaction, args, utils) => {
|
||||||
if (!args[0]) {
|
if (!args[0]) {
|
||||||
await interaction.deleteReply();
|
await interaction.deleteReply();
|
||||||
const emoji = {
|
const emoji = {
|
||||||
CODM: "<a:codm:897030768793104385>",
|
CODM: "<a:codm:897030768793104385>",
|
||||||
APEX: "🎆",
|
APEX: "🎆",
|
||||||
Config: "<a:config:896990033561669762>",
|
Config: "<a:config:896990033561669762>",
|
||||||
Information: "<a:information:894962394932064346>",
|
Information: "<a:information:894962394932064346>",
|
||||||
Utilities: "<a:utilites:897233087941988392>",
|
Utilities: "<a:utilites:897233087941988392>",
|
||||||
};
|
};
|
||||||
const directories = [
|
const directories = [
|
||||||
...new Set(client.slashCommands.map(cmd => cmd.directory)),
|
...new Set(client.slashCommands.map(cmd => cmd.directory)),
|
||||||
];
|
];
|
||||||
const categories = directories.map(dir => {
|
const categories = directories.map(dir => {
|
||||||
if (dir == "Owner") return;
|
if (dir == "Owner") return;
|
||||||
const getCmds = client.slashCommands
|
const getCmds = client.slashCommands
|
||||||
.filter(c => c.directory == dir)
|
.filter(c => c.directory == dir)
|
||||||
.map(cmd => {
|
.map(cmd => {
|
||||||
return {
|
return {
|
||||||
name: cmd.name || "No command name",
|
name: cmd.name || "No command name",
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
directory: dir,
|
directory: dir,
|
||||||
commands: getCmds,
|
commands: getCmds,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle(`**NYX's Commands**`)
|
.setTitle(`**NYX's Commands**`)
|
||||||
.setDescription(`Please choose a category in the dropdown menu`)
|
.setDescription(`Please choose a category in the dropdown menu`)
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.addFields(
|
.addFields(
|
||||||
{
|
{
|
||||||
name: ":link: **Invite Me**",
|
name: ":link: **Invite Me**",
|
||||||
value: `[Click Here](${utils.inviteLink(client.user.id)})`,
|
value: `[Click Here](${utils.inviteLink(client.user.id)})`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "<:support1:867093614403256350> **Need Help ?**",
|
name: "<:support1:867093614403256350> **Need Help ?**",
|
||||||
value: `[Support Server](${client.invite})`,
|
value: `[Support Server](${client.invite})`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "<:YouTube:841186450497339412> **Video Guide**",
|
name: "<:YouTube:841186450497339412> **Video Guide**",
|
||||||
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
|
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: `<:nyx_description:897379659665264650> Documentation`,
|
name: `<:nyx_description:897379659665264650> Documentation`,
|
||||||
value: `[Click here](${client.docs})`,
|
value: `[Click here](${client.docs})`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "<a:booster:896527475063025704> **Premium**",
|
name: "<a:booster:896527475063025704> **Premium**",
|
||||||
value: `You can either boost support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team.`,
|
value: `You can either boost support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team.`,
|
||||||
inline: false,
|
inline: false,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.setURL(client.docs)
|
.setURL(client.docs)
|
||||||
.setThumbnail(
|
.setThumbnail(
|
||||||
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
|
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
|
||||||
)
|
)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Requested by ${interaction.user.tag}`,
|
text: `Requested by ${interaction.user.tag}`,
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
||||||
});
|
});
|
||||||
const components = state => [
|
const components = state => [
|
||||||
new ActionRowBuilder().addComponents(
|
new ActionRowBuilder().addComponents(
|
||||||
new StringSelectMenuBuilder()
|
new StringSelectMenuBuilder()
|
||||||
.setCustomId("help-menu")
|
.setCustomId("help-menu")
|
||||||
.setPlaceholder(`Please select a category`)
|
.setPlaceholder(`Please select a category`)
|
||||||
.setDisabled(state)
|
.setDisabled(state)
|
||||||
.addOptions(
|
.addOptions(
|
||||||
categories.map(cmd => {
|
categories.map(cmd => {
|
||||||
return {
|
return {
|
||||||
label: cmd.directory,
|
label: cmd.directory,
|
||||||
value: cmd.directory,
|
value: cmd.directory,
|
||||||
description: `Commands from ${cmd.directory} category`,
|
description: `Commands from ${cmd.directory} category`,
|
||||||
emoji: emoji[cmd.directory] || null,
|
emoji: emoji[cmd.directory] || null,
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
const msg = await interaction.channel.send({
|
const msg = await interaction.channel.send({
|
||||||
embeds: [embed],
|
embeds: [embed],
|
||||||
components: components(false),
|
components: components(false),
|
||||||
});
|
});
|
||||||
const filter = m => m.user.id === interaction.user.id;
|
const filter = m => m.user.id === interaction.user.id;
|
||||||
const collector = interaction.channel.createMessageComponentCollector({
|
const collector = interaction.channel.createMessageComponentCollector({
|
||||||
filter,
|
filter,
|
||||||
componentType: ComponentType.StringSelect,
|
componentType: ComponentType.StringSelect,
|
||||||
time: 60000,
|
time: 60000,
|
||||||
});
|
});
|
||||||
collector.on("collect", async interaction => {
|
collector.on("collect", async interaction => {
|
||||||
const [directory] = interaction.values;
|
const [directory] = interaction.values;
|
||||||
const category = categories.find(u => u.directory === directory);
|
const category = categories.find(u => u.directory === directory);
|
||||||
const newembed = new EmbedBuilder()
|
const newembed = new EmbedBuilder()
|
||||||
.setTitle(
|
.setTitle(
|
||||||
`${emoji[directory]} ${directory} Commands ${emoji[directory]}`
|
`${emoji[directory]} ${directory} Commands ${emoji[directory]}`
|
||||||
)
|
)
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Please use /help (Command Name) for more details`,
|
text: `Please use /help (Command Name) for more details`,
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
category.commands
|
category.commands
|
||||||
.map(cmd => {
|
.map(cmd => {
|
||||||
return [`\`${cmd.name}\``];
|
return [`\`${cmd.name}\``];
|
||||||
})
|
})
|
||||||
.join(", ")
|
.join(", ")
|
||||||
);
|
);
|
||||||
interaction.reply({ embeds: [newembed] });
|
interaction.reply({ embeds: [newembed] });
|
||||||
});
|
});
|
||||||
collector.on("end", () => msg.edit({ components: components(true) }));
|
collector.on("end", () => msg.edit({ components: components(true) }));
|
||||||
} else {
|
} else {
|
||||||
const command = client.slashCommands.get(args[0].toLowerCase());
|
const command = client.slashCommands.get(args[0].toLowerCase());
|
||||||
if (!command) {
|
if (!command) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
content: `There isn't any command named "${args[0]}"`,
|
content: `There isn't any command named "${args[0]}"`,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (command.UserPerms && Array.isArray(command.UserPerms)) {
|
if (command.UserPerms && Array.isArray(command.UserPerms)) {
|
||||||
UserPermissions = command.UserPerms;
|
UserPermissions = command.UserPerms;
|
||||||
} else {
|
} else {
|
||||||
UserPermissions = [command.UserPerms ? command.UserPerms : ""];
|
UserPermissions = [command.UserPerms ? command.UserPerms : ""];
|
||||||
}
|
}
|
||||||
const fields = [];
|
const fields = [];
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle(`"${command.name}" command details`)
|
.setTitle(`"${command.name}" command details`)
|
||||||
.addFields([
|
.addFields([
|
||||||
{
|
{
|
||||||
name: "**Command**:",
|
name: "**Command**:",
|
||||||
value: command.name ? `\`${command.name}\`` : "N/A",
|
value: command.name ? `\`${command.name}\`` : "N/A",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
if (command.usage)
|
if (command.usage)
|
||||||
fields.push({
|
fields.push({
|
||||||
name: "**Usage**:",
|
name: "**Usage**:",
|
||||||
value: `\`/${command.name} ${command.usage}\``,
|
value: `\`/${command.name} ${command.usage}\``,
|
||||||
});
|
});
|
||||||
else
|
else
|
||||||
fields.push({
|
fields.push({
|
||||||
name: "**Usage**:",
|
name: "**Usage**:",
|
||||||
value: `\`/${command.name}\``,
|
value: `\`/${command.name}\``,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (command.description)
|
if (command.description)
|
||||||
fields.push({
|
fields.push({
|
||||||
name: "**Description**:",
|
name: "**Description**:",
|
||||||
value: command.description,
|
value: command.description,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (command.timeout)
|
if (command.timeout)
|
||||||
fields.push({
|
fields.push({
|
||||||
name: "**Cooldown**:",
|
name: "**Cooldown**:",
|
||||||
value: utils.timer(command.timeout),
|
value: utils.timer(command.timeout),
|
||||||
});
|
});
|
||||||
embed
|
embed
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Requested by ${interaction.user.tag}`,
|
text: `Requested by ${interaction.user.tag}`,
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.addFields(fields)
|
.addFields(fields)
|
||||||
.setURL(client.web)
|
.setURL(client.web)
|
||||||
.setColor(client.color);
|
.setColor(client.color);
|
||||||
interaction.followUp({ embeds: [embed] });
|
interaction.followUp({ embeds: [embed] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,34 +1,34 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { EmbedBuilder } = 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",
|
category: "Information",
|
||||||
run: async (client, interaction, args) => {
|
run: async (client, interaction, args) => {
|
||||||
const msg = await interaction.channel.send(`Pinging...`);
|
const msg = await interaction.channel.send(`Pinging...`);
|
||||||
const messageping = msg.createdTimestamp - interaction.createdTimestamp;
|
const messageping = msg.createdTimestamp - interaction.createdTimestamp;
|
||||||
await msg.delete();
|
await msg.delete();
|
||||||
const Embed = new EmbedBuilder()
|
const Embed = new EmbedBuilder()
|
||||||
.setTitle("<a:pong:897383314405605436> Pong!")
|
.setTitle("<a:pong:897383314405605436> Pong!")
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.user.username,
|
name: interaction.user.username,
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`\n 📨 • **Message Latency** \`${Math.floor(messageping)}ms\`
|
`\n 📨 • **Message Latency** \`${Math.floor(messageping)}ms\`
|
||||||
\n🛰️ • **Bot Latency** \`${Math.round(client.ws.ping)}ms\``
|
\n🛰️ • **Bot Latency** \`${Math.round(client.ws.ping)}ms\``
|
||||||
)
|
)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setColor(
|
.setColor(
|
||||||
messageping < 350
|
messageping < 350
|
||||||
? "#008000"
|
? "#008000"
|
||||||
: messageping < 500 && messageping > 350
|
: messageping < 500 && messageping > 350
|
||||||
? "#ffff31"
|
? "#ffff31"
|
||||||
: "#ff0000"
|
: "#ff0000"
|
||||||
);
|
);
|
||||||
interaction.followUp({ embeds: [Embed] });
|
interaction.followUp({ embeds: [Embed] });
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,89 +1,89 @@
|
||||||
const { Client, CommandInteraction, EmbedBuilder } = require("discord.js");
|
const { Client, CommandInteraction, EmbedBuilder } = require("discord.js");
|
||||||
const Utils = require("../../util/functions/function");
|
const Utils = require("../../util/functions/function");
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "userinfo",
|
name: "userinfo",
|
||||||
description: "Check the info of a user",
|
description: "Check the info of a user",
|
||||||
usage: "{User}",
|
usage: "{User}",
|
||||||
category: "Information",
|
category: "Information",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 6,
|
type: 6,
|
||||||
name: "user",
|
name: "user",
|
||||||
description: "The user you want to see",
|
description: "The user you want to see",
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {Client} client
|
* @param {Client} client
|
||||||
* @param {CommandInteraction} interaction
|
* @param {CommandInteraction} interaction
|
||||||
* @param {String[]} args
|
* @param {String[]} args
|
||||||
* @param {Utils} utils
|
* @param {Utils} utils
|
||||||
*/
|
*/
|
||||||
run: async (client, interaction, args, utils) => {
|
run: async (client, interaction, args, utils) => {
|
||||||
const member =
|
const member =
|
||||||
interaction.guild.members.cache.get(args[0]) || interaction.member;
|
interaction.guild.members.cache.get(args[0]) || interaction.member;
|
||||||
|
|
||||||
const x = Date.now() - member.user.createdAt;
|
const x = Date.now() - member.user.createdAt;
|
||||||
const y =
|
const y =
|
||||||
Date.now() - interaction.guild.members.cache.get(member.id).joinedAt;
|
Date.now() - interaction.guild.members.cache.get(member.id).joinedAt;
|
||||||
const created = Math.floor(x / 86400000);
|
const created = Math.floor(x / 86400000);
|
||||||
const joined = Math.floor(y / 86400000);
|
const joined = Math.floor(y / 86400000);
|
||||||
const nickname = member.nickname || "None";
|
const nickname = member.nickname || "None";
|
||||||
const roles = member.roles.cache
|
const roles = member.roles.cache
|
||||||
.filter(r => r.id != interaction.guild.id)
|
.filter(r => r.id != interaction.guild.id)
|
||||||
.sort((a, b) => b.position - a.position)
|
.sort((a, b) => b.position - a.position)
|
||||||
.map(role => role.toString());
|
.map(role => role.toString());
|
||||||
const createDateFormatted = utils.parseDate(
|
const createDateFormatted = utils.parseDate(
|
||||||
new Date(member.user.createdAt)
|
new Date(member.user.createdAt)
|
||||||
);
|
);
|
||||||
const joinDateFormatted = utils.parseDate(new Date(member.joinedAt));
|
const joinDateFormatted = utils.parseDate(new Date(member.joinedAt));
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: member.user.tag,
|
name: member.user.tag,
|
||||||
iconURL: member.user.displayAvatarURL({ dynamic: true, size: 4096 }),
|
iconURL: member.user.displayAvatarURL({ dynamic: true, size: 4096 }),
|
||||||
})
|
})
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setColor(member.displayHexColor || client.color)
|
.setColor(member.displayHexColor || client.color)
|
||||||
.setURL(client.web)
|
.setURL(client.web)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true, size: 4096 }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true, size: 4096 }),
|
||||||
})
|
})
|
||||||
.setThumbnail(member.user.displayAvatarURL({ dynamic: true, size: 4096 }))
|
.setThumbnail(member.user.displayAvatarURL({ dynamic: true, size: 4096 }))
|
||||||
.addFields([
|
.addFields([
|
||||||
{
|
{
|
||||||
name: "User",
|
name: "User",
|
||||||
value: `**❯ User Tag:** ${member.user.tag} ${client.owners.includes(member.id) ? client.dev : ""}
|
value: `**❯ User Tag:** ${member.user.tag} ${client.owners.includes(member.id) ? client.dev : ""}
|
||||||
**❯ Username:** ${member.user.username}
|
**❯ Username:** ${member.user.username}
|
||||||
**❯ Discriminator:** ${member.user.discriminator}
|
**❯ Discriminator:** ${member.user.discriminator}
|
||||||
**❯ Nickname:** ${nickname}
|
**❯ Nickname:** ${nickname}
|
||||||
**❯ User ID:** ${member.id}
|
**❯ User ID:** ${member.id}
|
||||||
**❯ Avatar:** [Link to avatar](${member.user.displayAvatarURL({
|
**❯ Avatar:** [Link to avatar](${member.user.displayAvatarURL({
|
||||||
dynamic: true,
|
dynamic: true,
|
||||||
size: 2048,
|
size: 2048,
|
||||||
})})
|
})})
|
||||||
**❯ Time Created:** ${createDateFormatted} \nSince ${created} day${created <= 1 ? "" : "s"} ago
|
**❯ Time Created:** ${createDateFormatted} \nSince ${created} day${created <= 1 ? "" : "s"} ago
|
||||||
\u200b`,
|
\u200b`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Member",
|
name: "Member",
|
||||||
value: `**❯ Highest Role:** ${
|
value: `**❯ Highest Role:** ${
|
||||||
member.roles.highest.id === interaction.guild.id
|
member.roles.highest.id === interaction.guild.id
|
||||||
? "None"
|
? "None"
|
||||||
: member.roles.highest.name
|
: member.roles.highest.name
|
||||||
}
|
}
|
||||||
**❯ Server Join Date:** ${joinDateFormatted} \nSince ${joined} day${joined <= 1 ? "" : "s"} ago
|
**❯ Server Join Date:** ${joinDateFormatted} \nSince ${joined} day${joined <= 1 ? "" : "s"} ago
|
||||||
**❯ Roles [${roles.length}]:** ${
|
**❯ Roles [${roles.length}]:** ${
|
||||||
roles.length < 10 && roles.length > 0
|
roles.length < 10 && roles.length > 0
|
||||||
? roles.join(" **|** ")
|
? roles.join(" **|** ")
|
||||||
: roles.length > 0
|
: roles.length > 0
|
||||||
? utils.trimArray(roles)
|
? utils.trimArray(roles)
|
||||||
: "None"
|
: "None"
|
||||||
}
|
}
|
||||||
\u200b`,
|
\u200b`,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
interaction.followUp({ embeds: [embed] });
|
interaction.followUp({ embeds: [embed] });
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,50 +1,50 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { EmbedBuilder } = 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 EmbedBuilder()
|
||||||
.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);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,65 +1,65 @@
|
||||||
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 EmbedBuilder()
|
||||||
.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({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
interaction.followUp({ embeds: [embed] });
|
interaction.followUp({ embeds: [embed] });
|
||||||
} else {
|
} else {
|
||||||
await client.data.BK(user.id, toggle, reason);
|
await client.data.BK(user.id, toggle, reason);
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle("<a:nyx_checkmark:897240322411724841> Removed From Blacklist")
|
.setTitle("<a:nyx_checkmark:897240322411724841> Removed From Blacklist")
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**User:** ${user.user.tag} \`(${user.id})\`\n**Reason:** ${reason} \n**Whitelisted by:** ${interaction.member}`
|
`**User:** ${user.user.tag} \`(${user.id})\`\n**Reason:** ${reason} \n**Whitelisted by:** ${interaction.member}`
|
||||||
)
|
)
|
||||||
.setURL(client.web)
|
.setURL(client.web)
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
interaction.followUp({ embeds: [embed] });
|
interaction.followUp({ embeds: [embed] });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,49 +1,49 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { EmbedBuilder } = 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 EmbedBuilder()
|
||||||
.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,129 @@
|
||||||
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",
|
||||||
|
|
||||||
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);
|
evaled = chunk([evaled], 750);
|
||||||
let reactions = ["❌", "⏪", "◀️", "⏹️", "▶️", "⏩"],
|
let reactions = ["❌", "⏪", "◀️", "⏹️", "▶️", "⏩"],
|
||||||
page = 0,
|
page = 0,
|
||||||
evaledEmbed = new Discord.EmbedBuilder()
|
evaledEmbed = new Discord.EmbedBuilder()
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setDescription(`\`\`\`js\n${evaled[0]}\n\`\`\``)
|
.setDescription(`\`\`\`js\n${evaled[0]}\n\`\`\``)
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: `Evaled by ${interaction.user.tag}`,
|
name: `Evaled by ${interaction.user.tag}`,
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
||||||
});
|
});
|
||||||
const mainMessage = await interaction.channel.send({
|
const mainMessage = await interaction.channel.send({
|
||||||
embeds: [evaledEmbed],
|
embeds: [evaledEmbed],
|
||||||
});
|
});
|
||||||
Discord.TextChannel.prototype.send = oldSend;
|
Discord.TextChannel.prototype.send = oldSend;
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).map(r =>
|
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).map(r =>
|
||||||
mainMessage.react(r)
|
mainMessage.react(r)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
const filter = (reaction, user) =>
|
const filter = (reaction, user) =>
|
||||||
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).some(
|
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).some(
|
||||||
e => e === reaction.emoji.name
|
e => e === reaction.emoji.name
|
||||||
) && user.id === interaction.user.id;
|
) && user.id === interaction.user.id;
|
||||||
const collector = mainMessage.createReactionCollector({
|
const collector = mainMessage.createReactionCollector({
|
||||||
filter,
|
filter,
|
||||||
time: 999999,
|
time: 999999,
|
||||||
});
|
});
|
||||||
collector.on("collect", async reaction => {
|
collector.on("collect", async reaction => {
|
||||||
switch (reaction.emoji.name) {
|
switch (reaction.emoji.name) {
|
||||||
case "❌":
|
case "❌":
|
||||||
await collector.stop();
|
await collector.stop();
|
||||||
return mainMessage.delete();
|
return mainMessage.delete();
|
||||||
case "⏪":
|
case "⏪":
|
||||||
if (evaled.length === 1 || page === 0) return;
|
if (evaled.length === 1 || page === 0) return;
|
||||||
page = 0;
|
page = 0;
|
||||||
break;
|
break;
|
||||||
case "◀️":
|
case "◀️":
|
||||||
if (evaled.length === 1) return;
|
if (evaled.length === 1) return;
|
||||||
if (page === 0) {
|
if (page === 0) {
|
||||||
page = evaled.length - 1;
|
page = evaled.length - 1;
|
||||||
} else {
|
} else {
|
||||||
page -= 1;
|
page -= 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "⏹️":
|
case "⏹️":
|
||||||
await collector.stop();
|
await collector.stop();
|
||||||
for (const reaction of mainMessage.reactions.cache.map(e => e)) {
|
for (const reaction of mainMessage.reactions.cache.map(e => e)) {
|
||||||
await reaction.users.remove(client.user.id);
|
await reaction.users.remove(client.user.id);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case "▶️":
|
case "▶️":
|
||||||
if (evaled.length === 1) return;
|
if (evaled.length === 1) return;
|
||||||
if (page === evaled.length - 1) {
|
if (page === evaled.length - 1) {
|
||||||
page = 0;
|
page = 0;
|
||||||
} else {
|
} else {
|
||||||
page += 1;
|
page += 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "⏩":
|
case "⏩":
|
||||||
if (evaled.length === 1 || page === evaled.length - 1) return;
|
if (evaled.length === 1 || page === evaled.length - 1) return;
|
||||||
page = evaled.length - 1;
|
page = evaled.length - 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
evaledEmbed = new Discord.EmbedBuilder()
|
evaledEmbed = new Discord.EmbedBuilder()
|
||||||
.setColor(interaction.guild.me.displayColor)
|
.setColor(interaction.guild.me.displayColor)
|
||||||
.setDescription(`\`\`\`js\n${evaled[page]}\n\`\`\``);
|
.setDescription(`\`\`\`js\n${evaled[page]}\n\`\`\``);
|
||||||
await mainMessage.edit({
|
await mainMessage.edit({
|
||||||
embeds: [evaledEmbed],
|
embeds: [evaledEmbed],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
function chunk(arr, size) {
|
function chunk(arr, size) {
|
||||||
let c;
|
let c;
|
||||||
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => {
|
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => {
|
||||||
c = arr.slice(i * size, i * size + size);
|
c = arr.slice(i * size, i * size + size);
|
||||||
});
|
});
|
||||||
return c;
|
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,45 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { EmbedBuilder } = 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 EmbedBuilder()
|
||||||
.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()
|
? client.guilds.cache.size.toString()
|
||||||
: "0",
|
: "0",
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: `Total Members`,
|
name: `Total Members`,
|
||||||
value: client.users.cache.size
|
value: client.users.cache.size
|
||||||
? client.users.cache.size.toString()
|
? client.users.cache.size.toString()
|
||||||
: "0",
|
: "0",
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
interaction.followUp({ embeds: [embed] });
|
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"
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,38 +1,38 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { EmbedBuilder } = require("discord.js");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "invite",
|
name: "invite",
|
||||||
description: "Get bot invite link or get support",
|
description: "Get bot invite link or get support",
|
||||||
category: "Utilities",
|
category: "Utilities",
|
||||||
|
|
||||||
run: async (client, interaction, args, utils) => {
|
run: async (client, interaction, args, utils) => {
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.user.tag,
|
name: interaction.user.tag,
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTitle(`Support/Invite`)
|
.setTitle(`Support/Invite`)
|
||||||
.setThumbnail(
|
.setThumbnail(
|
||||||
"https://github.com/night0721/cath.js/blob/master/util/assets/images/nyx_logo_transparent.webp"
|
"https://github.com/night0721/cath.js/blob/master/util/assets/images/nyx_logo_transparent.webp"
|
||||||
)
|
)
|
||||||
.addFields([
|
.addFields([
|
||||||
{
|
{
|
||||||
name: "<a:booster:896527475063025704> **Premium**",
|
name: "<a:booster:896527475063025704> **Premium**",
|
||||||
value:
|
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.**",
|
"**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: true,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: "Please click the buttons below for more information",
|
content: "Please click the buttons below for more information",
|
||||||
embeds: [embed],
|
embeds: [embed],
|
||||||
components: utils.buttons(client),
|
components: utils.buttons(client),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,45 +1,45 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { EmbedBuilder } = require("discord.js");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "report",
|
name: "report",
|
||||||
description: "Report a bug of the bot",
|
description: "Report a bug of the bot",
|
||||||
category: "Utilities",
|
category: "Utilities",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "bug",
|
name: "bug",
|
||||||
description: "The bug you want to report",
|
description: "The bug you want to report",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction, args) => {
|
run: async (client, interaction, args) => {
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setTitle("SUCCESS!")
|
.setTitle("SUCCESS!")
|
||||||
.setDescription(
|
.setDescription(
|
||||||
"You have reported a bug.\nPlease wait for us to solve it"
|
"You have reported a bug.\nPlease wait for us to solve it"
|
||||||
)
|
)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setColor("Green"),
|
.setColor("Green"),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
client.channels.cache.get(client.config.Report).send({
|
client.channels.cache.get(client.config.Report).send({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.user.tag,
|
name: interaction.user.tag,
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTitle("New Bug")
|
.setTitle("New Bug")
|
||||||
.setDescription(args[0])
|
.setDescription(args[0])
|
||||||
.setColor("Orange")
|
.setColor("Orange")
|
||||||
.setTimestamp(),
|
.setTimestamp(),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,44 +1,44 @@
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { EmbedBuilder } = require("discord.js");
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "suggest",
|
name: "suggest",
|
||||||
description: "Make a suggestion of the bot",
|
description: "Make a suggestion of the bot",
|
||||||
category: "Utilities",
|
category: "Utilities",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "suggestion",
|
name: "suggestion",
|
||||||
description: "The suggestion",
|
description: "The suggestion",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction, args) => {
|
run: async (client, interaction, args) => {
|
||||||
client.channels.cache.get(client.config.Suggestion).send({
|
client.channels.cache.get(client.config.Suggestion).send({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.user.tag,
|
name: interaction.user.tag,
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTitle("New Suggestion")
|
.setTitle("New Suggestion")
|
||||||
.setDescription(args[0])
|
.setDescription(args[0])
|
||||||
.setColor("Orange")
|
.setColor("Orange")
|
||||||
.setTimestamp(),
|
.setTimestamp(),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setTitle("SUCCESS!")
|
.setTitle("SUCCESS!")
|
||||||
.setDescription(
|
.setDescription(
|
||||||
"You have sent a suggestion.\nPlease wait for us to review it"
|
"You have sent a suggestion.\nPlease wait for us to review it"
|
||||||
)
|
)
|
||||||
.setColor("Green")
|
.setColor("Green")
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTimestamp(),
|
.setTimestamp(),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
26
config.js
26
config.js
|
@ -1,13 +1,13 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
prefix: "C.",
|
prefix: "C.",
|
||||||
URL: "https://night0721.me/",
|
URL: "https://night0721.me/",
|
||||||
color: "ff3636",
|
color: "ff3636",
|
||||||
Suggestion: "853319776034226186",
|
Suggestion: "853319776034226186",
|
||||||
Report: "853319776034226186",
|
Report: "853319776034226186",
|
||||||
Welcome: "837913442228371456",
|
Welcome: "837913442228371456",
|
||||||
DMLog: "900549765534736394",
|
DMLog: "900549765534736394",
|
||||||
CMDLog: "848613827226239046",
|
CMDLog: "848613827226239046",
|
||||||
ErrorLog: "938538311537012796",
|
ErrorLog: "938538311537012796",
|
||||||
ServerLog: "848613714537873518",
|
ServerLog: "848613714537873518",
|
||||||
ScamLinkLog: "936986641585799178",
|
ScamLinkLog: "936986641585799178",
|
||||||
};
|
};
|
||||||
|
|
150
events/embed.js
150
events/embed.js
|
@ -1,75 +1,75 @@
|
||||||
const client = require("../");
|
const client = require("../");
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { EmbedBuilder } = require("discord.js");
|
||||||
const { Welcome } = require("../config");
|
const { Welcome } = require("../config");
|
||||||
client.on("guildMemberAdd", async member => {
|
client.on("guildMemberAdd", async member => {
|
||||||
const channel = member.guild.channels.cache.find(
|
const channel = member.guild.channels.cache.find(
|
||||||
channel => channel.id == Welcome
|
channel => channel.id == Welcome
|
||||||
);
|
);
|
||||||
if (!channel) return;
|
if (!channel) return;
|
||||||
channel.send({
|
channel.send({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setTitle(
|
.setTitle(
|
||||||
`<:join:897246825122254848> Hello ${member}, Welcome to NYX's Support Server!`
|
`<:join:897246825122254848> Hello ${member}, Welcome to NYX's Support Server!`
|
||||||
)
|
)
|
||||||
.setThumbnail(
|
.setThumbnail(
|
||||||
member.user.displayAvatarURL({ dynamic: true, size: 512 })
|
member.user.displayAvatarURL({ dynamic: true, size: 512 })
|
||||||
)
|
)
|
||||||
.addFields(
|
.addFields(
|
||||||
{
|
{
|
||||||
name: "Read Rules",
|
name: "Read Rules",
|
||||||
value: `<#799074874513555496>`,
|
value: `<#799074874513555496>`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Support Channel",
|
name: "Support Channel",
|
||||||
value: `<#837865823225511946>`,
|
value: `<#837865823225511946>`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "FAQ",
|
name: "FAQ",
|
||||||
value: `<#897345265516822558>`,
|
value: `<#897345265516822558>`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Badge",
|
name: "Badge",
|
||||||
value: `<#897345265516822558>`,
|
value: `<#897345265516822558>`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "User ID:",
|
name: "User ID:",
|
||||||
value: `\`\`\`\n${member.id}\n\`\`\``,
|
value: `\`\`\`\n${member.id}\n\`\`\``,
|
||||||
inline: true,
|
inline: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `${member.user.tag} joined the server!`,
|
text: `${member.user.tag} joined the server!`,
|
||||||
iconURL: member.user.displayAvatarURL({ dynamic: true }),
|
iconURL: member.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setTimestamp(),
|
.setTimestamp(),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
client.on("guildMemberRemove", async member => {
|
client.on("guildMemberRemove", async member => {
|
||||||
const channel = member.guild.channels.cache.find(
|
const channel = member.guild.channels.cache.find(
|
||||||
channel => channel.id == Welcome
|
channel => channel.id == Welcome
|
||||||
);
|
);
|
||||||
if (!channel) return;
|
if (!channel) return;
|
||||||
channel.send({
|
channel.send({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setTitle(
|
.setTitle(
|
||||||
`<:leave:897246828045680640> ${member.user.username} can't handle being cool! `
|
`<:leave:897246828045680640> ${member.user.username} can't handle being cool! `
|
||||||
)
|
)
|
||||||
.setThumbnail(member.guild.iconURL({ dynamic: true }))
|
.setThumbnail(member.guild.iconURL({ dynamic: true }))
|
||||||
.setDescription(`We now only have ${member.guild.memberCount} members`)
|
.setDescription(`We now only have ${member.guild.memberCount} members`)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `${member.user.tag} left the server!`,
|
text: `${member.user.tag} left the server!`,
|
||||||
iconURL: member.user.displayAvatarURL({ dynamic: true }),
|
iconURL: member.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setTimestamp(),
|
.setTimestamp(),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
110
events/emoji.js
110
events/emoji.js
|
@ -1,55 +1,55 @@
|
||||||
const client = require("../");
|
const client = require("../");
|
||||||
client.on("messageCreate", async message => {
|
client.on("messageCreate", async message => {
|
||||||
function Check(str) {
|
function Check(str) {
|
||||||
if (
|
if (
|
||||||
client.emojis.cache.find(emoji => emoji.name === str) ||
|
client.emojis.cache.find(emoji => emoji.name === str) ||
|
||||||
message.guild.emojis.cache.find(emoji => emoji.name === str)
|
message.guild.emojis.cache.find(emoji => emoji.name === str)
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (message.content.startsWith(":") && message.content.endsWith(":")) {
|
if (message.content.startsWith(":") && message.content.endsWith(":")) {
|
||||||
const EmojiName = message.content.slice(1, -1);
|
const EmojiName = message.content.slice(1, -1);
|
||||||
if (client.path.includes(message.guild.id)) return;
|
if (client.path.includes(message.guild.id)) return;
|
||||||
if (Check(EmojiName)) {
|
if (Check(EmojiName)) {
|
||||||
const channel = client.channels.cache.get(message.channel.id);
|
const channel = client.channels.cache.get(message.channel.id);
|
||||||
try {
|
try {
|
||||||
if (message.author.bot) return;
|
if (message.author.bot) return;
|
||||||
const webhooks = await channel.fetchWebhooks();
|
const webhooks = await channel.fetchWebhooks();
|
||||||
const webhook = webhooks.first();
|
const webhook = webhooks.first();
|
||||||
if (webhook === undefined || null || !webhook) {
|
if (webhook === undefined || null || !webhook) {
|
||||||
channel
|
channel
|
||||||
.createWebhook(client.user.username, {
|
.createWebhook(client.user.username, {
|
||||||
avatar: client.user.displayAvatarURL({ dynamic: true }),
|
avatar: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.then(async w => {
|
.then(async w => {
|
||||||
const emoji =
|
const emoji =
|
||||||
client.emojis.cache.find(e => e.name == EmojiName).id ||
|
client.emojis.cache.find(e => e.name == EmojiName).id ||
|
||||||
message.guild.emojis.cache.find(e => e.name === EmojiName).id;
|
message.guild.emojis.cache.find(e => e.name === EmojiName).id;
|
||||||
|
|
||||||
await w.send(`${client.emojis.cache.get(emoji)}`, {
|
await w.send(`${client.emojis.cache.get(emoji)}`, {
|
||||||
username: message.member.displayName
|
username: message.member.displayName
|
||||||
? message.member.displayName
|
? message.member.displayName
|
||||||
: message.author.username,
|
: message.author.username,
|
||||||
avatarURL: message.author.displayAvatarURL({ dynamic: true }),
|
avatarURL: message.author.displayAvatarURL({ dynamic: true }),
|
||||||
});
|
});
|
||||||
message.delete();
|
message.delete();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const emoji =
|
const emoji =
|
||||||
client.emojis.cache.find(e => e.name == EmojiName).id ||
|
client.emojis.cache.find(e => e.name == EmojiName).id ||
|
||||||
message.guild.emojis.cache.find(e => e.name === EmojiName).id;
|
message.guild.emojis.cache.find(e => e.name === EmojiName).id;
|
||||||
|
|
||||||
await webhook.send(client.emojis.cache.get(emoji), {
|
await webhook.send(client.emojis.cache.get(emoji), {
|
||||||
username: message.author.username,
|
username: message.author.username,
|
||||||
avatarURL: message.author.displayAvatarURL({ dynamic: true }),
|
avatarURL: message.author.displayAvatarURL({ dynamic: true }),
|
||||||
});
|
});
|
||||||
message.delete();
|
message.delete();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
124
events/guild.js
124
events/guild.js
|
@ -1,62 +1,62 @@
|
||||||
const client = require("../");
|
const client = require("../");
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { EmbedBuilder } = require("discord.js");
|
||||||
const db = require("../models/guilds");
|
const db = require("../models/guilds");
|
||||||
client.on("guildCreate", guild => {
|
client.on("guildCreate", guild => {
|
||||||
client.channels.cache.get(client.config.ServerLog).send({
|
client.channels.cache.get(client.config.ServerLog).send({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setTitle("New Server")
|
.setTitle("New Server")
|
||||||
.addFields({
|
.addFields({
|
||||||
name: "Server Info",
|
name: "Server Info",
|
||||||
value: `**>Server Name**: \n${guild.name}
|
value: `**>Server Name**: \n${guild.name}
|
||||||
**>Server ID**: \n${guild.id}
|
**>Server ID**: \n${guild.id}
|
||||||
**>Server Member Count**: \n${guild.memberCount}`,
|
**>Server Member Count**: \n${guild.memberCount}`,
|
||||||
})
|
})
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `${client.user.username} Currently in ${client.guilds.cache.size} servers`,
|
text: `${client.user.username} Currently in ${client.guilds.cache.size} servers`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setThumbnail(guild.iconURL({ dynamic: true }))
|
.setThumbnail(guild.iconURL({ dynamic: true }))
|
||||||
.setColor("Green"),
|
.setColor("Green"),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
const newdb = new db({
|
const newdb = new db({
|
||||||
Guild: guild.id,
|
Guild: guild.id,
|
||||||
Prefix: client.config.prefix,
|
Prefix: client.config.prefix,
|
||||||
});
|
});
|
||||||
newdb.save();
|
newdb.save();
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on("guildDelete", async guild => {
|
client.on("guildDelete", async guild => {
|
||||||
client.data.DelGuild(guild.id);
|
client.data.DelGuild(guild.id);
|
||||||
client.channels.cache.get(client.config.ServerLog).send({
|
client.channels.cache.get(client.config.ServerLog).send({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setTitle("Deleted Server")
|
.setTitle("Deleted Server")
|
||||||
.addFields({
|
.addFields({
|
||||||
name: "Server Info",
|
name: "Server Info",
|
||||||
value: `**>Server Name**: \n${guild.name}
|
value: `**>Server Name**: \n${guild.name}
|
||||||
**>Server ID**: \n${guild.id}
|
**>Server ID**: \n${guild.id}
|
||||||
**>Server Member Count**: \n${guild.memberCount}`,
|
**>Server Member Count**: \n${guild.memberCount}`,
|
||||||
})
|
})
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `${client.user.username} Currently in ${client.guilds.cache.size} servers`,
|
text: `${client.user.username} Currently in ${client.guilds.cache.size} servers`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setThumbnail(guild.iconURL({ dynamic: true }))
|
.setThumbnail(guild.iconURL({ dynamic: true }))
|
||||||
.setColor("Red"),
|
.setColor("Red"),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
client.prefix = async function (message) {
|
client.prefix = async function (message) {
|
||||||
let custom;
|
let custom;
|
||||||
if (!message.guild) return;
|
if (!message.guild) return;
|
||||||
const data = await db
|
const data = await db
|
||||||
.findOne({ Guild: message.guild.id })
|
.findOne({ Guild: message.guild.id })
|
||||||
.catch(err => console.log(err));
|
.catch(err => console.log(err));
|
||||||
if (data) custom = data.Prefix;
|
if (data) custom = data.Prefix;
|
||||||
else custom = client.config.prefix;
|
else custom = client.config.prefix;
|
||||||
return custom;
|
return custom;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,182 +1,182 @@
|
||||||
const client = require("../");
|
const client = require("../");
|
||||||
const cooldown = require("../models/cooldown");
|
const cooldown = require("../models/cooldown");
|
||||||
const utils = require("../util/functions/function");
|
const utils = require("../util/functions/function");
|
||||||
const { EmbedBuilder } = require("discord.js");
|
const { EmbedBuilder } = require("discord.js");
|
||||||
client.on("interactionCreate", async interaction => {
|
client.on("interactionCreate", async interaction => {
|
||||||
if (interaction.isCommand()) {
|
if (interaction.isCommand()) {
|
||||||
await interaction.deferReply({ ephemeral: false }).catch(() => {});
|
await interaction.deferReply({ ephemeral: false }).catch(() => {});
|
||||||
const cmd = client.slashCommands.get(interaction.commandName);
|
const cmd = client.slashCommands.get(interaction.commandName);
|
||||||
if (!cmd) return;
|
if (!cmd) return;
|
||||||
const args = [];
|
const args = [];
|
||||||
for (const option of interaction.options.data) {
|
for (const option of interaction.options.data) {
|
||||||
if (option.type === 2) {
|
if (option.type === 2) {
|
||||||
if (option.name) args.push(option.name);
|
if (option.name) args.push(option.name);
|
||||||
option.options?.forEach(x => {
|
option.options?.forEach(x => {
|
||||||
if (x.type === 1) {
|
if (x.type === 1) {
|
||||||
if (x.name) args.push(x.name);
|
if (x.name) args.push(x.name);
|
||||||
x.options?.forEach(y => {
|
x.options?.forEach(y => {
|
||||||
if (y.value) args.push(y.value);
|
if (y.value) args.push(y.value);
|
||||||
});
|
});
|
||||||
} else if (x.value) {
|
} else if (x.value) {
|
||||||
args.push(x.value);
|
args.push(x.value);
|
||||||
}
|
}
|
||||||
if (x.value) args.push(x.value);
|
if (x.value) args.push(x.value);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (option.type === 1) {
|
if (option.type === 1) {
|
||||||
if (option.name) args.push(option.name);
|
if (option.name) args.push(option.name);
|
||||||
option.options?.forEach(x => {
|
option.options?.forEach(x => {
|
||||||
if (x.value) args.push(x.value);
|
if (x.value) args.push(x.value);
|
||||||
});
|
});
|
||||||
} else if (option.value) {
|
} else if (option.value) {
|
||||||
args.push(option.value);
|
args.push(option.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
interaction.member = interaction.guild.members.cache.get(
|
interaction.member = interaction.guild.members.cache.get(
|
||||||
interaction.user.id
|
interaction.user.id
|
||||||
);
|
);
|
||||||
const data = {};
|
const data = {};
|
||||||
const guildDB = await client.data.getGuild(interaction.guild.id);
|
const guildDB = await client.data.getGuild(interaction.guild.id);
|
||||||
if (!guildDB) return;
|
if (!guildDB) return;
|
||||||
const userDB = await client.data.getUser(interaction.user.id);
|
const userDB = await client.data.getUser(interaction.user.id);
|
||||||
if (!userDB) return;
|
if (!userDB) return;
|
||||||
data.Guild = guildDB;
|
data.Guild = guildDB;
|
||||||
data.User = userDB;
|
data.User = userDB;
|
||||||
if (!guildDB) await client.data.CreateGuild(interaction.guild.id);
|
if (!guildDB) await client.data.CreateGuild(interaction.guild.id);
|
||||||
if (data.User?.Blacklist)
|
if (data.User?.Blacklist)
|
||||||
return interaction.followUp({
|
return interaction.followUp({
|
||||||
content:
|
content:
|
||||||
"You have been blacklisted from the bot, please contact the developers to appeal",
|
"You have been blacklisted from the bot, please contact the developers to appeal",
|
||||||
});
|
});
|
||||||
if (cmd.Owner && !client.owners.includes(interaction.user.id)) return;
|
if (cmd.Owner && !client.owners.includes(interaction.user.id)) return;
|
||||||
if (cmd.Premium && !data.User.Premium) {
|
if (cmd.Premium && !data.User.Premium) {
|
||||||
return interaction.followUp({
|
return interaction.followUp({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setURL(client.web)
|
.setURL(client.web)
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: interaction.user.tag,
|
name: interaction.user.tag,
|
||||||
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`You aren't a premium user. 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 to be premium user`
|
`You aren't a premium user. 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 to be premium user`
|
||||||
)
|
)
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (data.Guild?.Category) {
|
if (data.Guild?.Category) {
|
||||||
if (data.Guild.Category.includes(cmd.directory)) {
|
if (data.Guild.Category.includes(cmd.directory)) {
|
||||||
return interaction.followUp({
|
return interaction.followUp({
|
||||||
content: "This command has been disabled in this server",
|
content: "This command has been disabled in this server",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (data.Guild?.Commands) {
|
if (data.Guild?.Commands) {
|
||||||
if (data.Guild.Commands.includes(cmd.name)) {
|
if (data.Guild.Commands.includes(cmd.name)) {
|
||||||
return interaction.followUp({
|
return interaction.followUp({
|
||||||
content: "This command has been disabled in this server",
|
content: "This command has been disabled in this server",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd.timeout) {
|
if (cmd.timeout) {
|
||||||
const current_time = Date.now();
|
const current_time = Date.now();
|
||||||
const cooldown_amount = cmd.timeout;
|
const cooldown_amount = cmd.timeout;
|
||||||
cooldown.findOne(
|
cooldown.findOne(
|
||||||
{ User: interaction.user.id, CMD: cmd.name },
|
{ User: interaction.user.id, CMD: cmd.name },
|
||||||
async (er, d) => {
|
async (er, d) => {
|
||||||
if (d) {
|
if (d) {
|
||||||
const expiration_time = d.Time + cooldown_amount;
|
const expiration_time = d.Time + cooldown_amount;
|
||||||
if (current_time < expiration_time) {
|
if (current_time < expiration_time) {
|
||||||
if (data.Guild.Tips) utils.tips(interaction, client);
|
if (data.Guild.Tips) utils.tips(interaction, client);
|
||||||
utils.cooldown(d.Time, cooldown_amount, interaction);
|
utils.cooldown(d.Time, cooldown_amount, interaction);
|
||||||
} else {
|
} else {
|
||||||
if (data.Guild.Tips) utils.tips(interaction, client);
|
if (data.Guild.Tips) utils.tips(interaction, client);
|
||||||
await cooldown.findOneAndUpdate(
|
await cooldown.findOneAndUpdate(
|
||||||
{ User: interaction.user.id, CMD: cmd.name },
|
{ User: interaction.user.id, CMD: cmd.name },
|
||||||
{ Time: current_time }
|
{ Time: current_time }
|
||||||
);
|
);
|
||||||
cmd
|
cmd
|
||||||
.run(client, interaction, args, utils, data)
|
.run(client, interaction, args, utils, data)
|
||||||
.catch(e => sendE(e, interaction));
|
.catch(e => sendE(e, interaction));
|
||||||
client.channels.cache.get(client.config.CMDLog).send({
|
client.channels.cache.get(client.config.CMDLog).send({
|
||||||
content: `\`${interaction.user.tag}(${interaction.user.id})\`\n has used \n**${cmd.name}**\n command in \n\`${interaction.guild.name}(${interaction.guild.id})\``,
|
content: `\`${interaction.user.tag}(${interaction.user.id})\`\n has used \n**${cmd.name}**\n command in \n\`${interaction.guild.name}(${interaction.guild.id})\``,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (data.Guild.Tips) utils.tips(interaction, client);
|
if (data.Guild.Tips) utils.tips(interaction, client);
|
||||||
cmd
|
cmd
|
||||||
.run(client, interaction, args, utils, data)
|
.run(client, interaction, args, utils, data)
|
||||||
.catch(e => sendE(e, interaction));
|
.catch(e => sendE(e, interaction));
|
||||||
client.channels.cache.get(client.config.CMDLog).send({
|
client.channels.cache.get(client.config.CMDLog).send({
|
||||||
content: `\`${interaction.user.tag}(${interaction.user.id})\`\n has used \n**${cmd.name}**\n command in \n\`${interaction.guild.name}(${interaction.guild.id})\``,
|
content: `\`${interaction.user.tag}(${interaction.user.id})\`\n has used \n**${cmd.name}**\n command in \n\`${interaction.guild.name}(${interaction.guild.id})\``,
|
||||||
});
|
});
|
||||||
new cooldown({
|
new cooldown({
|
||||||
User: interaction.user.id,
|
User: interaction.user.id,
|
||||||
CMD: cmd.name,
|
CMD: cmd.name,
|
||||||
Time: current_time,
|
Time: current_time,
|
||||||
Cooldown: cmd.timeout,
|
Cooldown: cmd.timeout,
|
||||||
}).save();
|
}).save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
if (data.Guild.Tips) utils.tips(interaction, client);
|
if (data.Guild.Tips) utils.tips(interaction, client);
|
||||||
cmd
|
cmd
|
||||||
.run(client, interaction, args, utils, data)
|
.run(client, interaction, args, utils, data)
|
||||||
.catch(e => sendE(e, interaction));
|
.catch(e => sendE(e, interaction));
|
||||||
client.channels.cache.get(client.config.CMDLog).send({
|
client.channels.cache.get(client.config.CMDLog).send({
|
||||||
content: `\`${interaction.user.tag}(${interaction.user.id})\`\n has used \n**${cmd.name}**\n command in \n\`${interaction.guild.name}(${interaction.guild.id})\``,
|
content: `\`${interaction.user.tag}(${interaction.user.id})\`\n has used \n**${cmd.name}**\n command in \n\`${interaction.guild.name}(${interaction.guild.id})\``,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (interaction.isContextMenuCommand()) {
|
if (interaction.isContextMenuCommand()) {
|
||||||
await interaction.deferReply({ ephemeral: false });
|
await interaction.deferReply({ ephemeral: false });
|
||||||
const command = client.slashCommands.get(interaction.commandName);
|
const command = client.slashCommands.get(interaction.commandName);
|
||||||
if (command) command.run(client, interaction);
|
if (command) command.run(client, interaction);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
client.on("interactionCreate", async interaction => {
|
client.on("interactionCreate", async interaction => {
|
||||||
if (interaction.isCommand()) {
|
if (interaction.isCommand()) {
|
||||||
await interaction.deferReply({ ephemeral: false }).catch(() => {});
|
await interaction.deferReply({ ephemeral: false }).catch(() => {});
|
||||||
const ownercmd = client.hide.get(interaction.commandName);
|
const ownercmd = client.hide.get(interaction.commandName);
|
||||||
if (!ownercmd) return;
|
if (!ownercmd) return;
|
||||||
const args = [];
|
const args = [];
|
||||||
for (const option of interaction.options.data) {
|
for (const option of interaction.options.data) {
|
||||||
if (option.type === 1) {
|
if (option.type === 1) {
|
||||||
if (option.name) args.push(option.name);
|
if (option.name) args.push(option.name);
|
||||||
option.options?.forEach(x => {
|
option.options?.forEach(x => {
|
||||||
if (x.value) args.push(x.value);
|
if (x.value) args.push(x.value);
|
||||||
});
|
});
|
||||||
} else if (option.value) {
|
} else if (option.value) {
|
||||||
args.push(option.value);
|
args.push(option.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
interaction.member = interaction.guild.members.cache.get(
|
interaction.member = interaction.guild.members.cache.get(
|
||||||
interaction.user.id
|
interaction.user.id
|
||||||
);
|
);
|
||||||
ownercmd
|
ownercmd
|
||||||
.run(client, interaction, args, utils)
|
.run(client, interaction, args, utils)
|
||||||
.catch(e => sendE(e, interaction));
|
.catch(e => sendE(e, interaction));
|
||||||
client.channels.cache.get(client.config.CMDLog).send({
|
client.channels.cache.get(client.config.CMDLog).send({
|
||||||
content: `\`${interaction.user.tag}(${interaction.user.id})\`\n has used \n**${ownercmd.name}**\n command in \n\`${interaction.guild.name}(${interaction.guild.id})\``,
|
content: `\`${interaction.user.tag}(${interaction.user.id})\`\n has used \n**${ownercmd.name}**\n command in \n\`${interaction.guild.name}(${interaction.guild.id})\``,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
function sendE(e, i) {
|
function sendE(e, i) {
|
||||||
console.error(e.stack);
|
console.error(e.stack);
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle("Command Error")
|
.setTitle("Command Error")
|
||||||
.setDescription(`\`\`\`yaml\n${e.stack}\`\`\``)
|
.setDescription(`\`\`\`yaml\n${e.stack}\`\`\``)
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setFooter({ text: client.user.username });
|
.setFooter({ text: client.user.username });
|
||||||
i.channel.send({ embeds: [embed] });
|
i.channel.send({ embeds: [embed] });
|
||||||
client.channels.cache.get(client.config.ErrorLog).send({ embeds: [embed] });
|
client.channels.cache.get(client.config.ErrorLog).send({ embeds: [embed] });
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,245 +1,245 @@
|
||||||
const client = require("..");
|
const client = require("..");
|
||||||
const { EmbedBuilder, ChannelType } = require("discord.js");
|
const { EmbedBuilder, ChannelType } = require("discord.js");
|
||||||
const Utils = require("../util/functions/function");
|
const Utils = require("../util/functions/function");
|
||||||
const domains = require("../util/Data/domains.json");
|
const domains = require("../util/Data/domains.json");
|
||||||
client.on("messageCreate", async message => {
|
client.on("messageCreate", async message => {
|
||||||
if (message.author.bot || !message.guild) return;
|
if (message.author.bot || !message.guild) return;
|
||||||
const data = {};
|
const data = {};
|
||||||
const guildDB = await client.data.getGuild(message.guild.id);
|
const guildDB = await client.data.getGuild(message.guild.id);
|
||||||
if (!guildDB) return;
|
if (!guildDB) return;
|
||||||
const userDB = await client.data.getUser(message.author?.id);
|
const userDB = await client.data.getUser(message.author?.id);
|
||||||
if (!userDB) return;
|
if (!userDB) return;
|
||||||
data.Guild = guildDB;
|
data.Guild = guildDB;
|
||||||
data.User = userDB;
|
data.User = userDB;
|
||||||
if (!guildDB) await client.data.CreateGuild(message.guild.id);
|
if (!guildDB) await client.data.CreateGuild(message.guild.id);
|
||||||
if (message.content.match(new RegExp(`^<@!?${client.user.id}>( |)$`))) {
|
if (message.content.match(new RegExp(`^<@!?${client.user.id}>( |)$`))) {
|
||||||
const _ = new EmbedBuilder()
|
const _ = new EmbedBuilder()
|
||||||
.addFields(
|
.addFields(
|
||||||
{
|
{
|
||||||
name: "Prefix/Usage",
|
name: "Prefix/Usage",
|
||||||
value: "Run `/help` to start using the bot",
|
value: "Run `/help` to start using the bot",
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: ":link: **Invite Me**",
|
name: ":link: **Invite Me**",
|
||||||
value: `[Click Here](${Utils.inviteLink(client)})`,
|
value: `[Click Here](${Utils.inviteLink(client)})`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "<:support1:867093614403256350> **Need Help ?**",
|
name: "<:support1:867093614403256350> **Need Help ?**",
|
||||||
value: `Join our [Support Server](https://discord.gg/SbQHChmGcp)`,
|
value: `Join our [Support Server](https://discord.gg/SbQHChmGcp)`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "<:YouTube:841186450497339412> **Video Guide**",
|
name: "<:YouTube:841186450497339412> **Video Guide**",
|
||||||
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
|
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: `<:nyx_description:897379659665264650> Documentation`,
|
name: `<:nyx_description:897379659665264650> Documentation`,
|
||||||
value: `[Click here](${client.docs})`,
|
value: `[Click here](${client.docs})`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "<a:donate:896985486260846614> **Support us**",
|
name: "<a:donate:896985486260846614> **Support us**",
|
||||||
value: `[KoFi](https://ko-fi.com/cathteam)`,
|
value: `[KoFi](https://ko-fi.com/cathteam)`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "<a:booster:896527475063025704> **Premium**",
|
name: "<a:booster:896527475063025704> **Premium**",
|
||||||
value: `You can either boost the support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam).\n Another option would be to gift a nitro subscription to one of the developers.`,
|
value: `You can either boost the support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam).\n Another option would be to gift a nitro subscription to one of the developers.`,
|
||||||
inline: false,
|
inline: false,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.setTitle(client.user.username)
|
.setTitle(client.user.username)
|
||||||
|
|
||||||
.setThumbnail(client.user.displayAvatarURL({ dynamic: true }))
|
.setThumbnail(client.user.displayAvatarURL({ dynamic: true }))
|
||||||
.setURL(client.web)
|
.setURL(client.web)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Made by ${client.author}`,
|
text: `Made by ${client.author}`,
|
||||||
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
iconURL: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setColor(client.color);
|
.setColor(client.color);
|
||||||
try {
|
try {
|
||||||
const m = await message.reply({
|
const m = await message.reply({
|
||||||
embeds: [_],
|
embeds: [_],
|
||||||
components: Utils.buttons(client),
|
components: Utils.buttons(client),
|
||||||
});
|
});
|
||||||
setTimeout(() => m.delete(), 15000);
|
setTimeout(() => m.delete(), 15000);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
}
|
}
|
||||||
if (data.User?.Blacklist) return;
|
if (data.User?.Blacklist) return;
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
domains.iplogger.includes(
|
domains.iplogger.includes(
|
||||||
message.content
|
message.content
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.match(
|
.match(
|
||||||
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
|
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
|
||||||
)?.[0]
|
)?.[0]
|
||||||
.replace(/(https|http):\/\/+/g, "")
|
.replace(/(https|http):\/\/+/g, "")
|
||||||
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
|
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
|
||||||
.slice(0, -1)
|
.slice(0, -1)
|
||||||
) ||
|
) ||
|
||||||
domains.scam.includes(
|
domains.scam.includes(
|
||||||
message.content
|
message.content
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.match(
|
.match(
|
||||||
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
|
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
|
||||||
)?.[0]
|
)?.[0]
|
||||||
.replace(/(https|http):\/\/+/g, "")
|
.replace(/(https|http):\/\/+/g, "")
|
||||||
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
|
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
|
||||||
.slice(0, -1)
|
.slice(0, -1)
|
||||||
) ||
|
) ||
|
||||||
domains.ngrok.includes(
|
domains.ngrok.includes(
|
||||||
message.content
|
message.content
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.match(
|
.match(
|
||||||
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
|
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
|
||||||
)?.[0]
|
)?.[0]
|
||||||
.replace(/(https|http):\/\/+/g, "")
|
.replace(/(https|http):\/\/+/g, "")
|
||||||
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
|
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
|
||||||
.slice(0, -1)
|
.slice(0, -1)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
const _ = new EmbedBuilder()
|
const _ = new EmbedBuilder()
|
||||||
.setTitle(`Scam/IP Grabber detected`)
|
.setTitle(`Scam/IP Grabber detected`)
|
||||||
.setTimestamp()
|
.setTimestamp()
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.addFields(
|
.addFields(
|
||||||
{
|
{
|
||||||
name: "User",
|
name: "User",
|
||||||
value: `${message.author.tag} (${message.author.id})`,
|
value: `${message.author.tag} (${message.author.id})`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Scam/IP Logger URL",
|
name: "Scam/IP Logger URL",
|
||||||
value: `||https://${message.content
|
value: `||https://${message.content
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.match(
|
.match(
|
||||||
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
|
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
|
||||||
)?.[0]
|
)?.[0]
|
||||||
.replace(/(https|http):\/\/+/g, "")
|
.replace(/(https|http):\/\/+/g, "")
|
||||||
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
|
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
|
||||||
.slice(0, -1)}||`,
|
.slice(0, -1)}||`,
|
||||||
inline: true,
|
inline: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Tactical Protection by ${client.author}`,
|
text: `Tactical Protection by ${client.author}`,
|
||||||
icon_url: client.user.displayAvatarURL({ dynamic: true }),
|
icon_url: client.user.displayAvatarURL({ dynamic: true }),
|
||||||
});
|
});
|
||||||
message.channel.send({
|
message.channel.send({
|
||||||
embeds: [_],
|
embeds: [_],
|
||||||
});
|
});
|
||||||
client.channels.cache.get(client.config.ScamLinkLog).send({
|
client.channels.cache.get(client.config.ScamLinkLog).send({
|
||||||
embeds: [
|
embeds: [
|
||||||
_.addFields(
|
_.addFields(
|
||||||
{
|
{
|
||||||
name: "Message",
|
name: "Message",
|
||||||
value: message.content,
|
value: message.content,
|
||||||
inline: false,
|
inline: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Guild",
|
name: "Guild",
|
||||||
value: message.guild ? message.guild.name : "None",
|
value: message.guild ? message.guild.name : "None",
|
||||||
inline: true,
|
inline: true,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
message.delete().catch(() => {});
|
message.delete().catch(() => {});
|
||||||
}
|
}
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
message?.content.startsWith(data.Guild.Prefix) ||
|
message?.content.startsWith(data.Guild.Prefix) ||
|
||||||
message?.content.toLowerCase().startsWith("c.")
|
message?.content.toLowerCase().startsWith("c.")
|
||||||
) {
|
) {
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setTitle(`Message commands are now disabled`)
|
.setTitle(`Message commands are now disabled`)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`Please enable **Use Application Commands** in the channel settings to get access to slash commands, we have discontinued message commands\n\nUse \`/help\` to see more info`
|
`Please enable **Use Application Commands** in the channel settings to get access to slash commands, we have discontinued message commands\n\nUse \`/help\` to see more info`
|
||||||
)
|
)
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setThumbnail(message.guild.iconURL({ dynamic: true }))
|
.setThumbnail(message.guild.iconURL({ dynamic: true }))
|
||||||
.addFields(
|
.addFields(
|
||||||
{
|
{
|
||||||
name: ":link: **Invite Me**",
|
name: ":link: **Invite Me**",
|
||||||
value: `[Click Here](${Utils.inviteLink(client.user.id)})`,
|
value: `[Click Here](${Utils.inviteLink(client.user.id)})`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "<:support1:867093614403256350> **Need Help ?**",
|
name: "<:support1:867093614403256350> **Need Help ?**",
|
||||||
value: `Join our [Support Server](https://discord.gg/SbQHChmGcp)`,
|
value: `Join our [Support Server](https://discord.gg/SbQHChmGcp)`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "<:YouTube:841186450497339412> **Video Guide**",
|
name: "<:YouTube:841186450497339412> **Video Guide**",
|
||||||
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
|
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: `<:nyx_description:897379659665264650> Documentation`,
|
name: `<:nyx_description:897379659665264650> Documentation`,
|
||||||
value: `[Click here](${client.docs})`,
|
value: `[Click here](${client.docs})`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "<a:donate:896985486260846614> **Support us**",
|
name: "<a:donate:896985486260846614> **Support us**",
|
||||||
value: `[KoFi](https://ko-fi.com/cathteam)`,
|
value: `[KoFi](https://ko-fi.com/cathteam)`,
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "<a:booster:896527475063025704> **Premium**",
|
name: "<a:booster:896527475063025704> **Premium**",
|
||||||
value: `You can either boost support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team.`,
|
value: `You can either boost support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team.`,
|
||||||
inline: false,
|
inline: false,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.setURL(client.web)
|
.setURL(client.web)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Requested by ${message.author.tag}`,
|
text: `Requested by ${message.author.tag}`,
|
||||||
iconURL: message.author.displayAvatarURL({ dynamic: true }),
|
iconURL: message.author.displayAvatarURL({ dynamic: true }),
|
||||||
})
|
})
|
||||||
.setThumbnail(
|
.setThumbnail(
|
||||||
"https://raw.githubusercontent.com/night0721/cath.exe/main/util/assets/images/nyx_logo_transparent.webp"
|
"https://raw.githubusercontent.com/night0721/cath.exe/main/util/assets/images/nyx_logo_transparent.webp"
|
||||||
)
|
)
|
||||||
.setTimestamp();
|
.setTimestamp();
|
||||||
message.reply({
|
message.reply({
|
||||||
embeds: [embed],
|
embeds: [embed],
|
||||||
components: Utils.buttons(client),
|
components: Utils.buttons(client),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
client.on("messageCreate", async message => {
|
client.on("messageCreate", async message => {
|
||||||
if (message.channel.type === ChannelType.DM && !message.author.bot) {
|
if (message.channel.type === ChannelType.DM && !message.author.bot) {
|
||||||
if (message.attachments && message?.content) {
|
if (message.attachments && message?.content) {
|
||||||
message.attachments.map(e =>
|
message.attachments.map(e =>
|
||||||
client.channels.cache.get(client.config.DMLog).send({
|
client.channels.cache.get(client.config.DMLog).send({
|
||||||
content: `\`${message.author.tag}(${message.author.id})\`: ${
|
content: `\`${message.author.tag}(${message.author.id})\`: ${
|
||||||
message.content + e.url
|
message.content + e.url
|
||||||
}`,
|
}`,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
message.attachments.map(e =>
|
message.attachments.map(e =>
|
||||||
client.channels.cache.get(client.config.DMLog).send({
|
client.channels.cache.get(client.config.DMLog).send({
|
||||||
content: `\`${message.author.tag}(${message.author.id})\`: ${e.url}`,
|
content: `\`${message.author.tag}(${message.author.id})\`: ${e.url}`,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (message.content) {
|
if (message.content) {
|
||||||
client.channels.cache.get(client.config.DMLog).send({
|
client.channels.cache.get(client.config.DMLog).send({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setDescription(message.content)
|
.setDescription(message.content)
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setAuthor({
|
.setAuthor({
|
||||||
name: message.author.tag,
|
name: message.author.tag,
|
||||||
iconURL: message.author.displayAvatarURL({ dynamic: true }),
|
iconURL: message.author.displayAvatarURL({ dynamic: true }),
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const client = require("..");
|
const client = require("..");
|
||||||
client.on("ready", async () => {
|
client.on("ready", async () => {
|
||||||
console.log(`${client.user.username} ✅`);
|
console.log(`${client.user.username} ✅`);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
const { ChannelType } = require("discord.js");
|
const { ChannelType } = require("discord.js");
|
||||||
const client = require("..");
|
const client = require("..");
|
||||||
client.on("typingStart", async typing => {
|
client.on("typingStart", async typing => {
|
||||||
if (
|
if (
|
||||||
!typing.user ||
|
!typing.user ||
|
||||||
typing.user.bot ||
|
typing.user.bot ||
|
||||||
!typing.channel ||
|
!typing.channel ||
|
||||||
typing.channel.type != ChannelType.DM
|
typing.channel.type != ChannelType.DM
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
typing.user.send({
|
typing.user.send({
|
||||||
content:
|
content:
|
||||||
"```DMs is reserved for bug reports/suggestions/feedbacks/queries and is forwarded to the developers. Please refrain from using it as a clipboard or trying to run commands in here [by violating this condition, you agree to let us sell your data]```",
|
"```DMs is reserved for bug reports/suggestions/feedbacks/queries and is forwarded to the developers. Please refrain from using it as a clipboard or trying to run commands in here [by violating this condition, you agree to let us sell your data]```",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
10
index.js
10
index.js
|
@ -1,5 +1,5 @@
|
||||||
const NYX = require("./client/NYX");
|
const NYX = require("./client/NYX");
|
||||||
const client = new NYX();
|
const client = new NYX();
|
||||||
module.exports = client;
|
module.exports = client;
|
||||||
process.on("unhandledRejection", () => {}); // add // when need to debug
|
process.on("unhandledRejection", () => {}); // add // when need to debug
|
||||||
client.start();
|
client.start();
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
const { Schema, model } = require("mongoose");
|
const { Schema, model } = require("mongoose");
|
||||||
module.exports = model(
|
module.exports = model(
|
||||||
"cooldown",
|
"cooldown",
|
||||||
new Schema({
|
new Schema({
|
||||||
User: {
|
User: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
CMD: {
|
CMD: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: "",
|
||||||
},
|
},
|
||||||
Time: {
|
Time: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
Cooldown: {
|
Cooldown: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
const mongoose = require("mongoose");
|
const mongoose = require("mongoose");
|
||||||
const prefix = require("../config").prefix;
|
const prefix = require("../config").prefix;
|
||||||
module.exports = mongoose.model(
|
module.exports = mongoose.model(
|
||||||
"guild",
|
"guild",
|
||||||
new mongoose.Schema({
|
new mongoose.Schema({
|
||||||
Guild: String,
|
Guild: String,
|
||||||
Prefix: {
|
Prefix: {
|
||||||
type: String,
|
type: String,
|
||||||
default: prefix,
|
default: prefix,
|
||||||
},
|
},
|
||||||
Premium: {
|
Premium: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
Category: {
|
Category: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: [],
|
||||||
},
|
},
|
||||||
Commands: {
|
Commands: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: [],
|
||||||
},
|
},
|
||||||
Tips: {
|
Tips: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
const mongoose = require("mongoose");
|
const mongoose = require("mongoose");
|
||||||
module.exports = mongoose.model(
|
module.exports = mongoose.model(
|
||||||
"user",
|
"user",
|
||||||
new mongoose.Schema({
|
new mongoose.Schema({
|
||||||
User: String,
|
User: String,
|
||||||
Tier: {
|
Tier: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
Premium: {
|
Premium: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
Blacklist: {
|
Blacklist: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
Blacklist_Reason: {
|
Blacklist_Reason: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "null",
|
default: "null",
|
||||||
},
|
},
|
||||||
PremiumServers: {
|
PremiumServers: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: [],
|
||||||
},
|
},
|
||||||
CommandUsed: {
|
CommandUsed: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,32 +1,32 @@
|
||||||
// Do we still need this ?
|
// Do we still need this ?
|
||||||
|
|
||||||
const mongoose = require("mongoose");
|
const mongoose = require("mongoose");
|
||||||
module.exports = mongoose.model(
|
module.exports = mongoose.model(
|
||||||
"weapons",
|
"weapons",
|
||||||
new mongoose.Schema({
|
new mongoose.Schema({
|
||||||
Categories: {
|
Categories: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: [],
|
||||||
},
|
},
|
||||||
Primary: {
|
Primary: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: [],
|
||||||
},
|
},
|
||||||
Secondary: {
|
Secondary: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: [],
|
||||||
},
|
},
|
||||||
Equipment: {
|
Equipment: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: [],
|
||||||
},
|
},
|
||||||
OperatorSkill: {
|
OperatorSkill: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: [],
|
||||||
},
|
},
|
||||||
Perk: {
|
Perk: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: [],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
100
package.json
100
package.json
|
@ -1,50 +1,50 @@
|
||||||
{
|
{
|
||||||
"name": "cath.exe",
|
"name": "cath.exe",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"description": "NYX bot created by Team NYX",
|
"description": "NYX bot created by Team NYX",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "*",
|
"node": "*",
|
||||||
"npm": "*"
|
"npm": "*"
|
||||||
},
|
},
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "node . --dev",
|
"dev": "node . --dev",
|
||||||
"start": "node . --prod",
|
"start": "node . --prod",
|
||||||
"node-update": "npm i --save-dev node@17 && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH",
|
"node-update": "npm i --save-dev node@17 && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH",
|
||||||
"node-clean": "rm -rf node_modules && rm package-lock.json && npm cache clear --force && npm cache clean --force && npm i",
|
"node-clean": "rm -rf node_modules && rm package-lock.json && npm cache clear --force && npm cache clean --force && npm i",
|
||||||
"all": "npm run node-update && npm run node-clean"
|
"all": "npm run node-update && npm run node-clean"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/night0721/cath.exe.git"
|
"url": "git+https://github.com/night0721/cath.exe.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"bot",
|
"bot",
|
||||||
"nyx",
|
"nyx",
|
||||||
"codm",
|
"codm",
|
||||||
"discord",
|
"discord",
|
||||||
"gunsmith"
|
"gunsmith"
|
||||||
],
|
],
|
||||||
"author": "Ń1ght#0001",
|
"author": "Ń1ght#0001",
|
||||||
"license": "CC-BY-NC-SA-4.0",
|
"license": "CC-BY-NC-SA-4.0",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/night0721/cath.exe/issues"
|
"url": "https://github.com/night0721/cath.exe/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/night0721/cath.exe#readme",
|
"homepage": "https://github.com/night0721/cath.exe#readme",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "individual",
|
"type": "individual",
|
||||||
"url": "https://ko-fi.com/cathteam"
|
"url": "https://ko-fi.com/cathteam"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"node": "^19.0.0"
|
"node": "^19.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.1.3",
|
"axios": "^1.1.3",
|
||||||
"cath": "^1.5.13",
|
"cath": "^1.5.13",
|
||||||
"discord.js": "^14.9.0",
|
"discord.js": "^14.9.0",
|
||||||
"dotenv": "^16.0.3",
|
"dotenv": "^16.0.3",
|
||||||
"goosecache": "^9.0.14",
|
"goosecache": "^9.0.14",
|
||||||
"mongoose": "^5.13.14",
|
"mongoose": "^5.13.14",
|
||||||
"quickchart-js": "^3.1.0"
|
"quickchart-js": "^3.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,78 +1,78 @@
|
||||||
const { EmbedBuilder } = require("discord.js"); //@night0721 You need to make this
|
const { EmbedBuilder } = 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 EmbedBuilder()
|
||||||
.setColor(client.color)
|
.setColor(client.color)
|
||||||
.setFooter({ text: `Made by ${client.author}` })
|
.setFooter({ text: `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, \`/class\` 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,297 @@
|
||||||
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 { EmbedBuilder } = 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 = {
|
module.exports = {
|
||||||
name: "stats",
|
name: "stats",
|
||||||
description: "Check gun statistics",
|
description: "Check gun statistics",
|
||||||
usage: "(Gun)",
|
usage: "(Gun)",
|
||||||
category: "CODM",
|
category: "CODM",
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "gun_name",
|
name: "gun_name",
|
||||||
description: "Name of the gun",
|
description: "Name of the gun",
|
||||||
required: true,
|
required: true,
|
||||||
choices: [],
|
choices: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "1st_attchment",
|
name: "1st_attchment",
|
||||||
description: "First attachment",
|
description: "First attachment",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "2nd_attchment",
|
name: "2nd_attchment",
|
||||||
description: "Second attachment",
|
description: "Second attachment",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "3rd_attchment",
|
name: "3rd_attchment",
|
||||||
description: "Third attachment",
|
description: "Third attachment",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "4th_attchment",
|
name: "4th_attchment",
|
||||||
description: "Forth attachment",
|
description: "Forth attachment",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 3,
|
type: 3,
|
||||||
name: "5th_attchment",
|
name: "5th_attchment",
|
||||||
description: "Fifth attachment",
|
description: "Fifth attachment",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
run: async (client, interaction, args) => {
|
run: async (client, interaction, args) => {
|
||||||
repEmb = null;
|
repEmb = null;
|
||||||
recoilAvailable = false;
|
recoilAvailable = false;
|
||||||
hasError = false;
|
hasError = false;
|
||||||
if (args.length == 1)
|
if (args.length == 1)
|
||||||
repEmb = statsHandler(args.join(" ").replace("\n", " "));
|
repEmb = statsHandler(args.join(" ").replace("\n", " "));
|
||||||
else repEmb = statsHandler(args.join(" + ").replace("\n", " "));
|
else repEmb = statsHandler(args.join(" + ").replace("\n", " "));
|
||||||
if (hasError) {
|
if (hasError) {
|
||||||
interaction.followUp({
|
interaction.followUp({
|
||||||
content: `**${repEmb || "An error has occured"}**`,
|
content: `**${repEmb || "An error has occured"}**`,
|
||||||
});
|
});
|
||||||
} 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 EmbedBuilder(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", //0
|
"Pellets", //0
|
||||||
"Detonation Range", //1
|
"Detonation Range", //1
|
||||||
"Explosion Radius", //2
|
"Explosion Radius", //2
|
||||||
"Explosion Damage", //3
|
"Explosion Damage", //3
|
||||||
"Firing Mode", //4
|
"Firing Mode", //4
|
||||||
"Rate of Fire", //5
|
"Rate of Fire", //5
|
||||||
"Bullet in Burst", //6
|
"Bullet in Burst", //6
|
||||||
"Time Between Burst", //7
|
"Time Between Burst", //7
|
||||||
"Bullet Speed", //8
|
"Bullet Speed", //8
|
||||||
"Penetration Level", //9
|
"Penetration Level", //9
|
||||||
"Bullet Spread", //10
|
"Bullet Spread", //10
|
||||||
"Idle Sway", //11
|
"Idle Sway", //11
|
||||||
"Hipfire Pellet Spread", //12
|
"Hipfire Pellet Spread", //12
|
||||||
"ADS Pellet Spread", //13
|
"ADS Pellet Spread", //13
|
||||||
"ADS Time", //14
|
"ADS Time", //14
|
||||||
"Sprint-to-Fire Time", //15
|
"Sprint-to-Fire Time", //15
|
||||||
"ADS Zoom", //16
|
"ADS Zoom", //16
|
||||||
"Magazine", //17
|
"Magazine", //17
|
||||||
"Reserve", //18
|
"Reserve", //18
|
||||||
"Reload Type", //19
|
"Reload Type", //19
|
||||||
"Cancel Reload Time", //20
|
"Cancel Reload Time", //20
|
||||||
"Reload Time", //21
|
"Reload Time", //21
|
||||||
"Full Reload Time", //22
|
"Full Reload Time", //22
|
||||||
"Drop Time", //23
|
"Drop Time", //23
|
||||||
"Raise Time", //24
|
"Raise Time", //24
|
||||||
"Sprinting Speed", //25
|
"Sprinting Speed", //25
|
||||||
"Walking Speed", //26
|
"Walking Speed", //26
|
||||||
"Straifing Speed", //27
|
"Straifing Speed", //27
|
||||||
"Damage per Tick", //28
|
"Damage per Tick", //28
|
||||||
"Number of Ticks", //29
|
"Number of Ticks", //29
|
||||||
"Time Between Ticks", //30
|
"Time Between Ticks", //30
|
||||||
"Breath Hold Time", //31
|
"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]; // base mag. currGun.drm[1] for more vairents
|
currDRM = currGun.drm[0]; // base mag. currGun.drm[1] for more vairents
|
||||||
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 7:
|
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 25:
|
case 25:
|
||||||
case 26:
|
case 26:
|
||||||
case 27:
|
case 27:
|
||||||
case 28:
|
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 6:
|
case 6:
|
||||||
return " Rounds";
|
return " Rounds";
|
||||||
case 5:
|
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 recoilAvailable = false;
|
} else recoilAvailable = false;
|
||||||
|
|
||||||
if (chart == "none") recoilAvailable = false;
|
if (chart == "none") recoilAvailable = false;
|
||||||
if (chart == "err") hasError = true;
|
if (chart == "err") hasError = true;
|
||||||
|
|
||||||
const dmg =
|
const dmg =
|
||||||
common.damageHandler(
|
common.damageHandler(
|
||||||
currDRM.damage,
|
currDRM.damage,
|
||||||
currDRM.range,
|
currDRM.range,
|
||||||
1,
|
1,
|
||||||
100,
|
100,
|
||||||
60000 / currStats[5],
|
60000 / currStats[5],
|
||||||
currStats[7],
|
currStats[7],
|
||||||
currStats[6],
|
currStats[6],
|
||||||
currStats[0]
|
currStats[0]
|
||||||
) || "```This should never happen```";
|
) || "```This should never happen```";
|
||||||
out = [
|
out = [
|
||||||
currGun.description
|
currGun.description
|
||||||
? {
|
? {
|
||||||
name: "**Description:**",
|
name: "**Description:**",
|
||||||
value: `\`\`\`\n${currGun.description}\`\`\``,
|
value: `\`\`\`\n${currGun.description}\`\`\``,
|
||||||
}
|
}
|
||||||
: {},
|
: {},
|
||||||
{ name: "**Damage Profile:**", value: dmg },
|
{ name: "**Damage Profile:**", value: dmg },
|
||||||
...out,
|
...out,
|
||||||
];
|
];
|
||||||
out = out.filter(x => x.value);
|
out = out.filter(x => x.value);
|
||||||
return {
|
return {
|
||||||
title: interpretion,
|
title: interpretion,
|
||||||
color: 5814783,
|
color: 5814783,
|
||||||
fields: out,
|
fields: out,
|
||||||
footer: {
|
footer: {
|
||||||
text: "[OUTDATED] All data courtesy of Project Lighthouse 2.0 and CoDM Research Crew",
|
text: "[OUTDATED] All data courtesy of Project Lighthouse 2.0 and CoDM Research Crew",
|
||||||
icon_url:
|
icon_url:
|
||||||
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png",
|
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,85 +1,85 @@
|
||||||
{
|
{
|
||||||
"weaponActualName": [
|
"weaponActualName": [
|
||||||
"Man-O-War",
|
"Man-O-War",
|
||||||
"Peacekeeper MK2",
|
"Peacekeeper MK2",
|
||||||
"Type 25",
|
"Type 25",
|
||||||
"QQ9",
|
"QQ9",
|
||||||
"Razorback",
|
"Razorback",
|
||||||
".50 GS",
|
".50 GS",
|
||||||
"Arctic .50",
|
"Arctic .50",
|
||||||
"Kilo Bolt-Action",
|
"Kilo Bolt-Action",
|
||||||
"Fennec",
|
"Fennec",
|
||||||
"FR .556",
|
"FR .556",
|
||||||
"DR-H",
|
"DR-H",
|
||||||
"RUS-79U",
|
"RUS-79U",
|
||||||
"J358",
|
"J358",
|
||||||
"NA-45",
|
"NA-45",
|
||||||
"HS2126",
|
"HS2126",
|
||||||
"QXR",
|
"QXR",
|
||||||
"Locus",
|
"Locus",
|
||||||
"Outlaw",
|
"Outlaw",
|
||||||
"Renetti",
|
"Renetti",
|
||||||
"PP19 Bizon",
|
"PP19 Bizon",
|
||||||
"AGR 556",
|
"AGR 556",
|
||||||
"BK57",
|
"BK57",
|
||||||
"ASM10",
|
"ASM10",
|
||||||
"CR-56 AMAX",
|
"CR-56 AMAX",
|
||||||
"Shorty",
|
"Shorty",
|
||||||
"Crossbow",
|
"Crossbow",
|
||||||
"R9-0",
|
"R9-0",
|
||||||
"PPSh-41",
|
"PPSh-41",
|
||||||
"CBR4",
|
"CBR4",
|
||||||
"SVD"
|
"SVD"
|
||||||
],
|
],
|
||||||
"weaponAlliasName": [
|
"weaponAlliasName": [
|
||||||
["MoW"],
|
["MoW"],
|
||||||
["PK"],
|
["PK"],
|
||||||
["T25"],
|
["T25"],
|
||||||
["MP5"],
|
["MP5"],
|
||||||
["RB", "RZBK"],
|
["RB", "RZBK"],
|
||||||
["Deagle", "Desert Eagle"],
|
["Deagle", "Desert Eagle"],
|
||||||
["A50", "Artic"],
|
["A50", "Artic"],
|
||||||
["Kar98k"],
|
["Kar98k"],
|
||||||
["Vector"],
|
["Vector"],
|
||||||
["FAMAS"],
|
["FAMAS"],
|
||||||
["Scar", "Scar-H", "Scar-L"],
|
["Scar", "Scar-H", "Scar-L"],
|
||||||
["AKS", "AKS 47U"],
|
["AKS", "AKS 47U"],
|
||||||
["Revolver"],
|
["Revolver"],
|
||||||
["gae"],
|
["gae"],
|
||||||
["Burst Shotty", "Burst Shotgun"],
|
["Burst Shotty", "Burst Shotgun"],
|
||||||
["MP7", "QQ11"],
|
["MP7", "QQ11"],
|
||||||
["Slow Outlaw", "Slower Outlaw"],
|
["Slow Outlaw", "Slower Outlaw"],
|
||||||
["bae"],
|
["bae"],
|
||||||
["Reneti", "Renneti", "Rennetti", "Burst Pistol"],
|
["Reneti", "Renneti", "Rennetti", "Burst Pistol"],
|
||||||
["pp bizon", "pp19"],
|
["pp bizon", "pp19"],
|
||||||
["AUG"],
|
["AUG"],
|
||||||
["AKBP", "Vepr"],
|
["AKBP", "Vepr"],
|
||||||
["AN94"],
|
["AN94"],
|
||||||
["CR56", "AMAX"],
|
["CR56", "AMAX"],
|
||||||
["725"],
|
["725"],
|
||||||
["cb", "bow"],
|
["cb", "bow"],
|
||||||
["r9", "R9-O"],
|
["r9", "R9-O"],
|
||||||
["ppsh", "pp41"],
|
["ppsh", "pp41"],
|
||||||
["p90"],
|
["p90"],
|
||||||
["Dragonov"]
|
["Dragonov"]
|
||||||
],
|
],
|
||||||
"attachmentActualName": [
|
"attachmentActualName": [
|
||||||
["akimbo", "Stopping Power"],
|
["akimbo", "Stopping Power"],
|
||||||
["Tactical Scope", "Laser", "Slug", "Magazine", "Reload", "Tactical Laser Sight"],
|
["Tactical Scope", "Laser", "Slug", "Magazine", "Reload", "Tactical Laser Sight"],
|
||||||
["5x [.338] Mag","5x [.300] Mag"],
|
["5x [.338] Mag","5x [.300] Mag"],
|
||||||
["Bowstring"]
|
["Bowstring"]
|
||||||
],
|
],
|
||||||
"attachmentAlliasName": [
|
"attachmentAlliasName": [
|
||||||
[["akim", "akimbo"], ["SP"]],
|
[["akim", "akimbo"], ["SP"]],
|
||||||
[
|
[
|
||||||
["1.5x", "1.5x Scope", "acog", "acog Scope"],
|
["1.5x", "1.5x Scope", "acog", "acog Scope"],
|
||||||
["Lazer"],
|
["Lazer"],
|
||||||
["Slugs"],
|
["Slugs"],
|
||||||
["Ammo", "Reload", "Mag"],
|
["Ammo", "Reload", "Mag"],
|
||||||
["Ammo", "Reload"],
|
["Ammo", "Reload"],
|
||||||
["OWC Laser", "OWC Lazer"]
|
["OWC Laser", "OWC Lazer"]
|
||||||
],
|
],
|
||||||
[[".338",".338 reload", "lapua"],[".300",".300 reload", "norma"]],
|
[[".338",".338 reload", "lapua"],[".300",".300 reload", "norma"]],
|
||||||
[["String"]]
|
[["String"]]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
30554
util/Data/domains.json
30554
util/Data/domains.json
File diff suppressed because it is too large
Load diff
|
@ -1,24 +1,24 @@
|
||||||
{
|
{
|
||||||
"ipgrabber": [
|
"ipgrabber": [
|
||||||
"iplogger.org",
|
"iplogger.org",
|
||||||
"2no.co",
|
"2no.co",
|
||||||
"iplogger.com",
|
"iplogger.com",
|
||||||
"iplogger.ru",
|
"iplogger.ru",
|
||||||
"yip.su",
|
"yip.su",
|
||||||
"iplogger.co",
|
"iplogger.co",
|
||||||
"iplogger.info",
|
"iplogger.info",
|
||||||
"ipgrabber.ru",
|
"ipgrabber.ru",
|
||||||
"ipgraber.ru",
|
"ipgraber.ru",
|
||||||
"iplis.ru",
|
"iplis.ru",
|
||||||
"02ip.ru",
|
"02ip.ru",
|
||||||
"ezstat.ru"
|
"ezstat.ru"
|
||||||
],
|
],
|
||||||
|
|
||||||
"other": [
|
"other": [
|
||||||
"www.ps3cfw.com/cool",
|
"www.ps3cfw.com/cool",
|
||||||
"www.ythingy.com",
|
"www.ythingy.com",
|
||||||
"blasze.tk",
|
"blasze.tk",
|
||||||
"www.fuekos.com",
|
"www.fuekos.com",
|
||||||
"www.myiptest.com"
|
"www.myiptest.com"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,48 +1,48 @@
|
||||||
{
|
{
|
||||||
"attachmentTypes": [
|
"attachmentTypes": [
|
||||||
"Optics",
|
"Optics",
|
||||||
"Underbarrel",
|
"Underbarrel",
|
||||||
"Rear Grip",
|
"Rear Grip",
|
||||||
"Laser",
|
"Laser",
|
||||||
"Muzzle",
|
"Muzzle",
|
||||||
"Barrel",
|
"Barrel",
|
||||||
"Stock",
|
"Stock",
|
||||||
"Ammunition",
|
"Ammunition",
|
||||||
"Perk",
|
"Perk",
|
||||||
"Trigger Action",
|
"Trigger Action",
|
||||||
"Guard",
|
"Guard",
|
||||||
"Bolt",
|
"Bolt",
|
||||||
"Bowstring",
|
"Bowstring",
|
||||||
"Limb",
|
"Limb",
|
||||||
"Smoothbore"
|
"Smoothbore"
|
||||||
],
|
],
|
||||||
"weaponTypes": [
|
"weaponTypes": [
|
||||||
"AR",
|
"AR",
|
||||||
"Sniper",
|
"Sniper",
|
||||||
"LMG",
|
"LMG",
|
||||||
"SMG",
|
"SMG",
|
||||||
"Shotgun",
|
"Shotgun",
|
||||||
"Marksman",
|
"Marksman",
|
||||||
"Pistol"
|
"Pistol"
|
||||||
],
|
],
|
||||||
"firingModes": [
|
"firingModes": [
|
||||||
"Full Auto",
|
"Full Auto",
|
||||||
"Semi Auto",
|
"Semi Auto",
|
||||||
"Burst",
|
"Burst",
|
||||||
"Break Action",
|
"Break Action",
|
||||||
"Pump Action",
|
"Pump Action",
|
||||||
"Lever Action",
|
"Lever Action",
|
||||||
"Bolt Action"
|
"Bolt Action"
|
||||||
],
|
],
|
||||||
"penetrationLevels": [
|
"penetrationLevels": [
|
||||||
"Zero",
|
"Zero",
|
||||||
"Low",
|
"Low",
|
||||||
"Medium",
|
"Medium",
|
||||||
"High"
|
"High"
|
||||||
],
|
],
|
||||||
"reloadTypes": [
|
"reloadTypes": [
|
||||||
"Magazine",
|
"Magazine",
|
||||||
"Single",
|
"Single",
|
||||||
"Belt"
|
"Belt"
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -1,24 +1,24 @@
|
||||||
{
|
{
|
||||||
"firingMode": "Firing Mode",
|
"firingMode": "Firing Mode",
|
||||||
"rof": "Rate of fire",
|
"rof": "Rate of fire",
|
||||||
"penetrationLevel": "Penetration Level",
|
"penetrationLevel": "Penetration Level",
|
||||||
"adsTime": "ADS Time",
|
"adsTime": "ADS Time",
|
||||||
"adsZoom": "ADS Zoom%",
|
"adsZoom": "ADS Zoom%",
|
||||||
"bht": "Breath Hold Time",
|
"bht": "Breath Hold Time",
|
||||||
"bsa": "Bullet Spread Accuracy",
|
"bsa": "Bullet Spread Accuracy",
|
||||||
"bulletVelocity": "Bullet Velocity",
|
"bulletVelocity": "Bullet Velocity",
|
||||||
"bulletsPerShot": "Bullets Per Shot",
|
"bulletsPerShot": "Bullets Per Shot",
|
||||||
"burstRpmDelay": "Burst Delay",
|
"burstRpmDelay": "Burst Delay",
|
||||||
"hipfireSpread": "Hipfire Spread",
|
"hipfireSpread": "Hipfire Spread",
|
||||||
"magazineSize": "Magazine Size",
|
"magazineSize": "Magazine Size",
|
||||||
"reserve": "Magazine Reserve",
|
"reserve": "Magazine Reserve",
|
||||||
"reloadTime": "Reload Time",
|
"reloadTime": "Reload Time",
|
||||||
"reloadCancel": "Reload Cancel",
|
"reloadCancel": "Reload Cancel",
|
||||||
"ReloadTimeEmpty": "Empty Reload Time",
|
"ReloadTimeEmpty": "Empty Reload Time",
|
||||||
"reloadCancelEmpty": "Empty Reload Cancel",
|
"reloadCancelEmpty": "Empty Reload Cancel",
|
||||||
"stf": "Sprint to fire",
|
"stf": "Sprint to fire",
|
||||||
"raiseTime": "Raise Time",
|
"raiseTime": "Raise Time",
|
||||||
"dropTime": "Drop Time",
|
"dropTime": "Drop Time",
|
||||||
"sprinting": "Sprinting Speed",
|
"sprinting": "Sprinting Speed",
|
||||||
"walking": "Movement Speed"
|
"walking": "Movement Speed"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,72 +1,72 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<svg
|
<svg
|
||||||
width="1030.303"
|
width="1030.303"
|
||||||
height="1000"
|
height="1000"
|
||||||
viewBox="0 0 1030.303 1000"
|
viewBox="0 0 1030.303 1000"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
id="svg9"
|
id="svg9"
|
||||||
sodipodi:docname="apex-legends-logo-white.svg"
|
sodipodi:docname="apex-legends-logo-white.svg"
|
||||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
<sodipodi:namedview
|
<sodipodi:namedview
|
||||||
id="namedview11"
|
id="namedview11"
|
||||||
pagecolor="#505050"
|
pagecolor="#505050"
|
||||||
bordercolor="#eeeeee"
|
bordercolor="#eeeeee"
|
||||||
borderopacity="1"
|
borderopacity="1"
|
||||||
inkscape:pageshadow="0"
|
inkscape:pageshadow="0"
|
||||||
inkscape:pageopacity="0"
|
inkscape:pageopacity="0"
|
||||||
inkscape:pagecheckerboard="0"
|
inkscape:pagecheckerboard="0"
|
||||||
showgrid="false"
|
showgrid="false"
|
||||||
fit-margin-top="0"
|
fit-margin-top="0"
|
||||||
fit-margin-left="0"
|
fit-margin-left="0"
|
||||||
fit-margin-right="0"
|
fit-margin-right="0"
|
||||||
fit-margin-bottom="0"
|
fit-margin-bottom="0"
|
||||||
inkscape:zoom="0.59916667"
|
inkscape:zoom="0.59916667"
|
||||||
inkscape:cx="514.88178"
|
inkscape:cx="514.88178"
|
||||||
inkscape:cy="499.86092"
|
inkscape:cy="499.86092"
|
||||||
inkscape:window-width="1920"
|
inkscape:window-width="1920"
|
||||||
inkscape:window-height="1001"
|
inkscape:window-height="1001"
|
||||||
inkscape:window-x="-9"
|
inkscape:window-x="-9"
|
||||||
inkscape:window-y="-9"
|
inkscape:window-y="-9"
|
||||||
inkscape:window-maximized="1"
|
inkscape:window-maximized="1"
|
||||||
inkscape:current-layer="svg9" />
|
inkscape:current-layer="svg9" />
|
||||||
<title
|
<title
|
||||||
id="title2">Apex Legends Symbol</title>
|
id="title2">Apex Legends Symbol</title>
|
||||||
<defs
|
<defs
|
||||||
id="defs4" />
|
id="defs4" />
|
||||||
<g
|
<g
|
||||||
id="Page-1"
|
id="Page-1"
|
||||||
stroke="none"
|
stroke="none"
|
||||||
stroke-width="1"
|
stroke-width="1"
|
||||||
fill="none"
|
fill="none"
|
||||||
fill-rule="evenodd"
|
fill-rule="evenodd"
|
||||||
transform="translate(-285,-100)"
|
transform="translate(-285,-100)"
|
||||||
style="fill:#ffffff">
|
style="fill:#ffffff">
|
||||||
<g
|
<g
|
||||||
id="apex-legends-symbol"
|
id="apex-legends-symbol"
|
||||||
transform="translate(285,100)"
|
transform="translate(285,100)"
|
||||||
fill="#130c0d"
|
fill="#130c0d"
|
||||||
fill-rule="nonzero"
|
fill-rule="nonzero"
|
||||||
style="fill:#ffffff">
|
style="fill:#ffffff">
|
||||||
<polygon
|
<polygon
|
||||||
id="Triangle-Copy"
|
id="Triangle-Copy"
|
||||||
points="878.78788,1000 589.76792,803.07099 757.45184,803.07099 515.15152,378.78788 273.6243,803.07099 439.49936,803.07099 151.51515,1000 0,878.78788 515.15152,0 1030.303,878.78788 "
|
points="878.78788,1000 589.76792,803.07099 757.45184,803.07099 515.15152,378.78788 273.6243,803.07099 439.49936,803.07099 151.51515,1000 0,878.78788 515.15152,0 1030.303,878.78788 "
|
||||||
style="fill:#ffffff" />
|
style="fill:#ffffff" />
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
<metadata
|
<metadata
|
||||||
id="metadata13">
|
id="metadata13">
|
||||||
<rdf:RDF>
|
<rdf:RDF>
|
||||||
<cc:Work
|
<cc:Work
|
||||||
rdf:about="">
|
rdf:about="">
|
||||||
<dc:title>Apex Legends Symbol</dc:title>
|
<dc:title>Apex Legends Symbol</dc:title>
|
||||||
</cc:Work>
|
</cc:Work>
|
||||||
</rdf:RDF>
|
</rdf:RDF>
|
||||||
</metadata>
|
</metadata>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
Before (image error) Size: 2.1 KiB After (image error) Size: 2.2 KiB |
|
@ -1,20 +1,20 @@
|
||||||
<?xml version="1.0" standalone="no"?>
|
<?xml version="1.0" standalone="no"?>
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
||||||
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
||||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
||||||
width="1000.000000pt" height="1034.000000pt" viewBox="0 0 1000.000000 1034.000000"
|
width="1000.000000pt" height="1034.000000pt" viewBox="0 0 1000.000000 1034.000000"
|
||||||
preserveAspectRatio="xMidYMid meet">
|
preserveAspectRatio="xMidYMid meet">
|
||||||
|
|
||||||
<g transform="translate(0.000000,1034.000000) scale(0.100000,-0.100000)"
|
<g transform="translate(0.000000,1034.000000) scale(0.100000,-0.100000)"
|
||||||
fill="#000000" stroke="none">
|
fill="#000000" stroke="none">
|
||||||
<path d="M590 5165 l0 -5170 680 680 680 680 0 3810 0 3810 -680 680 -680 680
|
<path d="M590 5165 l0 -5170 680 680 680 680 0 3810 0 3810 -680 680 -680 680
|
||||||
0 -5170z"/>
|
0 -5170z"/>
|
||||||
<path d="M8857 9692 l-637 -637 0 -3890 0 -3890 640 -640 640 -640 0 5168 c0
|
<path d="M8857 9692 l-637 -637 0 -3890 0 -3890 640 -640 640 -640 0 5168 c0
|
||||||
2842 -1 5167 -3 5167 -1 0 -289 -287 -640 -638z"/>
|
2842 -1 5167 -3 5167 -1 0 -289 -287 -640 -638z"/>
|
||||||
<path d="M6353 7388 l-1313 -1313 -1270 1270 -1270 1270 0 -905 0 -905 817
|
<path d="M6353 7388 l-1313 -1313 -1270 1270 -1270 1270 0 -905 0 -905 817
|
||||||
-817 818 -818 -818 -818 -817 -817 0 -810 0 -810 2585 2585 2585 2585 -2 808
|
-817 818 -818 -818 -818 -817 -817 0 -810 0 -810 2585 2585 2585 2585 -2 808
|
||||||
-3 807 -1312 -1312z"/>
|
-3 807 -1312 -1312z"/>
|
||||||
<path d="M5742 4467 l-452 -452 1190 -1190 1190 -1190 0 905 0 905 -738 738
|
<path d="M5742 4467 l-452 -452 1190 -1190 1190 -1190 0 905 0 905 -738 738
|
||||||
-737 737 -453 -453z"/>
|
-737 737 -453 -453z"/>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
Before (image error) Size: 924 B After (image error) Size: 944 B |
68
util/dist/handler.js
vendored
68
util/dist/handler.js
vendored
|
@ -1,34 +1,34 @@
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const cmds = [];
|
const cmds = [];
|
||||||
const ownercmds = [];
|
const ownercmds = [];
|
||||||
module.exports = async client => {
|
module.exports = async client => {
|
||||||
fs.readdirSync("./events").forEach(file => {
|
fs.readdirSync("./events").forEach(file => {
|
||||||
require(`${process.cwd()}/events/${file}`);
|
require(`${process.cwd()}/events/${file}`);
|
||||||
});
|
});
|
||||||
fs.readdirSync("./command").forEach(directory => {
|
fs.readdirSync("./command").forEach(directory => {
|
||||||
if (directory !== "Owner") {
|
if (directory !== "Owner") {
|
||||||
const commands = fs.readdirSync(`./command/${directory}/`);
|
const commands = fs.readdirSync(`./command/${directory}/`);
|
||||||
commands.map(value => {
|
commands.map(value => {
|
||||||
const file = require(`${process.cwd()}/command/${directory}/${value}`);
|
const file = require(`${process.cwd()}/command/${directory}/${value}`);
|
||||||
if (file.name) {
|
if (file.name) {
|
||||||
const properties = { directory, ...file };
|
const properties = { directory, ...file };
|
||||||
client.slashCommands.set(file.name, properties);
|
client.slashCommands.set(file.name, properties);
|
||||||
}
|
}
|
||||||
if (["MESSAGE", "USER"].includes(file.type)) delete file.description;
|
if (["MESSAGE", "USER"].includes(file.type)) delete file.description;
|
||||||
if (file.UserPerms) file.defaultPermission = false;
|
if (file.UserPerms) file.defaultPermission = false;
|
||||||
cmds.push(file);
|
cmds.push(file);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
fs.readdirSync("./command/Owner").forEach(f => {
|
fs.readdirSync("./command/Owner").forEach(f => {
|
||||||
const file = require(`${process.cwd()}/command/Owner/${f}`);
|
const file = require(`${process.cwd()}/command/Owner/${f}`);
|
||||||
client.hide.set(file.name, file);
|
client.hide.set(file.name, file);
|
||||||
if (["MESSAGE", "USER"].includes(file.type)) delete file.description;
|
if (["MESSAGE", "USER"].includes(file.type)) delete file.description;
|
||||||
if (file.UserPerms) file.defaultPermission = false;
|
if (file.UserPerms) file.defaultPermission = false;
|
||||||
ownercmds.push(file);
|
ownercmds.push(file);
|
||||||
});
|
});
|
||||||
client.on("ready", async () => {
|
client.on("ready", async () => {
|
||||||
await client.guilds.cache.get("840225563193114624").commands.set(ownercmds);
|
await client.guilds.cache.get("840225563193114624").commands.set(ownercmds);
|
||||||
await client.application.commands.set(cmds);
|
await client.application.commands.set(cmds);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,324 +1,324 @@
|
||||||
const mongoose = require("mongoose");
|
const mongoose = require("mongoose");
|
||||||
const { GooseCache } = require("goosecache");
|
const { GooseCache } = require("goosecache");
|
||||||
const cachegoose = new GooseCache(mongoose, {
|
const cachegoose = new GooseCache(mongoose, {
|
||||||
engine: "memory",
|
engine: "memory",
|
||||||
});
|
});
|
||||||
mongoose.set("useFindAndModify", false);
|
mongoose.set("useFindAndModify", false);
|
||||||
const u = require("../../models/users");
|
const u = require("../../models/users");
|
||||||
const g = require("../../models/guilds");
|
const g = require("../../models/guilds");
|
||||||
module.exports = {
|
module.exports = {
|
||||||
/**
|
/**
|
||||||
* @param {String} URI - Mongo Connection URI
|
* @param {String} URI - Mongo Connection URI
|
||||||
*/
|
*/
|
||||||
async connect(URI) {
|
async connect(URI) {
|
||||||
if (!URI) throw new Error("Please provide a Mongoose URI");
|
if (!URI) throw new Error("Please provide a Mongoose URI");
|
||||||
return mongoose.connect(URI, {
|
return mongoose.connect(URI, {
|
||||||
useNewUrlParser: true,
|
useNewUrlParser: true,
|
||||||
useUnifiedTopology: true,
|
useUnifiedTopology: true,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @param {String} ID - Guild ID
|
* @param {String} ID - Guild ID
|
||||||
*/
|
*/
|
||||||
async getGuild(ID) {
|
async getGuild(ID) {
|
||||||
if (!ID) throw new Error("Guild ID?");
|
if (!ID) throw new Error("Guild ID?");
|
||||||
const guild = await g.findOne({ Guild: ID }).lean().cache(120);
|
const guild = await g.findOne({ Guild: ID }).lean().cache(120);
|
||||||
if (!guild) {
|
if (!guild) {
|
||||||
const gg = new g({ Guild: ID });
|
const gg = new g({ Guild: ID });
|
||||||
const { Guild, Prefix, Premium, Category, Commands, Tips } = gg;
|
const { Guild, Prefix, Premium, Category, Commands, Tips } = gg;
|
||||||
await gg.save().catch(error => console.log(error));
|
await gg.save().catch(error => console.log(error));
|
||||||
return {
|
return {
|
||||||
Guild,
|
Guild,
|
||||||
Prefix,
|
Prefix,
|
||||||
Premium,
|
Premium,
|
||||||
Category,
|
Category,
|
||||||
Commands,
|
Commands,
|
||||||
Tips,
|
Tips,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
const Guild = guild.Guild;
|
const Guild = guild.Guild;
|
||||||
const Prefix = guild.Prefix;
|
const Prefix = guild.Prefix;
|
||||||
const Premium = guild.Premium;
|
const Premium = guild.Premium;
|
||||||
const Category = guild.Category;
|
const Category = guild.Category;
|
||||||
const Commands = guild.Commands;
|
const Commands = guild.Commands;
|
||||||
const Tips = guild.Tips;
|
const Tips = guild.Tips;
|
||||||
return {
|
return {
|
||||||
Guild,
|
Guild,
|
||||||
Prefix,
|
Prefix,
|
||||||
Premium,
|
Premium,
|
||||||
Category,
|
Category,
|
||||||
Commands,
|
Commands,
|
||||||
Tips,
|
Tips,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @param {String} ID - User ID
|
* @param {String} ID - User ID
|
||||||
*/
|
*/
|
||||||
async getUser(ID) {
|
async getUser(ID) {
|
||||||
if (!ID) throw new Error("User ID?");
|
if (!ID) throw new Error("User ID?");
|
||||||
const user = await u.findOne({ User: ID }).lean().cache(120);
|
const user = await u.findOne({ User: ID }).lean().cache(120);
|
||||||
if (!user) {
|
if (!user) {
|
||||||
const ss = new u({ User: ID });
|
const ss = new u({ User: ID });
|
||||||
const {
|
const {
|
||||||
User,
|
User,
|
||||||
Tier,
|
Tier,
|
||||||
Premium,
|
Premium,
|
||||||
Blacklist,
|
Blacklist,
|
||||||
Blacklist_Reason,
|
Blacklist_Reason,
|
||||||
PremiumServers,
|
PremiumServers,
|
||||||
} = ss;
|
} = ss;
|
||||||
await ss.save().catch(error => console.log(error));
|
await ss.save().catch(error => console.log(error));
|
||||||
return {
|
return {
|
||||||
User,
|
User,
|
||||||
Tier,
|
Tier,
|
||||||
Premium,
|
Premium,
|
||||||
Blacklist,
|
Blacklist,
|
||||||
Blacklist_Reason,
|
Blacklist_Reason,
|
||||||
PremiumServers,
|
PremiumServers,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
const User = user.User;
|
const User = user.User;
|
||||||
const Tier = user.Tier;
|
const Tier = user.Tier;
|
||||||
const Premium = user.Premium;
|
const Premium = user.Premium;
|
||||||
const Blacklist = user.Blacklist;
|
const Blacklist = user.Blacklist;
|
||||||
const Blacklist_Reason = user.Blacklist_Reason;
|
const Blacklist_Reason = user.Blacklist_Reason;
|
||||||
const PremiumServers = user.PremiumServers;
|
const PremiumServers = user.PremiumServers;
|
||||||
return {
|
return {
|
||||||
User,
|
User,
|
||||||
Tier,
|
Tier,
|
||||||
Premium,
|
Premium,
|
||||||
Blacklist,
|
Blacklist,
|
||||||
Blacklist_Reason,
|
Blacklist_Reason,
|
||||||
PremiumServers,
|
PremiumServers,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @param {String} ID - ID of the User
|
* @param {String} ID - ID of the User
|
||||||
* @param {String} Toggle - Blacklist Toggle(true/false)
|
* @param {String} Toggle - Blacklist Toggle(true/false)
|
||||||
* @param {String} Reason - Blacklist Reason
|
* @param {String} Reason - Blacklist Reason
|
||||||
*/
|
*/
|
||||||
async BK(ID, Toggle, Reason) {
|
async BK(ID, Toggle, Reason) {
|
||||||
if (!ID) throw new Error("User ID?");
|
if (!ID) throw new Error("User ID?");
|
||||||
// if (!Toggle) throw new Error("Blacklist Toggle?");
|
// if (!Toggle) throw new Error("Blacklist Toggle?");
|
||||||
if (!Reason) throw new Error("Blacklist Feason?");
|
if (!Reason) throw new Error("Blacklist Feason?");
|
||||||
const user = await u.findOne({ User: ID });
|
const user = await u.findOne({ User: ID });
|
||||||
if (!user) {
|
if (!user) {
|
||||||
const sus = new u({ User: ID });
|
const sus = new u({ User: ID });
|
||||||
if (Toggle == true) {
|
if (Toggle == true) {
|
||||||
user.Blacklist = true;
|
user.Blacklist = true;
|
||||||
user.Blacklist_Reason = Reason;
|
user.Blacklist_Reason = Reason;
|
||||||
} else {
|
} else {
|
||||||
user.Blacklist = false;
|
user.Blacklist = false;
|
||||||
user.Blacklist_Reason = null;
|
user.Blacklist_Reason = null;
|
||||||
}
|
}
|
||||||
await sus.save().catch(error => console.log(error));
|
await sus.save().catch(error => console.log(error));
|
||||||
cachegoose.clearCache();
|
cachegoose.clearCache();
|
||||||
return { Reason };
|
return { Reason };
|
||||||
} else {
|
} else {
|
||||||
if (Toggle == true) {
|
if (Toggle == true) {
|
||||||
user.Blacklist = true;
|
user.Blacklist = true;
|
||||||
user.Blacklist_Reason = Reason;
|
user.Blacklist_Reason = Reason;
|
||||||
} else {
|
} else {
|
||||||
user.Blacklist = false;
|
user.Blacklist = false;
|
||||||
user.Blacklist_Reason = null;
|
user.Blacklist_Reason = null;
|
||||||
}
|
}
|
||||||
await user.save().catch(error => console.log(error));
|
await user.save().catch(error => console.log(error));
|
||||||
cachegoose.clearCache();
|
cachegoose.clearCache();
|
||||||
return { Reason };
|
return { Reason };
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @param {String} ID - ID of the User
|
* @param {String} ID - ID of the User
|
||||||
* @param {Boolean} Toggle - Premium Toggle(true/false)
|
* @param {Boolean} Toggle - Premium Toggle(true/false)
|
||||||
* @param {Number} Tier - Tier
|
* @param {Number} Tier - Tier
|
||||||
*/
|
*/
|
||||||
async Premium(ID, Toggle, Tier) {
|
async Premium(ID, Toggle, Tier) {
|
||||||
if (!ID) throw new Error("User ID?");
|
if (!ID) throw new Error("User ID?");
|
||||||
if (!Toggle) throw new Error("Premium Toggle?");
|
if (!Toggle) throw new Error("Premium Toggle?");
|
||||||
if (!Tier) throw new Error("Premium Feason?");
|
if (!Tier) throw new Error("Premium Feason?");
|
||||||
const user = await u.findOne({ User: ID });
|
const user = await u.findOne({ User: ID });
|
||||||
if (!user) {
|
if (!user) {
|
||||||
const sus = new u({ User: ID });
|
const sus = new u({ User: ID });
|
||||||
if (Toggle == "true") {
|
if (Toggle == "true") {
|
||||||
user.Premium = true;
|
user.Premium = true;
|
||||||
user.Tier = Tier;
|
user.Tier = Tier;
|
||||||
} else {
|
} else {
|
||||||
user.Premium = false;
|
user.Premium = false;
|
||||||
user.Tier = 0;
|
user.Tier = 0;
|
||||||
}
|
}
|
||||||
await sus.save().catch(error => console.log(error));
|
await sus.save().catch(error => console.log(error));
|
||||||
cachegoose.clearCache();
|
cachegoose.clearCache();
|
||||||
return { Tier };
|
return { Tier };
|
||||||
} else {
|
} else {
|
||||||
if (Toggle == "true") {
|
if (Toggle == "true") {
|
||||||
user.Premium = true;
|
user.Premium = true;
|
||||||
user.Tier = Tier;
|
user.Tier = Tier;
|
||||||
} else {
|
} else {
|
||||||
user.Premium = false;
|
user.Premium = false;
|
||||||
user.Tier = 0;
|
user.Tier = 0;
|
||||||
}
|
}
|
||||||
await user.save().catch(error => console.log(error));
|
await user.save().catch(error => console.log(error));
|
||||||
cachegoose.clearCache();
|
cachegoose.clearCache();
|
||||||
return { Tier };
|
return { Tier };
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @param {String} ID
|
* @param {String} ID
|
||||||
*/
|
*/
|
||||||
async CreateGuild(ID) {
|
async CreateGuild(ID) {
|
||||||
await new g({ Guild: ID });
|
await new g({ Guild: ID });
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @param {String} ID
|
* @param {String} ID
|
||||||
*/
|
*/
|
||||||
async CreateBot(ID) {
|
async CreateBot(ID) {
|
||||||
await new m({ Guild: ID });
|
await new m({ Guild: ID });
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @param {String} ID - Guild ID
|
* @param {String} ID - Guild ID
|
||||||
*/
|
*/
|
||||||
async DelGuild(ID) {
|
async DelGuild(ID) {
|
||||||
await g.deleteMany({ Guild: ID });
|
await g.deleteMany({ Guild: ID });
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @param {String} ID - Guild ID
|
* @param {String} ID - Guild ID
|
||||||
* @param {String} Toggle - premium Toggle
|
* @param {String} Toggle - premium Toggle
|
||||||
*/
|
*/
|
||||||
async setPremium(ID, Toggle) {
|
async setPremium(ID, Toggle) {
|
||||||
if (!ID) throw new Error("Please Provide a Guild ID");
|
if (!ID) throw new Error("Please Provide a Guild ID");
|
||||||
if (!Toggle) throw new Error("Please Provide a Toggle!");
|
if (!Toggle) throw new Error("Please Provide a Toggle!");
|
||||||
const guild = await g.findOne({ Guild: ID });
|
const guild = await g.findOne({ Guild: ID });
|
||||||
if (!guild) {
|
if (!guild) {
|
||||||
const newU = new g({ Guild: ID });
|
const newU = new g({ Guild: ID });
|
||||||
if (Toggle == "true") {
|
if (Toggle == "true") {
|
||||||
guild.Premium = true;
|
guild.Premium = true;
|
||||||
} else {
|
} else {
|
||||||
guild.Premium = false;
|
guild.Premium = false;
|
||||||
}
|
}
|
||||||
await newU.save().catch(error => console.log(error));
|
await newU.save().catch(error => console.log(error));
|
||||||
return;
|
return;
|
||||||
} else if (Toggle == "true") {
|
} else if (Toggle == "true") {
|
||||||
guild.Premium = true;
|
guild.Premium = true;
|
||||||
} else {
|
} else {
|
||||||
guild.Premium = false;
|
guild.Premium = false;
|
||||||
}
|
}
|
||||||
await guild.save().catch(error => console.log(error));
|
await guild.save().catch(error => console.log(error));
|
||||||
cachegoose.clearCache();
|
cachegoose.clearCache();
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @param {String} User - User ID
|
* @param {String} User - User ID
|
||||||
* @param {String} ID - Guild ID
|
* @param {String} ID - Guild ID
|
||||||
* @param {String} Method - Method
|
* @param {String} Method - Method
|
||||||
*/
|
*/
|
||||||
async pushGuild(User, ID, method) {
|
async pushGuild(User, ID, method) {
|
||||||
if (!method) return new Error("Method?");
|
if (!method) return new Error("Method?");
|
||||||
u.findOne({ User: User }, async (err, data) => {
|
u.findOne({ User: User }, async (err, data) => {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
if (!data) return new Error("User not found");
|
if (!data) return new Error("User not found");
|
||||||
if (method === "push") {
|
if (method === "push") {
|
||||||
await data.PremiumServers.push(ID);
|
await data.PremiumServers.push(ID);
|
||||||
await data.save().catch(error => console.log(error));
|
await data.save().catch(error => console.log(error));
|
||||||
data.save();
|
data.save();
|
||||||
}
|
}
|
||||||
if (method === "splice") {
|
if (method === "splice") {
|
||||||
const index = data.PremiumServers.indexOf(ID);
|
const index = data.PremiumServers.indexOf(ID);
|
||||||
data.PremiumServers.splice(index, 1);
|
data.PremiumServers.splice(index, 1);
|
||||||
data.save();
|
data.save();
|
||||||
}
|
}
|
||||||
cachegoose.clearCache();
|
cachegoose.clearCache();
|
||||||
return { User };
|
return { User };
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @param {String} ID - Guild ID
|
* @param {String} ID - Guild ID
|
||||||
* @param {String} Type - Type
|
* @param {String} Type - Type
|
||||||
* @param {String} Name - Name
|
* @param {String} Name - Name
|
||||||
*/
|
*/
|
||||||
async disable(ID, Type, Name) {
|
async disable(ID, Type, Name) {
|
||||||
if (!Name) throw new Error("Name?");
|
if (!Name) throw new Error("Name?");
|
||||||
if (!Type) throw new Error("Type?");
|
if (!Type) throw new Error("Type?");
|
||||||
if (!ID) throw new Error("Guild ID?");
|
if (!ID) throw new Error("Guild ID?");
|
||||||
if (Type === "category") {
|
if (Type === "category") {
|
||||||
const db = await g.findOne({ Guild: ID });
|
const db = await g.findOne({ Guild: ID });
|
||||||
if (!db) {
|
if (!db) {
|
||||||
const newdoc = await new g({ Guild: ID });
|
const newdoc = await new g({ Guild: ID });
|
||||||
await newdoc.save().catch(error => console.log(error));
|
await newdoc.save().catch(error => console.log(error));
|
||||||
}
|
}
|
||||||
await db.Category.push(Name);
|
await db.Category.push(Name);
|
||||||
await db.save().catch(e => console.log(e));
|
await db.save().catch(e => console.log(e));
|
||||||
}
|
}
|
||||||
if (Type === "command") {
|
if (Type === "command") {
|
||||||
const db = await g.findOne({ Guild: ID });
|
const db = await g.findOne({ Guild: ID });
|
||||||
if (!db) {
|
if (!db) {
|
||||||
const newdoc = await new g({ Guild: ID });
|
const newdoc = await new g({ Guild: ID });
|
||||||
await newdoc.save().catch(error => console.log(error));
|
await newdoc.save().catch(error => console.log(error));
|
||||||
}
|
}
|
||||||
await db.Commands.push(Name);
|
await db.Commands.push(Name);
|
||||||
await db.save().catch(e => console.log(e));
|
await db.save().catch(e => console.log(e));
|
||||||
}
|
}
|
||||||
cachegoose.clearCache();
|
cachegoose.clearCache();
|
||||||
return { Name };
|
return { Name };
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @param {String} ID - Guild ID
|
* @param {String} ID - Guild ID
|
||||||
* @param {String} Type - Type
|
* @param {String} Type - Type
|
||||||
* @param {String} Name - Name
|
* @param {String} Name - Name
|
||||||
*/
|
*/
|
||||||
async enable(ID, Type, Name) {
|
async enable(ID, Type, Name) {
|
||||||
if (!ID) throw new Error("Guild ID?");
|
if (!ID) throw new Error("Guild ID?");
|
||||||
if (!Name) throw new Error("Name?");
|
if (!Name) throw new Error("Name?");
|
||||||
if (!Type) throw new Error("Type?");
|
if (!Type) throw new Error("Type?");
|
||||||
if (Type === "category") {
|
if (Type === "category") {
|
||||||
const db = await g.findOne({ Guild: ID });
|
const db = await g.findOne({ Guild: ID });
|
||||||
if (!db) {
|
if (!db) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const index = db.Category.indexOf(Name.toLowerCase());
|
const index = db.Category.indexOf(Name.toLowerCase());
|
||||||
await db.Category.splice(index, 1);
|
await db.Category.splice(index, 1);
|
||||||
await db.save().catch(e => console.log(e));
|
await db.save().catch(e => console.log(e));
|
||||||
}
|
}
|
||||||
if (Type === "command") {
|
if (Type === "command") {
|
||||||
const db = await g.findOne({ Guild: ID });
|
const db = await g.findOne({ Guild: ID });
|
||||||
if (!db) {
|
if (!db) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const index = db.Commands.indexOf(Name);
|
const index = db.Commands.indexOf(Name);
|
||||||
await db.Commands.splice(index, 1);
|
await db.Commands.splice(index, 1);
|
||||||
await db.save().catch(e => console.log(e));
|
await db.save().catch(e => console.log(e));
|
||||||
}
|
}
|
||||||
cachegoose.clearCache();
|
cachegoose.clearCache();
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @param {String} ID - Guild ID
|
* @param {String} ID - Guild ID
|
||||||
* @param {String} Toggle - Level Toggle
|
* @param {String} Toggle - Level Toggle
|
||||||
*/
|
*/
|
||||||
async setTips(ID, Toggle) {
|
async setTips(ID, Toggle) {
|
||||||
if (!ID) throw new Error("Please Provide a Guild ID");
|
if (!ID) throw new Error("Please Provide a Guild ID");
|
||||||
if (!Toggle) throw new Error("Please Provide a Toggle!");
|
if (!Toggle) throw new Error("Please Provide a Toggle!");
|
||||||
const guild = await g.findOne({ Guild: ID });
|
const guild = await g.findOne({ Guild: ID });
|
||||||
if (!guild) {
|
if (!guild) {
|
||||||
const newU = new g({ Guild: ID });
|
const newU = new g({ Guild: ID });
|
||||||
if (Toggle == "true") {
|
if (Toggle == "true") {
|
||||||
guild.Tips = true;
|
guild.Tips = true;
|
||||||
} else {
|
} else {
|
||||||
guild.Tips = false;
|
guild.Tips = false;
|
||||||
}
|
}
|
||||||
await newU.save().catch(error => console.log(error));
|
await newU.save().catch(error => console.log(error));
|
||||||
return;
|
return;
|
||||||
} else if (Toggle == "true") {
|
} else if (Toggle == "true") {
|
||||||
guild.Tips = true;
|
guild.Tips = true;
|
||||||
} else {
|
} else {
|
||||||
guild.Tips = false;
|
guild.Tips = false;
|
||||||
}
|
}
|
||||||
await guild.save().catch(error => console.log(error));
|
await guild.save().catch(error => console.log(error));
|
||||||
cachegoose.clearCache();
|
cachegoose.clearCache();
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue