unix from dos

This commit is contained in:
night0721 2023-10-31 01:39:28 +00:00
parent 0e6804fd56
commit e6ea923687
66 changed files with 27115 additions and 27190 deletions

View file

@ -1,5 +1,5 @@
TOKEN =
MONGO = mongodb://127.0.0.1:27017/test
mongo =
cathmongo =
TOKEN =
MONGO = mongodb://127.0.0.1:27017/test
mongo =
cathmongo =
api = http://api.cath.gq

View file

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

248
.github/README.md vendored
View file

@ -1,124 +1,124 @@
<h1 align="center"> NYX [Cath.exe] </h1>
<!-- header -->
<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>
<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://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank"><img alt='Licence CC BY-NC-SA 4.0' src ="https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc-sa.svg" width="82">
<a href="https://trello.com/b/dIgR0QNm" target="_blank"><img alt='Trello' src="https://img.shields.io/badge/Trello-5865F2?style=for-the-badge&logo=trello&logoColor=white"></a>
<a href="https://github.com/night0721/cath"><img alt = 'NPM Package' src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white">
<a href="https://thunder75.gitbook.io/cath-bot" target="_blank"><img src="https://img.shields.io/static/v1?label=Docs&message=available&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://ko-fi.com/I2I35XISJ" target="_blank"><img alt='Kofi' src="https://img.shields.io/static/v1?label=Support%20Us&message=KO.FI&color=ff5e5b&logo=kofi&logoColor=white&style=for-the-badge&scale=1.4"></a> <br>
<a href="https://nyx-bot.statuspage.io/"target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=NYX&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://nyx-bot.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=NYX%202&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://nyx-bot.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=API&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
</p>
<p align = "center">
<a href="https://rebrand.ly/cathSupport"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner2" alt="Support Server" /></a>
</p>
<!-- 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>
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.
<br><br>
If you like this bot, feel free to :star: **Star** this repository.<br>
> ⚠ The Verifed bot instance is current called Cath.exe, we are working on getting it changed
> <br>
# Features
> _This is a Non-Exhaustive list for commands. To access the full list of commands, check out our [Documentation](https://thunder75.gitbook.io/cath-bot/core/commands)._
<a href="https://thunder75.gitbook.io/cath-bot/core/commands" ><img src="https://img.shields.io/static/v1?label=List %20OF&message=Commands&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
🚨 **Moderation** - Classic commands like kick, ban, warn, role and many more. <br>
📈 **Economy** - A Robust economy system, inspired by **pepe bot** <br>
**Fun Commands** - A massive collection of fun commands `(35+ commands)` <br>
🎵 **Music** - Classic Music Commands that can play from various sources. <br>
🛠 **Utility** - A wide range of useful commands `(Around 20)` <br>
🕹 **Games** - Many fun games to spend your time <br>
🎮 **Call of Duty** - Check the list of Call of Duty Mobile Commands
## <img height="18px" src="../util/assets/images/cod_logo.svg"> **Call of Duty Mobile**
- **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.
- **Perks** detailed info about the perks.
- **Scorestreak** detailed info about scorestreak with preview videos.
- **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.
## <img height="16px" src="../util/assets/images/apex/apex-legends-logo-white.svg"> **Apex Legends Mobile**
> ⚠ _Coming Soon™_
- **Player Stats** view your in-game stats. <!-- if they support mobile for the stats api -->
- **Legends** detailed info about legends & their abilities.
- **Guns** detailed info about guns.
- **Random Combos** Wanna try something challenging? try to win a game with a random selected legend & Gun combination
- _& many more, coming soon!_
## More Info
[![Top language](https://img.shields.io/github/languages/top/night0721/cath.exe?labelColor=F7DF1E&color=555555&style=for-the-badge&scale=1.4)](https://github.com/night0721/cath.exe)
[![CodeFactor](https://www.codefactor.io/repository/github/night0721/cath.js/badge?s=57e6f566f73892f4303edbfeb2fe3ea0b849c876&style=for-the-badge)](https://www.codefactor.io/repository/github/night0721/cath.js)
<a href="https://thunder75.gitbook.io/cath-bot/deployment" target="_blank"><img src="https://img.shields.io/static/v1?label=Deployment&message=Guide&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
A detailed Deployment guide can be found [here](https://thunder75.gitbook.io/cath-bot/deployment).
<!-- <details>
<summary>Made With</summary>
[![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
[![node](https://img.shields.io/badge/Node.js-43853D?style=for-the-badge&logo=node.js&logoColor=white)](https://nodejs.org/en/)
[![npm](https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/)
[![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white)](https://mongodb.com/)
<img src ="https://forthebadge.com/images/badges/built-with-love.svg" width = "122"><br>
</details>
<details>
<summary>Github Stats</summary>
![Lines of code](https://img.shields.io/tokei/lines/github/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge)
![GitHub Discussions](https://img.shields.io/github/discussions/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge)
[![Last commit](https://img.shields.io/github/last-commit/night0721/cath.exe?icon=discord&color=5865F2&style=for-the-badge&scale=1.4)](https://github.com/night0721/cath.exe)
<!-- [![Files](https://tokei.rs/b1/github/night0721/cath.exe?category=files&style=for-the-badge)](https://github.com/night0721/cath.exe)
</details> -->
<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
Join the official [Support Server](https://rebrand.ly/cathSupport) on Discord & we will be happy to assist you. <br>
To Request new features contact us on Discord using the support server.
## <img src = "https://cdn.discordapp.com/emojis/867093601962950666.png?v=1" width = "18"> Report Bugs
You can report bugs or issues by opening a issue in this repository. Alternatevely you can also contact us on Discord using the support server.
<p align = "center">
<a href="https://rebrand.ly/cathSupport" target="_blank"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner1"></a>
</p>
<h1 align="center"> Contributors </h1>
Contributions are always welcomed, but make sure to read [Contributing.md](/CONTRIBUTING.md) first.
![Contributors](https://badges.pufler.dev/contributors/night0721/cath.exe?bots=false)
<!-- ## Special Thanks to The Roound Table from Cygnoux Familia.
<p align = "center">
<a href="https://discord.gg/mjVwkCsWY7" target="_blank"><img src="https://discordapp.com/api/guilds/756525751594909797/widget.png?style=banner1"></a>
</p> -->
<!-- <img src="https://socialify.git.ci/night0721/cath.exe/image?description=1&descriptionEditable=A%20Discord.js%20v13%20Template%20based%20on%20cath.exe&font=Raleway&forks=1&issues=1&language=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Dark"> -->
<h1 align="center"> NYX [Cath.exe] </h1>
<!-- header -->
<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>
<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://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank"><img alt='Licence CC BY-NC-SA 4.0' src ="https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc-sa.svg" width="82">
<a href="https://trello.com/b/dIgR0QNm" target="_blank"><img alt='Trello' src="https://img.shields.io/badge/Trello-5865F2?style=for-the-badge&logo=trello&logoColor=white"></a>
<a href="https://github.com/night0721/cath"><img alt = 'NPM Package' src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white">
<a href="https://thunder75.gitbook.io/cath-bot" target="_blank"><img src="https://img.shields.io/static/v1?label=Docs&message=available&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://ko-fi.com/I2I35XISJ" target="_blank"><img alt='Kofi' src="https://img.shields.io/static/v1?label=Support%20Us&message=KO.FI&color=ff5e5b&logo=kofi&logoColor=white&style=for-the-badge&scale=1.4"></a> <br>
<a href="https://nyx-bot.statuspage.io/"target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=NYX&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://nyx-bot.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=NYX%202&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://nyx-bot.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=API&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
</p>
<p align = "center">
<a href="https://rebrand.ly/cathSupport"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner2" alt="Support Server" /></a>
</p>
<!-- 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>
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.
<br><br>
If you like this bot, feel free to :star: **Star** this repository.<br>
> ⚠ The Verifed bot instance is current called Cath.exe, we are working on getting it changed
> <br>
# Features
> _This is a Non-Exhaustive list for commands. To access the full list of commands, check out our [Documentation](https://thunder75.gitbook.io/cath-bot/core/commands)._
<a href="https://thunder75.gitbook.io/cath-bot/core/commands" ><img src="https://img.shields.io/static/v1?label=List %20OF&message=Commands&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
🚨 **Moderation** - Classic commands like kick, ban, warn, role and many more. <br>
📈 **Economy** - A Robust economy system, inspired by **pepe bot** <br>
**Fun Commands** - A massive collection of fun commands `(35+ commands)` <br>
🎵 **Music** - Classic Music Commands that can play from various sources. <br>
🛠 **Utility** - A wide range of useful commands `(Around 20)` <br>
🕹 **Games** - Many fun games to spend your time <br>
🎮 **Call of Duty** - Check the list of Call of Duty Mobile Commands
## <img height="18px" src="../util/assets/images/cod_logo.svg"> **Call of Duty Mobile**
- **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.
- **Perks** detailed info about the perks.
- **Scorestreak** detailed info about scorestreak with preview videos.
- **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.
## <img height="16px" src="../util/assets/images/apex/apex-legends-logo-white.svg"> **Apex Legends Mobile**
> ⚠ _Coming Soon™_
- **Player Stats** view your in-game stats. <!-- if they support mobile for the stats api -->
- **Legends** detailed info about legends & their abilities.
- **Guns** detailed info about guns.
- **Random Combos** Wanna try something challenging? try to win a game with a random selected legend & Gun combination
- _& many more, coming soon!_
## More Info
[![Top language](https://img.shields.io/github/languages/top/night0721/cath.exe?labelColor=F7DF1E&color=555555&style=for-the-badge&scale=1.4)](https://github.com/night0721/cath.exe)
[![CodeFactor](https://www.codefactor.io/repository/github/night0721/cath.js/badge?s=57e6f566f73892f4303edbfeb2fe3ea0b849c876&style=for-the-badge)](https://www.codefactor.io/repository/github/night0721/cath.js)
<a href="https://thunder75.gitbook.io/cath-bot/deployment" target="_blank"><img src="https://img.shields.io/static/v1?label=Deployment&message=Guide&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
A detailed Deployment guide can be found [here](https://thunder75.gitbook.io/cath-bot/deployment).
<!-- <details>
<summary>Made With</summary>
[![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
[![node](https://img.shields.io/badge/Node.js-43853D?style=for-the-badge&logo=node.js&logoColor=white)](https://nodejs.org/en/)
[![npm](https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/)
[![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white)](https://mongodb.com/)
<img src ="https://forthebadge.com/images/badges/built-with-love.svg" width = "122"><br>
</details>
<details>
<summary>Github Stats</summary>
![Lines of code](https://img.shields.io/tokei/lines/github/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge)
![GitHub Discussions](https://img.shields.io/github/discussions/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge)
[![Last commit](https://img.shields.io/github/last-commit/night0721/cath.exe?icon=discord&color=5865F2&style=for-the-badge&scale=1.4)](https://github.com/night0721/cath.exe)
<!-- [![Files](https://tokei.rs/b1/github/night0721/cath.exe?category=files&style=for-the-badge)](https://github.com/night0721/cath.exe)
</details> -->
<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
Join the official [Support Server](https://rebrand.ly/cathSupport) on Discord & we will be happy to assist you. <br>
To Request new features contact us on Discord using the support server.
## <img src = "https://cdn.discordapp.com/emojis/867093601962950666.png?v=1" width = "18"> Report Bugs
You can report bugs or issues by opening a issue in this repository. Alternatevely you can also contact us on Discord using the support server.
<p align = "center">
<a href="https://rebrand.ly/cathSupport" target="_blank"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner1"></a>
</p>
<h1 align="center"> Contributors </h1>
Contributions are always welcomed, but make sure to read [Contributing.md](/CONTRIBUTING.md) first.
![Contributors](https://badges.pufler.dev/contributors/night0721/cath.exe?bots=false)
<!-- ## Special Thanks to The Roound Table from Cygnoux Familia.
<p align = "center">
<a href="https://discord.gg/mjVwkCsWY7" target="_blank"><img src="https://discordapp.com/api/guilds/756525751594909797/widget.png?style=banner1"></a>
</p> -->
<!-- <img src="https://socialify.git.ci/night0721/cath.exe/image?description=1&descriptionEditable=A%20Discord.js%20v13%20Template%20based%20on%20cath.exe&font=Raleway&forks=1&issues=1&language=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Dark"> -->

10
.github/TOS.md vendored
View file

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

75
.github/changelog.md vendored
View file

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

View file

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

872
LICENSE
View file

@ -1,437 +1,437 @@
Attribution-NonCommercial-ShareAlike 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More_considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-NonCommercial-ShareAlike 4.0 International Public License
("Public License"). To the extent this Public License may be
interpreted as a contract, You are granted the Licensed Rights in
consideration of Your acceptance of these terms and conditions, and the
Licensor grants You such rights in consideration of benefits the
Licensor receives from making the Licensed Material available under
these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. BY-NC-SA Compatible License means a license listed at
creativecommons.org/compatiblelicenses, approved by Creative
Commons as essentially the equivalent of this Public License.
d. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
e. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
f. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
g. License Elements means the license attributes listed in the name
of a Creative Commons Public License. The License Elements of this
Public License are Attribution, NonCommercial, and ShareAlike.
h. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
i. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
j. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
k. NonCommercial means not primarily intended for or directed towards
commercial advantage or monetary compensation. For purposes of
this Public License, the exchange of the Licensed Material for
other material subject to Copyright and Similar Rights by digital
file-sharing or similar means is NonCommercial provided there is
no payment of monetary compensation in connection with the
exchange.
l. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
m. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
n. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part, for NonCommercial purposes only; and
b. produce, reproduce, and Share Adapted Material for
NonCommercial purposes only.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. Additional offer from the Licensor -- Adapted Material.
Every recipient of Adapted Material from You
automatically receives an offer from the Licensor to
exercise the Licensed Rights in the Adapted Material
under the conditions of the Adapter's License You apply.
c. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties, including when
the Licensed Material is used other than for NonCommercial
purposes.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
b. ShareAlike.
In addition to the conditions in Section 3(a), if You Share
Adapted Material You produce, the following conditions also apply.
1. The Adapter's License You apply must be a Creative Commons
license with the same License Elements, this version or
later, or a BY-NC-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the
Adapter's License You apply. You may satisfy this condition
in any reasonable manner based on the medium, means, and
context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms
or conditions on, or apply any Effective Technological
Measures to, Adapted Material that restrict exercise of the
rights granted under the Adapter's License You apply.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database for NonCommercial purposes
only;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material,
including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Attribution-NonCommercial-ShareAlike 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More_considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-NonCommercial-ShareAlike 4.0 International Public License
("Public License"). To the extent this Public License may be
interpreted as a contract, You are granted the Licensed Rights in
consideration of Your acceptance of these terms and conditions, and the
Licensor grants You such rights in consideration of benefits the
Licensor receives from making the Licensed Material available under
these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. BY-NC-SA Compatible License means a license listed at
creativecommons.org/compatiblelicenses, approved by Creative
Commons as essentially the equivalent of this Public License.
d. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
e. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
f. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
g. License Elements means the license attributes listed in the name
of a Creative Commons Public License. The License Elements of this
Public License are Attribution, NonCommercial, and ShareAlike.
h. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
i. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
j. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
k. NonCommercial means not primarily intended for or directed towards
commercial advantage or monetary compensation. For purposes of
this Public License, the exchange of the Licensed Material for
other material subject to Copyright and Similar Rights by digital
file-sharing or similar means is NonCommercial provided there is
no payment of monetary compensation in connection with the
exchange.
l. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
m. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
n. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part, for NonCommercial purposes only; and
b. produce, reproduce, and Share Adapted Material for
NonCommercial purposes only.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. Additional offer from the Licensor -- Adapted Material.
Every recipient of Adapted Material from You
automatically receives an offer from the Licensor to
exercise the Licensed Rights in the Adapted Material
under the conditions of the Adapter's License You apply.
c. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties, including when
the Licensed Material is used other than for NonCommercial
purposes.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
b. ShareAlike.
In addition to the conditions in Section 3(a), if You Share
Adapted Material You produce, the following conditions also apply.
1. The Adapter's License You apply must be a Creative Commons
license with the same License Elements, this version or
later, or a BY-NC-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the
Adapter's License You apply. You may satisfy this condition
in any reasonable manner based on the medium, means, and
context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms
or conditions on, or apply any Effective Technological
Measures to, Adapted Material that restrict exercise of the
rights granted under the Adapter's License You apply.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database for NonCommercial purposes
only;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material,
including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.

View file

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

View file

@ -1,102 +1,102 @@
const {
Client,
Collection,
EmbedBuilder,
GatewayIntentBits,
Partials,
} = require("discord.js");
const config = require("../config");
require("dotenv").config();
class NYX extends Client {
/**
* @param {Client.options} options
*/
constructor(
options = {
presence: {
activities: [
{
name: `/help`,
type: 1,
url: "https://www.youtube.com/watch?v=YSKDu1gKntY",
},
],
},
shards: "auto",
partials: [
Partials.Message,
Partials.Channel,
Partials.Reaction,
Partials.GuildMember,
],
intents: [
GatewayIntentBits.Guilds,
// GatewayIntentBits.GuildMembers,
// GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.DirectMessageTyping,
GatewayIntentBits.DirectMessages,
],
}
) {
super(options);
this.slashCommands = new Collection();
this.hide = new Collection();
this.config = config;
this.data = require("../util/functions/mongoose");
this.color = config.color;
this.author = "Team NYX";
this.invite = "https://discord.gg/SbQHChmGcp";
this.docs = "https://thunder75.gitbook.io/nyx/";
this.web = config.URL;
this.owners = [
"452076196419600394", // Night
"534027706325532694", // Cat drinking a cat
"381442059111759883", // Thunder
"556808365574193194", // chunchunmaru
"687622268037365774", // Tac Shadow
"309681798957498368", // Sideload
"707177879984668673", // Random rock
"757530324686340197", // Madhav
"804712098625486848", // hcs
"1078015817184182414", // gaba
"774390900411465769" // Alphaus
];
this.currency = "<:nyx_currency:918584872333893703>";
this.xp = "<:nyx_xp:900309007472926720>";
this.dev = "<:discord_bot_dev:840231906200387666>"
this.path = [
"614423108388126731", // Camper on Duty
"767173194943168542", // Dark Bonker
"718762019586572341", // NYX Nation
"840225563193114624", // Command Test
];
}
start() {
require("../util/dist/handler")(this);
this.login(
process.argv[2] == "--dev" ? process.env.DEV : process.env.TOKEN
);
this.data
.connect(process.env.MONGO)
.then(() => console.log("Connected to MongoDB ✅"))
.catch(e => console.log(e));
}
err(interaction, error) {
const embed = new EmbedBuilder()
.setTitle("An Error Occured")
.setColor("Red")
.setDescription(`❌ | ${error}`)
.setTimestamp()
.setFooter({
text: `Made by ${this.author}`,
iconURL: this.user.displayAvatarURL({ dynamic: true }),
});
interaction.channel.send({ embeds: [embed] });
this.channels.cache.get(this.config.ErrorLog).send({ embeds: [embed] });
}
}
module.exports = NYX;
const {
Client,
Collection,
EmbedBuilder,
GatewayIntentBits,
Partials,
} = require("discord.js");
const config = require("../config");
require("dotenv").config();
class NYX extends Client {
/**
* @param {Client.options} options
*/
constructor(
options = {
presence: {
activities: [
{
name: `/help`,
type: 1,
url: "https://www.youtube.com/watch?v=YSKDu1gKntY",
},
],
},
shards: "auto",
partials: [
Partials.Message,
Partials.Channel,
Partials.Reaction,
Partials.GuildMember,
],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
// GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.DirectMessageTyping,
GatewayIntentBits.DirectMessages,
],
}
) {
super(options);
this.slashCommands = new Collection();
this.hide = new Collection();
this.config = config;
this.data = require("../util/functions/mongoose");
this.color = config.color;
this.author = "Team NYX";
this.invite = "https://discord.gg/SbQHChmGcp";
this.docs = "https://thunder75.gitbook.io/nyx/";
this.web = config.URL;
this.owners = [
"452076196419600394", // Night
"534027706325532694", // Cat drinking a cat
"381442059111759883", // Thunder
"556808365574193194", // chunchunmaru
"687622268037365774", // Tac Shadow
"309681798957498368", // Sideload
"707177879984668673", // Random rock
"757530324686340197", // Madhav
"804712098625486848", // hcs
"1078015817184182414", // gaba
"774390900411465769", // Alphaus
];
this.currency = "<:nyx_currency:918584872333893703>";
this.xp = "<:nyx_xp:900309007472926720>";
this.dev = "<:discord_bot_dev:840231906200387666>";
this.path = [
"614423108388126731", // Camper on Duty
"767173194943168542", // Dark Bonker
"718762019586572341", // NYX Nation
"840225563193114624", // Command Test
];
}
start() {
require("../util/dist/handler")(this);
this.login(
process.argv[2] == "--dev" ? process.env.DEV : process.env.TOKEN
);
this.data
.connect(process.env.MONGO)
.then(() => console.log("Connected to MongoDB ✅"))
.catch(e => console.log(e));
}
err(interaction, error) {
const embed = new EmbedBuilder()
.setTitle("An Error Occured")
.setColor("Red")
.setDescription(`❌ | ${error}`)
.setTimestamp()
.setFooter({
text: `Made by ${this.author}`,
iconURL: this.user.displayAvatarURL({ dynamic: true }),
});
interaction.channel.send({ embeds: [embed] });
this.channels.cache.get(this.config.ErrorLog).send({ embeds: [embed] });
}
}
module.exports = NYX;

File diff suppressed because it is too large Load diff

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,169 +1,169 @@
const { EmbedBuilder } = require("discord.js");
const c = require("../../client/CODMClient");
module.exports = {
name: "scorestreak",
description: "Get Scorestreak stats",
usage: "{Scorestreak}",
category: "CODM",
options: [
{
type: 1,
name: "lethal",
description: "Lethal Scorestreak",
options: [
{
type: 3,
name: "scorestreak",
description: "Select a lethal scorestreak",
required: true,
choices: [
{
name: "Shield Turret",
value: "shieldturret",
},
{
name: "Hunter Killer Drone",
value: "hunterkillerdrone",
},
{
name: "MQ-27 Dragonfire",
value: "mq27dragonfire",
},
{
name: "Predator Missile",
value: "predatormissile",
},
{
name: "Hawk X3",
value: "hawkx3",
},
{
name: "Sentry Gun",
value: "sentrygun",
},
{
name: "Lightning Strike",
value: "lightningstrike",
},
{
name: "Orbital Laser",
value: "orbitallaser",
},
{
name: "XS1 Goliath",
value: "xs1goliath",
},
{
name: "Cluster Strike",
value: "clusterstrike",
},
{
name: "Chopper Gunner",
value: "choppergunner",
},
{
name: "Stealth Chopper",
value: "stealthchopper",
},
{
name: "Swarm",
value: "swarm",
},
{
name: "Napalm",
value: "napalm",
},
{
name: "VTOL",
value: "vtol",
},
],
},
],
},
{
type: 1,
name: "support",
description: "Support Scorestreak",
options: [
{
type: 3,
name: "scorestreak",
description: "Select a Support Scorestreak",
required: true,
choices: [
{
name: "UAV",
value: "uav",
},
{
name: "Shock RC",
value: "shockrc",
},
{
name: "Care Package",
value: "carepackage",
},
{
name: "Counter UAV",
value: "cuav",
},
{
name: "SAM Turret",
value: "samturret",
},
{
name: "Advance UAV",
value: "auav",
},
{
name: "EMP Systems",
value: "empsystems",
},
],
},
],
},
],
run: async (client, interaction, args) => {
const val = args[1];
const d = await c.getscorestreak(val);
const embed = new EmbedBuilder()
.setTitle(d.name)
.setURL(d.preview_video)
.setDescription(
`<:nyx_description:897379659665264650> **Description** \`\`\`\n${d.description}\`\`\``
)
.addFields(
{
name: "Cost",
value: `${d.cost}`,
inline: true,
},
{
name: "AI-Assisted",
value: `
${
d.manual
? "<a:nyx_cross:897244999211696198> No"
: "<a:nyx_checkmark:897240322411724841> Yes"
}`,
inline: true,
}
)
.setThumbnail(d.preview)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setColor(
d.type == "lethal"
? "FF2222"
: d.type == "assist"
? "22FF4A"
: client.color
)
.setTimestamp();
interaction.followUp({ embeds: [embed] });
},
};
const { EmbedBuilder } = require("discord.js");
const c = require("../../client/CODMClient");
module.exports = {
name: "scorestreak",
description: "Get Scorestreak stats",
usage: "{Scorestreak}",
category: "CODM",
options: [
{
type: 1,
name: "lethal",
description: "Lethal Scorestreak",
options: [
{
type: 3,
name: "scorestreak",
description: "Select a lethal scorestreak",
required: true,
choices: [
{
name: "Shield Turret",
value: "shieldturret",
},
{
name: "Hunter Killer Drone",
value: "hunterkillerdrone",
},
{
name: "MQ-27 Dragonfire",
value: "mq27dragonfire",
},
{
name: "Predator Missile",
value: "predatormissile",
},
{
name: "Hawk X3",
value: "hawkx3",
},
{
name: "Sentry Gun",
value: "sentrygun",
},
{
name: "Lightning Strike",
value: "lightningstrike",
},
{
name: "Orbital Laser",
value: "orbitallaser",
},
{
name: "XS1 Goliath",
value: "xs1goliath",
},
{
name: "Cluster Strike",
value: "clusterstrike",
},
{
name: "Chopper Gunner",
value: "choppergunner",
},
{
name: "Stealth Chopper",
value: "stealthchopper",
},
{
name: "Swarm",
value: "swarm",
},
{
name: "Napalm",
value: "napalm",
},
{
name: "VTOL",
value: "vtol",
},
],
},
],
},
{
type: 1,
name: "support",
description: "Support Scorestreak",
options: [
{
type: 3,
name: "scorestreak",
description: "Select a Support Scorestreak",
required: true,
choices: [
{
name: "UAV",
value: "uav",
},
{
name: "Shock RC",
value: "shockrc",
},
{
name: "Care Package",
value: "carepackage",
},
{
name: "Counter UAV",
value: "cuav",
},
{
name: "SAM Turret",
value: "samturret",
},
{
name: "Advance UAV",
value: "auav",
},
{
name: "EMP Systems",
value: "empsystems",
},
],
},
],
},
],
run: async (client, interaction, args) => {
const val = args[1];
const d = await c.getscorestreak(val);
const embed = new EmbedBuilder()
.setTitle(d.name)
.setURL(d.preview_video)
.setDescription(
`<:nyx_description:897379659665264650> **Description** \`\`\`\n${d.description}\`\`\``
)
.addFields(
{
name: "Cost",
value: `${d.cost}`,
inline: true,
},
{
name: "AI-Assisted",
value: `
${
d.manual
? "<a:nyx_cross:897244999211696198> No"
: "<a:nyx_checkmark:897240322411724841> Yes"
}`,
inline: true,
}
)
.setThumbnail(d.preview)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setColor(
d.type == "lethal"
? "FF2222"
: d.type == "assist"
? "22FF4A"
: client.color
)
.setTimestamp();
interaction.followUp({ embeds: [embed] });
},
};

View file

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

View file

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

View file

@ -1,128 +1,128 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "premiumserver",
category: "Config",
description: "Add premium to a server",
Premium: true,
options: [
{
type: 5,
name: "choice",
description: "Whether add or remove premium server",
required: true,
},
],
run: async (client, interaction) => {
try {
const user = await client.data.getUser(interaction.user.id);
const guild = await client.data.getGuild(interaction.guild.id);
if (interaction.options.getBoolean("choice")) {
if (guild.Premium) {
return interaction.followUp({
content: "This server is already premium",
});
}
if (
(user.Tier == 1 && user.PremiumServers.length >= 5) ||
(user.Tier == 2 && user.PremiumServers.length >= 2) ||
(user.Tier == 3 && user.PremiumServers.length >= 0)
) {
interaction.followUp({
content:
"You have already reached the maximum amount of premium servers",
});
} else {
await client.data.setPremium(interaction.guild.id, "true");
await client.data.pushGuild(
interaction.user.id,
interaction.guild.id,
"push"
);
interaction.followUp({
embeds: [
new EmbedBuilder()
.setTitle("Success!")
.setDescription(
`Premium added to **${interaction.guild.name}**! \n`
)
.setFooter({ text: "Thank you for supporting Cath!" })
.setColor("Green")
.setTimestamp()
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
}),
],
});
client.channels.cache.get(client.config.ServerLog).send({
embeds: [
new EmbedBuilder()
.setTitle("New Premium Server")
.addFields({
name: "Server Info",
value: `**>Server Name**: \n${interaction.guild.name}
**>Server ID**: \n${interaction.guild.id}
**>Server Member Count**: \n${interaction.guild.memberCount}`,
})
.setTimestamp()
.setThumbnail(interaction.guild.iconURL({ dynamic: true }))
.setColor("Green"),
],
});
}
} else {
if (!guild.Premium) {
return interaction.followUp({
content: "This server isn't premium yet",
});
}
if (!user.PremiumServers.includes(interaction.guild.id)) {
return interaction.followUp({
content:
"You can't remove due to you aren't the person who made the server premium",
});
} else {
await client.data.setPremium(interaction.guild.id, "false");
await client.data.pushGuild(
interaction.user.id,
interaction.guild.id,
"splice"
);
interaction.followUp({
embeds: [
new EmbedBuilder()
.setTitle("Removed!")
.setDescription(
`Premium removed from **${interaction.guild.name}**! \n`
)
.setColor("Red")
.setTimestamp()
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
}),
],
});
client.channels.cache.get(client.config.ServerLog).send({
embeds: [
new EmbedBuilder()
.setTitle("Premium Server Removed")
.addFields({
name: "Server Info",
value: `**>Server Name**: \n${interaction.guild.name}
**>Server ID**: \n${interaction.guild.id}
**>Server Member Count**: \n${interaction.guild.memberCount}`,
})
.setTimestamp()
.setThumbnail(interaction.guild.iconURL({ dynamic: true }))
.setColor("Red"),
],
});
}
}
} catch (e) {
console.log(e);
interaction.followUp({ content: `**Error**: ${e.message}` });
}
},
};
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "premiumserver",
category: "Config",
description: "Add premium to a server",
Premium: true,
options: [
{
type: 5,
name: "choice",
description: "Whether add or remove premium server",
required: true,
},
],
run: async (client, interaction) => {
try {
const user = await client.data.getUser(interaction.user.id);
const guild = await client.data.getGuild(interaction.guild.id);
if (interaction.options.getBoolean("choice")) {
if (guild.Premium) {
return interaction.followUp({
content: "This server is already premium",
});
}
if (
(user.Tier == 1 && user.PremiumServers.length >= 5) ||
(user.Tier == 2 && user.PremiumServers.length >= 2) ||
(user.Tier == 3 && user.PremiumServers.length >= 0)
) {
interaction.followUp({
content:
"You have already reached the maximum amount of premium servers",
});
} else {
await client.data.setPremium(interaction.guild.id, "true");
await client.data.pushGuild(
interaction.user.id,
interaction.guild.id,
"push"
);
interaction.followUp({
embeds: [
new EmbedBuilder()
.setTitle("Success!")
.setDescription(
`Premium added to **${interaction.guild.name}**! \n`
)
.setFooter({ text: "Thank you for supporting Cath!" })
.setColor("Green")
.setTimestamp()
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
}),
],
});
client.channels.cache.get(client.config.ServerLog).send({
embeds: [
new EmbedBuilder()
.setTitle("New Premium Server")
.addFields({
name: "Server Info",
value: `**>Server Name**: \n${interaction.guild.name}
**>Server ID**: \n${interaction.guild.id}
**>Server Member Count**: \n${interaction.guild.memberCount}`,
})
.setTimestamp()
.setThumbnail(interaction.guild.iconURL({ dynamic: true }))
.setColor("Green"),
],
});
}
} else {
if (!guild.Premium) {
return interaction.followUp({
content: "This server isn't premium yet",
});
}
if (!user.PremiumServers.includes(interaction.guild.id)) {
return interaction.followUp({
content:
"You can't remove due to you aren't the person who made the server premium",
});
} else {
await client.data.setPremium(interaction.guild.id, "false");
await client.data.pushGuild(
interaction.user.id,
interaction.guild.id,
"splice"
);
interaction.followUp({
embeds: [
new EmbedBuilder()
.setTitle("Removed!")
.setDescription(
`Premium removed from **${interaction.guild.name}**! \n`
)
.setColor("Red")
.setTimestamp()
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
}),
],
});
client.channels.cache.get(client.config.ServerLog).send({
embeds: [
new EmbedBuilder()
.setTitle("Premium Server Removed")
.addFields({
name: "Server Info",
value: `**>Server Name**: \n${interaction.guild.name}
**>Server ID**: \n${interaction.guild.id}
**>Server Member Count**: \n${interaction.guild.memberCount}`,
})
.setTimestamp()
.setThumbnail(interaction.guild.iconURL({ dynamic: true }))
.setColor("Red"),
],
});
}
}
} catch (e) {
console.log(e);
interaction.followUp({ content: `**Error**: ${e.message}` });
}
},
};

View file

@ -1,246 +1,246 @@
const { EmbedBuilder } = require("discord.js");
const fs = require("fs");
module.exports = {
name: "settings",
description: "Configure settings for the server",
UserPerms: ["ADMINISTRATOR"],
category: "Config",
options: [
{
type: 2,
name: "enable",
description: "Enable commands/category for the server",
options: [
{
type: 1,
name: "command",
description: "To enable commands",
options: [
{
type: 3,
name: "name",
description: "The command name to be enabled",
required: true,
},
],
},
{
type: 1,
name: "category",
description: "To enable categories",
options: [
{
type: 3,
name: "name",
description: "The category name to be enabled",
required: true,
choices: [
{
name: "codm",
value: "CODM",
},
{
name: "config",
value: "Config",
},
{
name: "information",
value: "Information",
},
{
name: "utilities",
value: "Utilities",
},
],
},
],
},
],
},
{
type: 2,
name: "disable",
description: "Disable commands/category for the server",
options: [
{
type: 1,
name: "command",
description: "To disable commands",
options: [
{
type: 3,
name: "name",
description: "The command name to be disabled",
required: true,
},
],
},
{
type: 1,
name: "category",
description: "To disable categories",
options: [
{
type: 3,
name: "name",
description: "The category name to be disabled",
required: true,
choices: [
{
name: "codm",
value: "CODM",
},
{
name: "config",
value: "Config",
},
{
name: "information",
value: "Information",
},
{
name: "utilities",
value: "Utilities",
},
],
},
],
},
],
},
{
type: 1,
name: "tips",
description: "Configure tips settings for the server",
options: [
{
type: 5,
name: "choice",
description: "Set whether tips system is activated for the server",
required: true,
},
],
},
{
type: 1,
name: "overall",
description: "See overall settings for the server",
options: [],
},
],
run: async (client, interaction, args, utils, data) => {
if (args[0].toLowerCase() === "tips") {
if (args[1]) {
await client.data.setTips(interaction.guild.id, "true");
interaction.followUp({
content: `Tips is enabled in this server now.`,
});
} else {
await client.data.setTips(interaction.guild.id, "false");
interaction.followUp({
content: `Tips is disabled in this server now.`,
});
}
} else if (args[0].toLowerCase() === "enable") {
const type = args[1].toLowerCase();
const name = args[2].toLowerCase();
if (type === "command") {
if (!!client.slashCommands.get(name) === false) {
interaction.followUp({
content: `There isn't any command/category named \`${name}\``,
});
} else if (!data.Guild.Commands.includes(name)) {
interaction.followUp({
content: `\`${args[2]}\` command had already been enabled`,
});
} else if (
data.Guild.Commands.includes(name) &&
!!client.slashCommands.get(name) === true
) {
await client.data.enable(interaction.guild.id, "command", name);
interaction.followUp({
content: `\`${args[2]}\` command is now enabled`,
});
}
}
if (type === "category") {
const category = fs.readdirSync("./command");
if (!data.Guild.Category.includes(args[2])) {
interaction.followUp({
content: `\`${args[2]}\` category had already been enabled`,
});
}
if (
data.Guild.Category.includes(args[2]) &&
category.includes(args[2])
) {
await client.data.enable(interaction.guild.id, "category", args[2]);
interaction.followUp({
content: `\`${args[2]}\` category is now enabled`,
});
}
}
} else if (args[0].toLowerCase() === "disable") {
const type = args[1].toLowerCase();
const name = args[2].toLowerCase();
if (type === "command") {
if (!!client.slashCommands.get(name) === false) {
interaction.followUp({
content: `There isn't any command/category named \`${name}\``,
});
} else if (data.Guild.Commands.includes(name)) {
interaction.followUp({
content: `\`${args[2]}\` command had already been disabled`,
});
} else if (
!data.Guild.Commands.includes(name) &&
!!client.slashCommands.get(name) === true
) {
await client.data.disable(interaction.guild.id, "command", name);
interaction.followUp({
content: `\`${args[2]}\` command is now disabled`,
});
}
}
if (type === "category") {
const category = fs.readdirSync("./command");
if (data.Guild.Category.includes(args[2])) {
interaction.followUp({
content: `\`${args[2]}\` category had already been disabled`,
});
}
if (
!data.Guild.Category.includes(args[2]) &&
category.includes(args[2])
) {
await client.data.disable(interaction.guild.id, "category", args[2]);
interaction.followUp({
content: `\`${args[2]}\` category is now disabled`,
});
}
}
} else {
const d = `
**Prefix**: ${data.Guild.Prefix ? data.Guild.Prefix : "C."}
**Tips**: ${data.Guild.Tips ? "Enable" : "Disabled"}
**Disabled Commands**: ${
data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None"
}
**Disabled Categories**: ${
data.Guild.Category.length ? data.Guilds.Category.join(",") : "None"
}
`;
const embed = new EmbedBuilder()
.setTitle(`**${interaction.guild.name}** Settings`)
.setColor(client.color)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp()
.setDescription(d);
interaction.followUp({ embeds: [embed] });
}
},
};
const { EmbedBuilder } = require("discord.js");
const fs = require("fs");
module.exports = {
name: "settings",
description: "Configure settings for the server",
UserPerms: ["ADMINISTRATOR"],
category: "Config",
options: [
{
type: 2,
name: "enable",
description: "Enable commands/category for the server",
options: [
{
type: 1,
name: "command",
description: "To enable commands",
options: [
{
type: 3,
name: "name",
description: "The command name to be enabled",
required: true,
},
],
},
{
type: 1,
name: "category",
description: "To enable categories",
options: [
{
type: 3,
name: "name",
description: "The category name to be enabled",
required: true,
choices: [
{
name: "codm",
value: "CODM",
},
{
name: "config",
value: "Config",
},
{
name: "information",
value: "Information",
},
{
name: "utilities",
value: "Utilities",
},
],
},
],
},
],
},
{
type: 2,
name: "disable",
description: "Disable commands/category for the server",
options: [
{
type: 1,
name: "command",
description: "To disable commands",
options: [
{
type: 3,
name: "name",
description: "The command name to be disabled",
required: true,
},
],
},
{
type: 1,
name: "category",
description: "To disable categories",
options: [
{
type: 3,
name: "name",
description: "The category name to be disabled",
required: true,
choices: [
{
name: "codm",
value: "CODM",
},
{
name: "config",
value: "Config",
},
{
name: "information",
value: "Information",
},
{
name: "utilities",
value: "Utilities",
},
],
},
],
},
],
},
{
type: 1,
name: "tips",
description: "Configure tips settings for the server",
options: [
{
type: 5,
name: "choice",
description: "Set whether tips system is activated for the server",
required: true,
},
],
},
{
type: 1,
name: "overall",
description: "See overall settings for the server",
options: [],
},
],
run: async (client, interaction, args, utils, data) => {
if (args[0].toLowerCase() === "tips") {
if (args[1]) {
await client.data.setTips(interaction.guild.id, "true");
interaction.followUp({
content: `Tips is enabled in this server now.`,
});
} else {
await client.data.setTips(interaction.guild.id, "false");
interaction.followUp({
content: `Tips is disabled in this server now.`,
});
}
} else if (args[0].toLowerCase() === "enable") {
const type = args[1].toLowerCase();
const name = args[2].toLowerCase();
if (type === "command") {
if (!!client.slashCommands.get(name) === false) {
interaction.followUp({
content: `There isn't any command/category named \`${name}\``,
});
} else if (!data.Guild.Commands.includes(name)) {
interaction.followUp({
content: `\`${args[2]}\` command had already been enabled`,
});
} else if (
data.Guild.Commands.includes(name) &&
!!client.slashCommands.get(name) === true
) {
await client.data.enable(interaction.guild.id, "command", name);
interaction.followUp({
content: `\`${args[2]}\` command is now enabled`,
});
}
}
if (type === "category") {
const category = fs.readdirSync("./command");
if (!data.Guild.Category.includes(args[2])) {
interaction.followUp({
content: `\`${args[2]}\` category had already been enabled`,
});
}
if (
data.Guild.Category.includes(args[2]) &&
category.includes(args[2])
) {
await client.data.enable(interaction.guild.id, "category", args[2]);
interaction.followUp({
content: `\`${args[2]}\` category is now enabled`,
});
}
}
} else if (args[0].toLowerCase() === "disable") {
const type = args[1].toLowerCase();
const name = args[2].toLowerCase();
if (type === "command") {
if (!!client.slashCommands.get(name) === false) {
interaction.followUp({
content: `There isn't any command/category named \`${name}\``,
});
} else if (data.Guild.Commands.includes(name)) {
interaction.followUp({
content: `\`${args[2]}\` command had already been disabled`,
});
} else if (
!data.Guild.Commands.includes(name) &&
!!client.slashCommands.get(name) === true
) {
await client.data.disable(interaction.guild.id, "command", name);
interaction.followUp({
content: `\`${args[2]}\` command is now disabled`,
});
}
}
if (type === "category") {
const category = fs.readdirSync("./command");
if (data.Guild.Category.includes(args[2])) {
interaction.followUp({
content: `\`${args[2]}\` category had already been disabled`,
});
}
if (
!data.Guild.Category.includes(args[2]) &&
category.includes(args[2])
) {
await client.data.disable(interaction.guild.id, "category", args[2]);
interaction.followUp({
content: `\`${args[2]}\` category is now disabled`,
});
}
}
} else {
const d = `
**Prefix**: ${data.Guild.Prefix ? data.Guild.Prefix : "C."}
**Tips**: ${data.Guild.Tips ? "Enable" : "Disabled"}
**Disabled Commands**: ${
data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None"
}
**Disabled Categories**: ${
data.Guild.Category.length ? data.Guilds.Category.join(",") : "None"
}
`;
const embed = new EmbedBuilder()
.setTitle(`**${interaction.guild.name}** Settings`)
.setColor(client.color)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp()
.setDescription(d);
interaction.followUp({ embeds: [embed] });
}
},
};

View file

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

View file

@ -1,60 +1,60 @@
const { EmbedBuilder, version: djsversion } = require("discord.js");
const version = require("../../package.json").version;
module.exports = {
name: "botinfo",
description: "Check the info of the bot",
category: "Information",
run: async (client, interaction, args, utils) => {
const embed = new EmbedBuilder()
.setTitle(`NYX - CODM Gunsmith Bot`)
.setURL(utils.inviteLink(client.user.id))
.setThumbnail(
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
)
.setColor(client.color)
.addFields([
{
name: `General`,
value: `
<:nyx_owner:897418259433943120> Owner <@452076196419600394>
Bot ${client.user.tag}
Bot ID \`${client.user.id}\`
Created on \`${utils.botDate(
new Date(client.user.createdTimestamp)
)}\``,
inline: true,
},
{
name: `Bot Stats`,
value: `
Servers ${client.guilds.cache.size.toLocaleString()}
Users ${client.guilds.cache
.reduce((a, b) => a + b.memberCount, 0)
.toLocaleString()}
Channels \`${client.channels.cache.size.toLocaleString()}\`
Commands \`${client.slashCommands.size}\`
`,
inline: true,
},
{
name: `Platform`,
value: `
NYX \`v${version}\`
Discord.js \`v${djsversion}\`
Node.js \`${process.version}\``,
},
{
name: `**${client.author}**`,
value: `**Development Management**\n\u3000Ń1ght#0001\n\u3000Cat drinking a cat#0795\n\u3000mightyful#6536\n\u3000Thunder#2128\n\u3000mobo#9277\n
**Research & Documentation**\n\u3000Thunder#2128\n
**Website**\n\u3000Chunchunmaru#8570`,
},
])
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp();
interaction.followUp({ embeds: [embed] });
},
};
const { EmbedBuilder, version: djsversion } = require("discord.js");
const version = require("../../package.json").version;
module.exports = {
name: "botinfo",
description: "Check the info of the bot",
category: "Information",
run: async (client, interaction, args, utils) => {
const embed = new EmbedBuilder()
.setTitle(`NYX - CODM Gunsmith Bot`)
.setURL(utils.inviteLink(client.user.id))
.setThumbnail(
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
)
.setColor(client.color)
.addFields([
{
name: `General`,
value: `
<:nyx_owner:897418259433943120> Owner <@452076196419600394>
Bot ${client.user.tag}
Bot ID \`${client.user.id}\`
Created on \`${utils.botDate(
new Date(client.user.createdTimestamp)
)}\``,
inline: true,
},
{
name: `Bot Stats`,
value: `
Servers ${client.guilds.cache.size.toLocaleString()}
Users ${client.guilds.cache
.reduce((a, b) => a + b.memberCount, 0)
.toLocaleString()}
Channels \`${client.channels.cache.size.toLocaleString()}\`
Commands \`${client.slashCommands.size}\`
`,
inline: true,
},
{
name: `Platform`,
value: `
NYX \`v${version}\`
Discord.js \`v${djsversion}\`
Node.js \`${process.version}\``,
},
{
name: `**${client.author}**`,
value: `**Development Management**\n\u3000Ń1ght#0001\n\u3000Cat drinking a cat#0795\n\u3000mightyful#6536\n\u3000Thunder#2128\n\u3000mobo#9277\n
**Research & Documentation**\n\u3000Thunder#2128\n
**Website**\n\u3000Chunchunmaru#8570`,
},
])
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp();
interaction.followUp({ embeds: [embed] });
},
};

View file

@ -1,204 +1,204 @@
const {
EmbedBuilder,
Client,
CommandInteraction,
ActionRowBuilder,
StringSelectMenuBuilder,
ComponentType,
} = require("discord.js");
const Utils = require("../../util/functions/function");
module.exports = {
name: "help",
usage: "(Command/Category)",
description: "Shows all available bot commands",
category: "Information",
options: [
{
type: 3,
name: "command",
description: "The command you want to see",
required: false,
},
],
/**
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
* @param {Utils} utils
*/
run: async (client, interaction, args, utils) => {
if (!args[0]) {
await interaction.deleteReply();
const emoji = {
CODM: "<a:codm:897030768793104385>",
APEX: "🎆",
Config: "<a:config:896990033561669762>",
Information: "<a:information:894962394932064346>",
Utilities: "<a:utilites:897233087941988392>",
};
const directories = [
...new Set(client.slashCommands.map(cmd => cmd.directory)),
];
const categories = directories.map(dir => {
if (dir == "Owner") return;
const getCmds = client.slashCommands
.filter(c => c.directory == dir)
.map(cmd => {
return {
name: cmd.name || "No command name",
};
});
return {
directory: dir,
commands: getCmds,
};
});
const embed = new EmbedBuilder()
.setTitle(`**NYX's Commands**`)
.setDescription(`Please choose a category in the dropdown menu`)
.setColor(client.color)
.setTimestamp()
.addFields(
{
name: ":link: **Invite Me**",
value: `[Click Here](${utils.inviteLink(client.user.id)})`,
inline: true,
},
{
name: "<:support1:867093614403256350> **Need Help ?**",
value: `[Support Server](${client.invite})`,
inline: true,
},
{
name: "<:YouTube:841186450497339412> **Video Guide**",
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
inline: true,
},
{
name: `<:nyx_description:897379659665264650> Documentation`,
value: `[Click here](${client.docs})`,
inline: true,
},
{
name: "<a:booster:896527475063025704> **Premium**",
value: `You can either boost support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team.`,
inline: false,
}
)
.setURL(client.docs)
.setThumbnail(
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
)
.setFooter({
text: `Requested by ${interaction.user.tag}`,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
});
const components = state => [
new ActionRowBuilder().addComponents(
new StringSelectMenuBuilder()
.setCustomId("help-menu")
.setPlaceholder(`Please select a category`)
.setDisabled(state)
.addOptions(
categories.map(cmd => {
return {
label: cmd.directory,
value: cmd.directory,
description: `Commands from ${cmd.directory} category`,
emoji: emoji[cmd.directory] || null,
};
})
)
),
];
const msg = await interaction.channel.send({
embeds: [embed],
components: components(false),
});
const filter = m => m.user.id === interaction.user.id;
const collector = interaction.channel.createMessageComponentCollector({
filter,
componentType: ComponentType.StringSelect,
time: 60000,
});
collector.on("collect", async interaction => {
const [directory] = interaction.values;
const category = categories.find(u => u.directory === directory);
const newembed = new EmbedBuilder()
.setTitle(
`${emoji[directory]} ${directory} Commands ${emoji[directory]}`
)
.setTimestamp()
.setColor(client.color)
.setFooter({
text: `Please use /help (Command Name) for more details`,
})
.setDescription(
category.commands
.map(cmd => {
return [`\`${cmd.name}\``];
})
.join(", ")
);
interaction.reply({ embeds: [newembed] });
});
collector.on("end", () => msg.edit({ components: components(true) }));
} else {
const command = client.slashCommands.get(args[0].toLowerCase());
if (!command) {
interaction.editReply({
content: `There isn't any command named "${args[0]}"`,
});
} else {
if (command.UserPerms && Array.isArray(command.UserPerms)) {
UserPermissions = command.UserPerms;
} else {
UserPermissions = [command.UserPerms ? command.UserPerms : ""];
}
const fields = [];
const embed = new EmbedBuilder()
.setTitle(`"${command.name}" command details`)
.addFields([
{
name: "**Command**:",
value: command.name ? `\`${command.name}\`` : "N/A",
},
]);
if (command.usage)
fields.push({
name: "**Usage**:",
value: `\`/${command.name} ${command.usage}\``,
});
else
fields.push({
name: "**Usage**:",
value: `\`/${command.name}\``,
});
if (command.description)
fields.push({
name: "**Description**:",
value: command.description,
});
if (command.timeout)
fields.push({
name: "**Cooldown**:",
value: utils.timer(command.timeout),
});
embed
.setFooter({
text: `Requested by ${interaction.user.tag}`,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp()
.addFields(fields)
.setURL(client.web)
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
}
}
},
};
const {
EmbedBuilder,
Client,
CommandInteraction,
ActionRowBuilder,
StringSelectMenuBuilder,
ComponentType,
} = require("discord.js");
const Utils = require("../../util/functions/function");
module.exports = {
name: "help",
usage: "(Command/Category)",
description: "Shows all available bot commands",
category: "Information",
options: [
{
type: 3,
name: "command",
description: "The command you want to see",
required: false,
},
],
/**
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
* @param {Utils} utils
*/
run: async (client, interaction, args, utils) => {
if (!args[0]) {
await interaction.deleteReply();
const emoji = {
CODM: "<a:codm:897030768793104385>",
APEX: "🎆",
Config: "<a:config:896990033561669762>",
Information: "<a:information:894962394932064346>",
Utilities: "<a:utilites:897233087941988392>",
};
const directories = [
...new Set(client.slashCommands.map(cmd => cmd.directory)),
];
const categories = directories.map(dir => {
if (dir == "Owner") return;
const getCmds = client.slashCommands
.filter(c => c.directory == dir)
.map(cmd => {
return {
name: cmd.name || "No command name",
};
});
return {
directory: dir,
commands: getCmds,
};
});
const embed = new EmbedBuilder()
.setTitle(`**NYX's Commands**`)
.setDescription(`Please choose a category in the dropdown menu`)
.setColor(client.color)
.setTimestamp()
.addFields(
{
name: ":link: **Invite Me**",
value: `[Click Here](${utils.inviteLink(client.user.id)})`,
inline: true,
},
{
name: "<:support1:867093614403256350> **Need Help ?**",
value: `[Support Server](${client.invite})`,
inline: true,
},
{
name: "<:YouTube:841186450497339412> **Video Guide**",
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
inline: true,
},
{
name: `<:nyx_description:897379659665264650> Documentation`,
value: `[Click here](${client.docs})`,
inline: true,
},
{
name: "<a:booster:896527475063025704> **Premium**",
value: `You can either boost support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team.`,
inline: false,
}
)
.setURL(client.docs)
.setThumbnail(
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
)
.setFooter({
text: `Requested by ${interaction.user.tag}`,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
});
const components = state => [
new ActionRowBuilder().addComponents(
new StringSelectMenuBuilder()
.setCustomId("help-menu")
.setPlaceholder(`Please select a category`)
.setDisabled(state)
.addOptions(
categories.map(cmd => {
return {
label: cmd.directory,
value: cmd.directory,
description: `Commands from ${cmd.directory} category`,
emoji: emoji[cmd.directory] || null,
};
})
)
),
];
const msg = await interaction.channel.send({
embeds: [embed],
components: components(false),
});
const filter = m => m.user.id === interaction.user.id;
const collector = interaction.channel.createMessageComponentCollector({
filter,
componentType: ComponentType.StringSelect,
time: 60000,
});
collector.on("collect", async interaction => {
const [directory] = interaction.values;
const category = categories.find(u => u.directory === directory);
const newembed = new EmbedBuilder()
.setTitle(
`${emoji[directory]} ${directory} Commands ${emoji[directory]}`
)
.setTimestamp()
.setColor(client.color)
.setFooter({
text: `Please use /help (Command Name) for more details`,
})
.setDescription(
category.commands
.map(cmd => {
return [`\`${cmd.name}\``];
})
.join(", ")
);
interaction.reply({ embeds: [newembed] });
});
collector.on("end", () => msg.edit({ components: components(true) }));
} else {
const command = client.slashCommands.get(args[0].toLowerCase());
if (!command) {
interaction.editReply({
content: `There isn't any command named "${args[0]}"`,
});
} else {
if (command.UserPerms && Array.isArray(command.UserPerms)) {
UserPermissions = command.UserPerms;
} else {
UserPermissions = [command.UserPerms ? command.UserPerms : ""];
}
const fields = [];
const embed = new EmbedBuilder()
.setTitle(`"${command.name}" command details`)
.addFields([
{
name: "**Command**:",
value: command.name ? `\`${command.name}\`` : "N/A",
},
]);
if (command.usage)
fields.push({
name: "**Usage**:",
value: `\`/${command.name} ${command.usage}\``,
});
else
fields.push({
name: "**Usage**:",
value: `\`/${command.name}\``,
});
if (command.description)
fields.push({
name: "**Description**:",
value: command.description,
});
if (command.timeout)
fields.push({
name: "**Cooldown**:",
value: utils.timer(command.timeout),
});
embed
.setFooter({
text: `Requested by ${interaction.user.tag}`,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp()
.addFields(fields)
.setURL(client.web)
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
}
}
},
};

View file

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

View file

@ -1,89 +1,89 @@
const { Client, CommandInteraction, EmbedBuilder } = require("discord.js");
const Utils = require("../../util/functions/function");
module.exports = {
name: "userinfo",
description: "Check the info of a user",
usage: "{User}",
category: "Information",
options: [
{
type: 6,
name: "user",
description: "The user you want to see",
required: false,
},
],
/**
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
* @param {Utils} utils
*/
run: async (client, interaction, args, utils) => {
const member =
interaction.guild.members.cache.get(args[0]) || interaction.member;
const x = Date.now() - member.user.createdAt;
const y =
Date.now() - interaction.guild.members.cache.get(member.id).joinedAt;
const created = Math.floor(x / 86400000);
const joined = Math.floor(y / 86400000);
const nickname = member.nickname || "None";
const roles = member.roles.cache
.filter(r => r.id != interaction.guild.id)
.sort((a, b) => b.position - a.position)
.map(role => role.toString());
const createDateFormatted = utils.parseDate(
new Date(member.user.createdAt)
);
const joinDateFormatted = utils.parseDate(new Date(member.joinedAt));
const embed = new EmbedBuilder()
.setAuthor({
name: member.user.tag,
iconURL: member.user.displayAvatarURL({ dynamic: true, size: 4096 }),
})
.setTimestamp()
.setColor(member.displayHexColor || client.color)
.setURL(client.web)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true, size: 4096 }),
})
.setThumbnail(member.user.displayAvatarURL({ dynamic: true, size: 4096 }))
.addFields([
{
name: "User",
value: `** User Tag:** ${member.user.tag} ${client.owners.includes(member.id) ? client.dev : ""}
** Username:** ${member.user.username}
** Discriminator:** ${member.user.discriminator}
** Nickname:** ${nickname}
** User ID:** ${member.id}
** Avatar:** [Link to avatar](${member.user.displayAvatarURL({
dynamic: true,
size: 2048,
})})
** Time Created:** ${createDateFormatted} \nSince ${created} day${created <= 1 ? "" : "s"} ago
\u200b`,
},
{
name: "Member",
value: `** Highest Role:** ${
member.roles.highest.id === interaction.guild.id
? "None"
: member.roles.highest.name
}
** Server Join Date:** ${joinDateFormatted} \nSince ${joined} day${joined <= 1 ? "" : "s"} ago
** Roles [${roles.length}]:** ${
roles.length < 10 && roles.length > 0
? roles.join(" **|** ")
: roles.length > 0
? utils.trimArray(roles)
: "None"
}
\u200b`,
},
]);
interaction.followUp({ embeds: [embed] });
},
};
const { Client, CommandInteraction, EmbedBuilder } = require("discord.js");
const Utils = require("../../util/functions/function");
module.exports = {
name: "userinfo",
description: "Check the info of a user",
usage: "{User}",
category: "Information",
options: [
{
type: 6,
name: "user",
description: "The user you want to see",
required: false,
},
],
/**
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
* @param {Utils} utils
*/
run: async (client, interaction, args, utils) => {
const member =
interaction.guild.members.cache.get(args[0]) || interaction.member;
const x = Date.now() - member.user.createdAt;
const y =
Date.now() - interaction.guild.members.cache.get(member.id).joinedAt;
const created = Math.floor(x / 86400000);
const joined = Math.floor(y / 86400000);
const nickname = member.nickname || "None";
const roles = member.roles.cache
.filter(r => r.id != interaction.guild.id)
.sort((a, b) => b.position - a.position)
.map(role => role.toString());
const createDateFormatted = utils.parseDate(
new Date(member.user.createdAt)
);
const joinDateFormatted = utils.parseDate(new Date(member.joinedAt));
const embed = new EmbedBuilder()
.setAuthor({
name: member.user.tag,
iconURL: member.user.displayAvatarURL({ dynamic: true, size: 4096 }),
})
.setTimestamp()
.setColor(member.displayHexColor || client.color)
.setURL(client.web)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true, size: 4096 }),
})
.setThumbnail(member.user.displayAvatarURL({ dynamic: true, size: 4096 }))
.addFields([
{
name: "User",
value: `** User Tag:** ${member.user.tag} ${client.owners.includes(member.id) ? client.dev : ""}
** Username:** ${member.user.username}
** Discriminator:** ${member.user.discriminator}
** Nickname:** ${nickname}
** User ID:** ${member.id}
** Avatar:** [Link to avatar](${member.user.displayAvatarURL({
dynamic: true,
size: 2048,
})})
** Time Created:** ${createDateFormatted} \nSince ${created} day${created <= 1 ? "" : "s"} ago
\u200b`,
},
{
name: "Member",
value: `** Highest Role:** ${
member.roles.highest.id === interaction.guild.id
? "None"
: member.roles.highest.name
}
** Server Join Date:** ${joinDateFormatted} \nSince ${joined} day${joined <= 1 ? "" : "s"} ago
** Roles [${roles.length}]:** ${
roles.length < 10 && roles.length > 0
? roles.join(" **|** ")
: roles.length > 0
? utils.trimArray(roles)
: "None"
}
\u200b`,
},
]);
interaction.followUp({ embeds: [embed] });
},
};

View file

@ -1,50 +1,50 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "accept",
category: "Owner",
usage: "(Message)",
description: "Accept a suggestion",
Owner: true,
options: [
{
type: 3,
name: "messageid",
description: "The message ID to accept",
required: true,
},
{
type: 3,
name: "query",
description: "The accept query",
required: false,
},
],
run: async (client, interaction, args) => {
const MessageID = args[0];
const acceptQuery =
args.slice(1).join(" ") || `They didn't leave any message.`;
try {
const suggestionChannel = interaction.guild.channels.cache.get(
client.config.Report
);
const suggestEmbed = await suggestionChannel.messages.fetch(MessageID);
const data = suggestEmbed.embeds[0];
const acceptEmbed = new EmbedBuilder()
.setAuthor(data.author.name, data.author.iconURL)
.setDescription(data.description)
.setColor("Green")
.addField("**Status(ACCEPTED)**", acceptQuery);
suggestEmbed.edit({ embeds: [acceptEmbed] });
const user = await client.users.cache.find(
u => u.tag === data.author.name
);
interaction.followUp({
content: "<a:nyx_checkmark:897240322411724841> Suggestion Accepted",
});
user.send({ embeds: [acceptEmbed] });
} catch (e) {
interaction.followUp({ content: "That suggestion doesn't exist" });
console.log(e);
}
},
};
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "accept",
category: "Owner",
usage: "(Message)",
description: "Accept a suggestion",
Owner: true,
options: [
{
type: 3,
name: "messageid",
description: "The message ID to accept",
required: true,
},
{
type: 3,
name: "query",
description: "The accept query",
required: false,
},
],
run: async (client, interaction, args) => {
const MessageID = args[0];
const acceptQuery =
args.slice(1).join(" ") || `They didn't leave any message.`;
try {
const suggestionChannel = interaction.guild.channels.cache.get(
client.config.Report
);
const suggestEmbed = await suggestionChannel.messages.fetch(MessageID);
const data = suggestEmbed.embeds[0];
const acceptEmbed = new EmbedBuilder()
.setAuthor(data.author.name, data.author.iconURL)
.setDescription(data.description)
.setColor("Green")
.addField("**Status(ACCEPTED)**", acceptQuery);
suggestEmbed.edit({ embeds: [acceptEmbed] });
const user = await client.users.cache.find(
u => u.tag === data.author.name
);
interaction.followUp({
content: "<a:nyx_checkmark:897240322411724841> Suggestion Accepted",
});
user.send({ embeds: [acceptEmbed] });
} catch (e) {
interaction.followUp({ content: "That suggestion doesn't exist" });
console.log(e);
}
},
};

View file

@ -1,65 +1,65 @@
module.exports = {
name: "blacklist",
category: "Owner",
usage: "(User) (Toggle) (Reason)",
description: "Manage Blacklisted Users",
Owner: true,
options: [
{
type: 6,
name: "user",
description: "The user to blacklist/whitelist",
required: true,
},
{
type: 5,
name: "blacklist",
description: "Whether to blacklist or whitelist",
required: true,
},
{
type: 3,
name: "reason",
description: "The reason to blacklist",
required: true,
},
],
run: async (client, interaction) => {
const user = interaction.options.getUser("user");
const toggle = interaction.options.getBoolean("blacklist");
const reason = interaction.options.getString("reason");
if (toggle === true) {
await client.data.BK(user.id, toggle, reason);
const embed = new EmbedBuilder()
.setTitle(
"<a:nyx_checkmark:897240322411724841> Successfully Blacklisted"
)
.setDescription(
`**User:** ${user.user.tag} \`(${user.id})\`\n**Reason:** ${reason} \n**Blacklisted by:** ${interaction.member}`
)
.setURL(client.web)
.setColor(client.color)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp();
interaction.followUp({ embeds: [embed] });
} else {
await client.data.BK(user.id, toggle, reason);
const embed = new EmbedBuilder()
.setTitle("<a:nyx_checkmark:897240322411724841> Removed From Blacklist")
.setDescription(
`**User:** ${user.user.tag} \`(${user.id})\`\n**Reason:** ${reason} \n**Whitelisted by:** ${interaction.member}`
)
.setURL(client.web)
.setColor(client.color)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp();
interaction.followUp({ embeds: [embed] });
}
},
};
module.exports = {
name: "blacklist",
category: "Owner",
usage: "(User) (Toggle) (Reason)",
description: "Manage Blacklisted Users",
Owner: true,
options: [
{
type: 6,
name: "user",
description: "The user to blacklist/whitelist",
required: true,
},
{
type: 5,
name: "blacklist",
description: "Whether to blacklist or whitelist",
required: true,
},
{
type: 3,
name: "reason",
description: "The reason to blacklist",
required: true,
},
],
run: async (client, interaction) => {
const user = interaction.options.getUser("user");
const toggle = interaction.options.getBoolean("blacklist");
const reason = interaction.options.getString("reason");
if (toggle === true) {
await client.data.BK(user.id, toggle, reason);
const embed = new EmbedBuilder()
.setTitle(
"<a:nyx_checkmark:897240322411724841> Successfully Blacklisted"
)
.setDescription(
`**User:** ${user.user.tag} \`(${user.id})\`\n**Reason:** ${reason} \n**Blacklisted by:** ${interaction.member}`
)
.setURL(client.web)
.setColor(client.color)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp();
interaction.followUp({ embeds: [embed] });
} else {
await client.data.BK(user.id, toggle, reason);
const embed = new EmbedBuilder()
.setTitle("<a:nyx_checkmark:897240322411724841> Removed From Blacklist")
.setDescription(
`**User:** ${user.user.tag} \`(${user.id})\`\n**Reason:** ${reason} \n**Whitelisted by:** ${interaction.member}`
)
.setURL(client.web)
.setColor(client.color)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp();
interaction.followUp({ embeds: [embed] });
}
},
};

View file

@ -1,49 +1,49 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "deny",
category: "Owner",
usage: "(Message)",
description: "Deny a suggestion",
Owner: true,
options: [
{
type: 3,
name: "messageid",
description: "The message ID to deny",
required: true,
},
{
type: 3,
name: "query",
description: "The deny query",
required: false,
},
],
run: async (client, interaction, args) => {
const MessageID = args[0];
const denyQuery = args[1] || `They didn't leave any message.`;
try {
const suggestionChannel = interaction.guild.channels.cache.get(
client.config.Report
);
const suggestEmbed = await suggestionChannel.messages.fetch(MessageID);
const data = suggestEmbed.embeds[0];
const denyEmbed = new EmbedBuilder()
.setAuthor(data.author.name, data.author.iconURL)
.setDescription(data.description)
.setColor("Red")
.addField("**Status(DENIED)**", denyQuery);
suggestEmbed.edit({ embeds: [denyEmbed] });
const user = await client.users.cache.find(
u => u.tag === data.author.name
);
interaction.followUp({
content: "<a:nyx_cross:897244999211696198> Suggestion Denied",
});
user.send({ embeds: [denyEmbed] });
} catch (e) {
interaction.followUp({ content: "That suggestion doesn't exist" });
console.log(e);
}
},
};
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "deny",
category: "Owner",
usage: "(Message)",
description: "Deny a suggestion",
Owner: true,
options: [
{
type: 3,
name: "messageid",
description: "The message ID to deny",
required: true,
},
{
type: 3,
name: "query",
description: "The deny query",
required: false,
},
],
run: async (client, interaction, args) => {
const MessageID = args[0];
const denyQuery = args[1] || `They didn't leave any message.`;
try {
const suggestionChannel = interaction.guild.channels.cache.get(
client.config.Report
);
const suggestEmbed = await suggestionChannel.messages.fetch(MessageID);
const data = suggestEmbed.embeds[0];
const denyEmbed = new EmbedBuilder()
.setAuthor(data.author.name, data.author.iconURL)
.setDescription(data.description)
.setColor("Red")
.addField("**Status(DENIED)**", denyQuery);
suggestEmbed.edit({ embeds: [denyEmbed] });
const user = await client.users.cache.find(
u => u.tag === data.author.name
);
interaction.followUp({
content: "<a:nyx_cross:897244999211696198> Suggestion Denied",
});
user.send({ embeds: [denyEmbed] });
} catch (e) {
interaction.followUp({ content: "That suggestion doesn't exist" });
console.log(e);
}
},
};

View file

@ -1,33 +1,33 @@
module.exports = {
name: "dm",
category: "Owner",
usage: "(User) (Message)",
description: "DM a user",
Owner: true,
options: [
{
type: 6,
name: "user",
description: "The user you want to send",
required: true,
},
{
type: 3,
name: "msg",
description: "The message you want to send",
required: true,
},
],
run: async (client, interaction, args) => {
const user = interaction.options.getUser("user");
if (!user) return interaction.followUp("User?");
if (!args[1]) return interaction.followUp("Message?");
try {
await user
.send({ content: args[1] })
.then(() => interaction.followUp({ content: `Sent message` }));
} catch (err) {
interaction.user.send({ content: "That user can't be dmed" });
}
},
};
module.exports = {
name: "dm",
category: "Owner",
usage: "(User) (Message)",
description: "DM a user",
Owner: true,
options: [
{
type: 6,
name: "user",
description: "The user you want to send",
required: true,
},
{
type: 3,
name: "msg",
description: "The message you want to send",
required: true,
},
],
run: async (client, interaction, args) => {
const user = interaction.options.getUser("user");
if (!user) return interaction.followUp("User?");
if (!args[1]) return interaction.followUp("Message?");
try {
await user
.send({ content: args[1] })
.then(() => interaction.followUp({ content: `Sent message` }));
} catch (err) {
interaction.user.send({ content: "That user can't be dmed" });
}
},
};

View file

@ -1,129 +1,129 @@
const Discord = require("discord.js");
module.exports = {
name: "eval",
category: "Owner",
usage: "(Code)",
Owner: true,
description: "Eval something",
options: [
{
type: 3,
name: "code",
description: "The code to eval",
required: true,
},
],
run: async (client, interaction, args, utils) => {
const code = args[0];
function CheckFilter(object) {
if (typeof object === "string") {
object = object.replace(
new RegExp(`${client.token || process.env.TOKEN}`, "gi"),
"Cannot eval Token"
);
} else if (typeof object === "object") {
if (Array.isArray(object)) {
for (let i = 0; i < object.length; i++) {
object[i] = CheckFilter(object[i]);
}
} else {
for (const key in object) {
object[key] = CheckFilter(object[key]);
}
}
}
return object;
}
const oldSend = Discord.TextChannel.prototype.send;
Discord.TextChannel.prototype.send = async function send(content, options) {
return oldSend.bind(this)(CheckFilter(content), CheckFilter(options));
};
let evaled;
try {
evaled = eval(code);
if (evaled instanceof Promise) evaled = await evaled;
} catch (err) {
evaled = err;
}
if (typeof evaled !== "string") evaled = require("util").inspect(evaled);
evaled = chunk([evaled], 750);
let reactions = ["❌", "⏪", "◀️", "⏹️", "▶️", "⏩"],
page = 0,
evaledEmbed = new Discord.EmbedBuilder()
.setColor(client.color)
.setDescription(`\`\`\`js\n${evaled[0]}\n\`\`\``)
.setTimestamp()
.setAuthor({
name: `Evaled by ${interaction.user.tag}`,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
});
const mainMessage = await interaction.channel.send({
embeds: [evaledEmbed],
});
Discord.TextChannel.prototype.send = oldSend;
await Promise.all(
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).map(r =>
mainMessage.react(r)
)
);
const filter = (reaction, user) =>
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).some(
e => e === reaction.emoji.name
) && user.id === interaction.user.id;
const collector = mainMessage.createReactionCollector({
filter,
time: 999999,
});
collector.on("collect", async reaction => {
switch (reaction.emoji.name) {
case "❌":
await collector.stop();
return mainMessage.delete();
case "⏪":
if (evaled.length === 1 || page === 0) return;
page = 0;
break;
case "◀️":
if (evaled.length === 1) return;
if (page === 0) {
page = evaled.length - 1;
} else {
page -= 1;
}
break;
case "⏹️":
await collector.stop();
for (const reaction of mainMessage.reactions.cache.map(e => e)) {
await reaction.users.remove(client.user.id);
}
return;
case "▶️":
if (evaled.length === 1) return;
if (page === evaled.length - 1) {
page = 0;
} else {
page += 1;
}
break;
case "⏩":
if (evaled.length === 1 || page === evaled.length - 1) return;
page = evaled.length - 1;
break;
}
evaledEmbed = new Discord.EmbedBuilder()
.setColor(interaction.guild.me.displayColor)
.setDescription(`\`\`\`js\n${evaled[page]}\n\`\`\``);
await mainMessage.edit({
embeds: [evaledEmbed],
});
});
},
};
function chunk(arr, size) {
let c;
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => {
c = arr.slice(i * size, i * size + size);
});
return c;
}
const Discord = require("discord.js");
module.exports = {
name: "eval",
category: "Owner",
usage: "(Code)",
Owner: true,
description: "Eval something",
options: [
{
type: 3,
name: "code",
description: "The code to eval",
required: true,
},
],
run: async (client, interaction, args, utils) => {
const code = args[0];
function CheckFilter(object) {
if (typeof object === "string") {
object = object.replace(
new RegExp(`${client.token || process.env.TOKEN}`, "gi"),
"Cannot eval Token"
);
} else if (typeof object === "object") {
if (Array.isArray(object)) {
for (let i = 0; i < object.length; i++) {
object[i] = CheckFilter(object[i]);
}
} else {
for (const key in object) {
object[key] = CheckFilter(object[key]);
}
}
}
return object;
}
const oldSend = Discord.TextChannel.prototype.send;
Discord.TextChannel.prototype.send = async function send(content, options) {
return oldSend.bind(this)(CheckFilter(content), CheckFilter(options));
};
let evaled;
try {
evaled = eval(code);
if (evaled instanceof Promise) evaled = await evaled;
} catch (err) {
evaled = err;
}
if (typeof evaled !== "string") evaled = require("util").inspect(evaled);
evaled = chunk([evaled], 750);
let reactions = ["❌", "⏪", "◀️", "⏹️", "▶️", "⏩"],
page = 0,
evaledEmbed = new Discord.EmbedBuilder()
.setColor(client.color)
.setDescription(`\`\`\`js\n${evaled[0]}\n\`\`\``)
.setTimestamp()
.setAuthor({
name: `Evaled by ${interaction.user.tag}`,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
});
const mainMessage = await interaction.channel.send({
embeds: [evaledEmbed],
});
Discord.TextChannel.prototype.send = oldSend;
await Promise.all(
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).map(r =>
mainMessage.react(r)
)
);
const filter = (reaction, user) =>
(evaled.length === 1 ? ["❌", "⏹️"] : reactions).some(
e => e === reaction.emoji.name
) && user.id === interaction.user.id;
const collector = mainMessage.createReactionCollector({
filter,
time: 999999,
});
collector.on("collect", async reaction => {
switch (reaction.emoji.name) {
case "❌":
await collector.stop();
return mainMessage.delete();
case "⏪":
if (evaled.length === 1 || page === 0) return;
page = 0;
break;
case "◀️":
if (evaled.length === 1) return;
if (page === 0) {
page = evaled.length - 1;
} else {
page -= 1;
}
break;
case "⏹️":
await collector.stop();
for (const reaction of mainMessage.reactions.cache.map(e => e)) {
await reaction.users.remove(client.user.id);
}
return;
case "▶️":
if (evaled.length === 1) return;
if (page === evaled.length - 1) {
page = 0;
} else {
page += 1;
}
break;
case "⏩":
if (evaled.length === 1 || page === evaled.length - 1) return;
page = evaled.length - 1;
break;
}
evaledEmbed = new Discord.EmbedBuilder()
.setColor(interaction.guild.me.displayColor)
.setDescription(`\`\`\`js\n${evaled[page]}\n\`\`\``);
await mainMessage.edit({
embeds: [evaledEmbed],
});
});
},
};
function chunk(arr, size) {
let c;
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => {
c = arr.slice(i * size, i * size + size);
});
return c;
}

View file

@ -1,47 +1,47 @@
module.exports = {
name: "getinvite",
category: "Owner",
usage: "(Guild)",
description: "Generates an invitation to the server",
Owner: true,
options: [
{
type: 3,
name: "guild",
description: "The guild you want to get invite (Server ID/Name)",
required: true,
},
],
run: async (client, interaction, args) => {
let guild = null;
const fetched =
client.guilds.cache.find(g => g.name === args.join(" ")) ||
client.guilds.cache.get(args[0]);
guild = fetched;
if (guild) {
const tChannel = guild.channels.cache.find(
ch =>
ch.type == "GUILD_TEXT" &&
ch.permissionsFor(ch.guild.me).has("CREATE_INSTANT_INVITE")
);
if (!tChannel) {
interaction.followUp({
content: `\`${args.join(
" "
)}\` - Bot can't get invite since it doesn't get enough permission`,
});
}
const invite = await tChannel
.createInvite({ temporary: false, maxAge: 0 })
.catch(e => {
console.log(e);
interaction.followUp({ content: e.stack });
});
interaction.followUp({ content: invite.url });
} else {
interaction.followUp({
content: `\`${args.join(" ")}\` - Bot isn't in that server`,
});
}
},
};
module.exports = {
name: "getinvite",
category: "Owner",
usage: "(Guild)",
description: "Generates an invitation to the server",
Owner: true,
options: [
{
type: 3,
name: "guild",
description: "The guild you want to get invite (Server ID/Name)",
required: true,
},
],
run: async (client, interaction, args) => {
let guild = null;
const fetched =
client.guilds.cache.find(g => g.name === args.join(" ")) ||
client.guilds.cache.get(args[0]);
guild = fetched;
if (guild) {
const tChannel = guild.channels.cache.find(
ch =>
ch.type == "GUILD_TEXT" &&
ch.permissionsFor(ch.guild.me).has("CREATE_INSTANT_INVITE")
);
if (!tChannel) {
interaction.followUp({
content: `\`${args.join(
" "
)}\` - Bot can't get invite since it doesn't get enough permission`,
});
}
const invite = await tChannel
.createInvite({ temporary: false, maxAge: 0 })
.catch(e => {
console.log(e);
interaction.followUp({ content: e.stack });
});
interaction.followUp({ content: invite.url });
} else {
interaction.followUp({
content: `\`${args.join(" ")}\` - Bot isn't in that server`,
});
}
},
};

View file

@ -1,45 +1,45 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "guilds",
category: "Owner",
description: "Check top 10 guilds of the bot",
Owner: true,
run: async (client, interaction) => {
const guilds = client.guilds.cache
.sort((a, b) => b.memberCount - a.memberCount)
.first(10);
const description = guilds
.map((guild, index) => {
return `**${index + 1}** ${guild.name} = ${
guild.memberCount
} members`;
})
.join("\n");
const embed = new EmbedBuilder()
.setTitle("Guilds")
.setDescription(description)
.setColor(client.color)
.addFields([
{
name: `Total Guilds`,
value: client.guilds.cache.size
? client.guilds.cache.size.toString()
: "0",
inline: true,
},
{
name: `Total Members`,
value: client.users.cache.size
? client.users.cache.size.toString()
: "0",
inline: true,
},
])
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp();
interaction.followUp({ embeds: [embed] });
},
};
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "guilds",
category: "Owner",
description: "Check top 10 guilds of the bot",
Owner: true,
run: async (client, interaction) => {
const guilds = client.guilds.cache
.sort((a, b) => b.memberCount - a.memberCount)
.first(10);
const description = guilds
.map((guild, index) => {
return `**${index + 1}** ${guild.name} = ${
guild.memberCount
} members`;
})
.join("\n");
const embed = new EmbedBuilder()
.setTitle("Guilds")
.setDescription(description)
.setColor(client.color)
.addFields([
{
name: `Total Guilds`,
value: client.guilds.cache.size
? client.guilds.cache.size.toString()
: "0",
inline: true,
},
{
name: `Total Members`,
value: client.users.cache.size
? client.users.cache.size.toString()
: "0",
inline: true,
},
])
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp();
interaction.followUp({ embeds: [embed] });
},
};

View file

@ -1,18 +1,18 @@
module.exports = {
name: "restart",
category: "Owner",
description: "Restart the bot",
Owner: true,
run: async (client, interaction, args) => {
await interaction.deleteReply();
const msg = await interaction.channel.send(
"<a:config:896990033561669762> Restarting "
);
await client.destroy();
await client.login(process.env.TOKEN);
await msg.delete();
await interaction.channel.send(
"<a:nyx_checkmark:897240322411724841> Restarted"
);
},
};
module.exports = {
name: "restart",
category: "Owner",
description: "Restart the bot",
Owner: true,
run: async (client, interaction, args) => {
await interaction.deleteReply();
const msg = await interaction.channel.send(
"<a:config:896990033561669762> Restarting "
);
await client.destroy();
await client.login(process.env.TOKEN);
await msg.delete();
await interaction.channel.send(
"<a:nyx_checkmark:897240322411724841> Restarted"
);
},
};

View file

@ -1,38 +1,38 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "invite",
description: "Get bot invite link or get support",
category: "Utilities",
run: async (client, interaction, args, utils) => {
const embed = new EmbedBuilder()
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setColor(client.color)
.setTimestamp()
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
})
.setTitle(`Support/Invite`)
.setThumbnail(
"https://github.com/night0721/cath.js/blob/master/util/assets/images/nyx_logo_transparent.webp"
)
.addFields([
{
name: "<a:booster:896527475063025704> **Premium**",
value:
"**You can either boost support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team.**",
inline: true,
},
]);
interaction.followUp({
content: "Please click the buttons below for more information",
embeds: [embed],
components: utils.buttons(client),
});
},
};
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "invite",
description: "Get bot invite link or get support",
category: "Utilities",
run: async (client, interaction, args, utils) => {
const embed = new EmbedBuilder()
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setColor(client.color)
.setTimestamp()
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
})
.setTitle(`Support/Invite`)
.setThumbnail(
"https://github.com/night0721/cath.js/blob/master/util/assets/images/nyx_logo_transparent.webp"
)
.addFields([
{
name: "<a:booster:896527475063025704> **Premium**",
value:
"**You can either boost support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team.**",
inline: true,
},
]);
interaction.followUp({
content: "Please click the buttons below for more information",
embeds: [embed],
components: utils.buttons(client),
});
},
};

View file

@ -1,45 +1,45 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "report",
description: "Report a bug of the bot",
category: "Utilities",
options: [
{
type: 3,
name: "bug",
description: "The bug you want to report",
required: true,
},
],
run: async (client, interaction, args) => {
interaction.followUp({
embeds: [
new EmbedBuilder()
.setTitle("SUCCESS!")
.setDescription(
"You have reported a bug.\nPlease wait for us to solve it"
)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp()
.setColor("Green"),
],
});
client.channels.cache.get(client.config.Report).send({
embeds: [
new EmbedBuilder()
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
})
.setTitle("New Bug")
.setDescription(args[0])
.setColor("Orange")
.setTimestamp(),
],
});
},
};
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "report",
description: "Report a bug of the bot",
category: "Utilities",
options: [
{
type: 3,
name: "bug",
description: "The bug you want to report",
required: true,
},
],
run: async (client, interaction, args) => {
interaction.followUp({
embeds: [
new EmbedBuilder()
.setTitle("SUCCESS!")
.setDescription(
"You have reported a bug.\nPlease wait for us to solve it"
)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp()
.setColor("Green"),
],
});
client.channels.cache.get(client.config.Report).send({
embeds: [
new EmbedBuilder()
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
})
.setTitle("New Bug")
.setDescription(args[0])
.setColor("Orange")
.setTimestamp(),
],
});
},
};

View file

@ -1,44 +1,44 @@
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "suggest",
description: "Make a suggestion of the bot",
category: "Utilities",
options: [
{
type: 3,
name: "suggestion",
description: "The suggestion",
required: true,
},
],
run: async (client, interaction, args) => {
client.channels.cache.get(client.config.Suggestion).send({
embeds: [
new EmbedBuilder()
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
})
.setTitle("New Suggestion")
.setDescription(args[0])
.setColor("Orange")
.setTimestamp(),
],
});
interaction.followUp({
embeds: [
new EmbedBuilder()
.setTitle("SUCCESS!")
.setDescription(
"You have sent a suggestion.\nPlease wait for us to review it"
)
.setColor("Green")
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp(),
],
});
},
};
const { EmbedBuilder } = require("discord.js");
module.exports = {
name: "suggest",
description: "Make a suggestion of the bot",
category: "Utilities",
options: [
{
type: 3,
name: "suggestion",
description: "The suggestion",
required: true,
},
],
run: async (client, interaction, args) => {
client.channels.cache.get(client.config.Suggestion).send({
embeds: [
new EmbedBuilder()
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
})
.setTitle("New Suggestion")
.setDescription(args[0])
.setColor("Orange")
.setTimestamp(),
],
});
interaction.followUp({
embeds: [
new EmbedBuilder()
.setTitle("SUCCESS!")
.setDescription(
"You have sent a suggestion.\nPlease wait for us to review it"
)
.setColor("Green")
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp(),
],
});
},
};

View file

@ -1,13 +1,13 @@
module.exports = {
prefix: "C.",
URL: "https://night0721.me/",
color: "ff3636",
Suggestion: "853319776034226186",
Report: "853319776034226186",
Welcome: "837913442228371456",
DMLog: "900549765534736394",
CMDLog: "848613827226239046",
ErrorLog: "938538311537012796",
ServerLog: "848613714537873518",
ScamLinkLog: "936986641585799178",
};
module.exports = {
prefix: "C.",
URL: "https://night0721.me/",
color: "ff3636",
Suggestion: "853319776034226186",
Report: "853319776034226186",
Welcome: "837913442228371456",
DMLog: "900549765534736394",
CMDLog: "848613827226239046",
ErrorLog: "938538311537012796",
ServerLog: "848613714537873518",
ScamLinkLog: "936986641585799178",
};

View file

@ -1,75 +1,75 @@
const client = require("../");
const { EmbedBuilder } = require("discord.js");
const { Welcome } = require("../config");
client.on("guildMemberAdd", async member => {
const channel = member.guild.channels.cache.find(
channel => channel.id == Welcome
);
if (!channel) return;
channel.send({
embeds: [
new EmbedBuilder()
.setTitle(
`<:join:897246825122254848> Hello ${member}, Welcome to NYX's Support Server!`
)
.setThumbnail(
member.user.displayAvatarURL({ dynamic: true, size: 512 })
)
.addFields(
{
name: "Read Rules",
value: `<#799074874513555496>`,
inline: true,
},
{
name: "Support Channel",
value: `<#837865823225511946>`,
inline: true,
},
{
name: "FAQ",
value: `<#897345265516822558>`,
inline: true,
},
{
name: "Badge",
value: `<#897345265516822558>`,
inline: true,
},
{
name: "User ID:",
value: `\`\`\`\n${member.id}\n\`\`\``,
inline: true,
}
)
.setFooter({
text: `${member.user.tag} joined the server!`,
iconURL: member.user.displayAvatarURL({ dynamic: true }),
})
.setColor(client.color)
.setTimestamp(),
],
});
});
client.on("guildMemberRemove", async member => {
const channel = member.guild.channels.cache.find(
channel => channel.id == Welcome
);
if (!channel) return;
channel.send({
embeds: [
new EmbedBuilder()
.setTitle(
`<:leave:897246828045680640> ${member.user.username} can't handle being cool! `
)
.setThumbnail(member.guild.iconURL({ dynamic: true }))
.setDescription(`We now only have ${member.guild.memberCount} members`)
.setFooter({
text: `${member.user.tag} left the server!`,
iconURL: member.user.displayAvatarURL({ dynamic: true }),
})
.setColor(client.color)
.setTimestamp(),
],
});
});
const client = require("../");
const { EmbedBuilder } = require("discord.js");
const { Welcome } = require("../config");
client.on("guildMemberAdd", async member => {
const channel = member.guild.channels.cache.find(
channel => channel.id == Welcome
);
if (!channel) return;
channel.send({
embeds: [
new EmbedBuilder()
.setTitle(
`<:join:897246825122254848> Hello ${member}, Welcome to NYX's Support Server!`
)
.setThumbnail(
member.user.displayAvatarURL({ dynamic: true, size: 512 })
)
.addFields(
{
name: "Read Rules",
value: `<#799074874513555496>`,
inline: true,
},
{
name: "Support Channel",
value: `<#837865823225511946>`,
inline: true,
},
{
name: "FAQ",
value: `<#897345265516822558>`,
inline: true,
},
{
name: "Badge",
value: `<#897345265516822558>`,
inline: true,
},
{
name: "User ID:",
value: `\`\`\`\n${member.id}\n\`\`\``,
inline: true,
}
)
.setFooter({
text: `${member.user.tag} joined the server!`,
iconURL: member.user.displayAvatarURL({ dynamic: true }),
})
.setColor(client.color)
.setTimestamp(),
],
});
});
client.on("guildMemberRemove", async member => {
const channel = member.guild.channels.cache.find(
channel => channel.id == Welcome
);
if (!channel) return;
channel.send({
embeds: [
new EmbedBuilder()
.setTitle(
`<:leave:897246828045680640> ${member.user.username} can't handle being cool! `
)
.setThumbnail(member.guild.iconURL({ dynamic: true }))
.setDescription(`We now only have ${member.guild.memberCount} members`)
.setFooter({
text: `${member.user.tag} left the server!`,
iconURL: member.user.displayAvatarURL({ dynamic: true }),
})
.setColor(client.color)
.setTimestamp(),
],
});
});

View file

@ -1,55 +1,55 @@
const client = require("../");
client.on("messageCreate", async message => {
function Check(str) {
if (
client.emojis.cache.find(emoji => emoji.name === str) ||
message.guild.emojis.cache.find(emoji => emoji.name === str)
) {
return true;
} else {
return false;
}
}
if (message.content.startsWith(":") && message.content.endsWith(":")) {
const EmojiName = message.content.slice(1, -1);
if (client.path.includes(message.guild.id)) return;
if (Check(EmojiName)) {
const channel = client.channels.cache.get(message.channel.id);
try {
if (message.author.bot) return;
const webhooks = await channel.fetchWebhooks();
const webhook = webhooks.first();
if (webhook === undefined || null || !webhook) {
channel
.createWebhook(client.user.username, {
avatar: client.user.displayAvatarURL({ dynamic: true }),
})
.then(async w => {
const emoji =
client.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)}`, {
username: message.member.displayName
? message.member.displayName
: message.author.username,
avatarURL: message.author.displayAvatarURL({ dynamic: true }),
});
message.delete();
});
}
const emoji =
client.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), {
username: message.author.username,
avatarURL: message.author.displayAvatarURL({ dynamic: true }),
});
message.delete();
} catch (e) {
console.log(e);
}
}
}
});
const client = require("../");
client.on("messageCreate", async message => {
function Check(str) {
if (
client.emojis.cache.find(emoji => emoji.name === str) ||
message.guild.emojis.cache.find(emoji => emoji.name === str)
) {
return true;
} else {
return false;
}
}
if (message.content.startsWith(":") && message.content.endsWith(":")) {
const EmojiName = message.content.slice(1, -1);
if (client.path.includes(message.guild.id)) return;
if (Check(EmojiName)) {
const channel = client.channels.cache.get(message.channel.id);
try {
if (message.author.bot) return;
const webhooks = await channel.fetchWebhooks();
const webhook = webhooks.first();
if (webhook === undefined || null || !webhook) {
channel
.createWebhook(client.user.username, {
avatar: client.user.displayAvatarURL({ dynamic: true }),
})
.then(async w => {
const emoji =
client.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)}`, {
username: message.member.displayName
? message.member.displayName
: message.author.username,
avatarURL: message.author.displayAvatarURL({ dynamic: true }),
});
message.delete();
});
}
const emoji =
client.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), {
username: message.author.username,
avatarURL: message.author.displayAvatarURL({ dynamic: true }),
});
message.delete();
} catch (e) {
console.log(e);
}
}
}
});

View file

@ -1,62 +1,62 @@
const client = require("../");
const { EmbedBuilder } = require("discord.js");
const db = require("../models/guilds");
client.on("guildCreate", guild => {
client.channels.cache.get(client.config.ServerLog).send({
embeds: [
new EmbedBuilder()
.setTitle("New Server")
.addFields({
name: "Server Info",
value: `**>Server Name**: \n${guild.name}
**>Server ID**: \n${guild.id}
**>Server Member Count**: \n${guild.memberCount}`,
})
.setFooter({
text: `${client.user.username} Currently in ${client.guilds.cache.size} servers`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp()
.setThumbnail(guild.iconURL({ dynamic: true }))
.setColor("Green"),
],
});
const newdb = new db({
Guild: guild.id,
Prefix: client.config.prefix,
});
newdb.save();
});
client.on("guildDelete", async guild => {
client.data.DelGuild(guild.id);
client.channels.cache.get(client.config.ServerLog).send({
embeds: [
new EmbedBuilder()
.setTitle("Deleted Server")
.addFields({
name: "Server Info",
value: `**>Server Name**: \n${guild.name}
**>Server ID**: \n${guild.id}
**>Server Member Count**: \n${guild.memberCount}`,
})
.setFooter({
text: `${client.user.username} Currently in ${client.guilds.cache.size} servers`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp()
.setThumbnail(guild.iconURL({ dynamic: true }))
.setColor("Red"),
],
});
});
client.prefix = async function (message) {
let custom;
if (!message.guild) return;
const data = await db
.findOne({ Guild: message.guild.id })
.catch(err => console.log(err));
if (data) custom = data.Prefix;
else custom = client.config.prefix;
return custom;
};
const client = require("../");
const { EmbedBuilder } = require("discord.js");
const db = require("../models/guilds");
client.on("guildCreate", guild => {
client.channels.cache.get(client.config.ServerLog).send({
embeds: [
new EmbedBuilder()
.setTitle("New Server")
.addFields({
name: "Server Info",
value: `**>Server Name**: \n${guild.name}
**>Server ID**: \n${guild.id}
**>Server Member Count**: \n${guild.memberCount}`,
})
.setFooter({
text: `${client.user.username} Currently in ${client.guilds.cache.size} servers`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp()
.setThumbnail(guild.iconURL({ dynamic: true }))
.setColor("Green"),
],
});
const newdb = new db({
Guild: guild.id,
Prefix: client.config.prefix,
});
newdb.save();
});
client.on("guildDelete", async guild => {
client.data.DelGuild(guild.id);
client.channels.cache.get(client.config.ServerLog).send({
embeds: [
new EmbedBuilder()
.setTitle("Deleted Server")
.addFields({
name: "Server Info",
value: `**>Server Name**: \n${guild.name}
**>Server ID**: \n${guild.id}
**>Server Member Count**: \n${guild.memberCount}`,
})
.setFooter({
text: `${client.user.username} Currently in ${client.guilds.cache.size} servers`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp()
.setThumbnail(guild.iconURL({ dynamic: true }))
.setColor("Red"),
],
});
});
client.prefix = async function (message) {
let custom;
if (!message.guild) return;
const data = await db
.findOne({ Guild: message.guild.id })
.catch(err => console.log(err));
if (data) custom = data.Prefix;
else custom = client.config.prefix;
return custom;
};

View file

@ -1,182 +1,182 @@
const client = require("../");
const cooldown = require("../models/cooldown");
const utils = require("../util/functions/function");
const { EmbedBuilder } = require("discord.js");
client.on("interactionCreate", async interaction => {
if (interaction.isCommand()) {
await interaction.deferReply({ ephemeral: false }).catch(() => {});
const cmd = client.slashCommands.get(interaction.commandName);
if (!cmd) return;
const args = [];
for (const option of interaction.options.data) {
if (option.type === 2) {
if (option.name) args.push(option.name);
option.options?.forEach(x => {
if (x.type === 1) {
if (x.name) args.push(x.name);
x.options?.forEach(y => {
if (y.value) args.push(y.value);
});
} else if (x.value) {
args.push(x.value);
}
if (x.value) args.push(x.value);
});
}
if (option.type === 1) {
if (option.name) args.push(option.name);
option.options?.forEach(x => {
if (x.value) args.push(x.value);
});
} else if (option.value) {
args.push(option.value);
}
}
interaction.member = interaction.guild.members.cache.get(
interaction.user.id
);
const data = {};
const guildDB = await client.data.getGuild(interaction.guild.id);
if (!guildDB) return;
const userDB = await client.data.getUser(interaction.user.id);
if (!userDB) return;
data.Guild = guildDB;
data.User = userDB;
if (!guildDB) await client.data.CreateGuild(interaction.guild.id);
if (data.User?.Blacklist)
return interaction.followUp({
content:
"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.Premium && !data.User.Premium) {
return interaction.followUp({
embeds: [
new EmbedBuilder()
.setURL(client.web)
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
})
.setColor(client.color)
.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`
)
.setTimestamp()
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
}),
],
});
}
if (data.Guild?.Category) {
if (data.Guild.Category.includes(cmd.directory)) {
return interaction.followUp({
content: "This command has been disabled in this server",
});
}
}
if (data.Guild?.Commands) {
if (data.Guild.Commands.includes(cmd.name)) {
return interaction.followUp({
content: "This command has been disabled in this server",
});
}
}
if (cmd.timeout) {
const current_time = Date.now();
const cooldown_amount = cmd.timeout;
cooldown.findOne(
{ User: interaction.user.id, CMD: cmd.name },
async (er, d) => {
if (d) {
const expiration_time = d.Time + cooldown_amount;
if (current_time < expiration_time) {
if (data.Guild.Tips) utils.tips(interaction, client);
utils.cooldown(d.Time, cooldown_amount, interaction);
} else {
if (data.Guild.Tips) utils.tips(interaction, client);
await cooldown.findOneAndUpdate(
{ User: interaction.user.id, CMD: cmd.name },
{ Time: current_time }
);
cmd
.run(client, interaction, args, utils, data)
.catch(e => sendE(e, interaction));
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})\``,
});
}
} else {
if (data.Guild.Tips) utils.tips(interaction, client);
cmd
.run(client, interaction, args, utils, data)
.catch(e => sendE(e, interaction));
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})\``,
});
new cooldown({
User: interaction.user.id,
CMD: cmd.name,
Time: current_time,
Cooldown: cmd.timeout,
}).save();
}
}
);
} else {
if (data.Guild.Tips) utils.tips(interaction, client);
cmd
.run(client, interaction, args, utils, data)
.catch(e => sendE(e, interaction));
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})\``,
});
}
}
if (interaction.isContextMenuCommand()) {
await interaction.deferReply({ ephemeral: false });
const command = client.slashCommands.get(interaction.commandName);
if (command) command.run(client, interaction);
}
});
client.on("interactionCreate", async interaction => {
if (interaction.isCommand()) {
await interaction.deferReply({ ephemeral: false }).catch(() => {});
const ownercmd = client.hide.get(interaction.commandName);
if (!ownercmd) return;
const args = [];
for (const option of interaction.options.data) {
if (option.type === 1) {
if (option.name) args.push(option.name);
option.options?.forEach(x => {
if (x.value) args.push(x.value);
});
} else if (option.value) {
args.push(option.value);
}
}
interaction.member = interaction.guild.members.cache.get(
interaction.user.id
);
ownercmd
.run(client, interaction, args, utils)
.catch(e => sendE(e, interaction));
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})\``,
});
}
});
function sendE(e, i) {
console.error(e.stack);
const embed = new EmbedBuilder()
.setTitle("Command Error")
.setDescription(`\`\`\`yaml\n${e.stack}\`\`\``)
.setTimestamp()
.setColor(client.color)
.setFooter({ text: client.user.username });
i.channel.send({ embeds: [embed] });
client.channels.cache.get(client.config.ErrorLog).send({ embeds: [embed] });
}
const client = require("../");
const cooldown = require("../models/cooldown");
const utils = require("../util/functions/function");
const { EmbedBuilder } = require("discord.js");
client.on("interactionCreate", async interaction => {
if (interaction.isCommand()) {
await interaction.deferReply({ ephemeral: false }).catch(() => {});
const cmd = client.slashCommands.get(interaction.commandName);
if (!cmd) return;
const args = [];
for (const option of interaction.options.data) {
if (option.type === 2) {
if (option.name) args.push(option.name);
option.options?.forEach(x => {
if (x.type === 1) {
if (x.name) args.push(x.name);
x.options?.forEach(y => {
if (y.value) args.push(y.value);
});
} else if (x.value) {
args.push(x.value);
}
if (x.value) args.push(x.value);
});
}
if (option.type === 1) {
if (option.name) args.push(option.name);
option.options?.forEach(x => {
if (x.value) args.push(x.value);
});
} else if (option.value) {
args.push(option.value);
}
}
interaction.member = interaction.guild.members.cache.get(
interaction.user.id
);
const data = {};
const guildDB = await client.data.getGuild(interaction.guild.id);
if (!guildDB) return;
const userDB = await client.data.getUser(interaction.user.id);
if (!userDB) return;
data.Guild = guildDB;
data.User = userDB;
if (!guildDB) await client.data.CreateGuild(interaction.guild.id);
if (data.User?.Blacklist)
return interaction.followUp({
content:
"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.Premium && !data.User.Premium) {
return interaction.followUp({
embeds: [
new EmbedBuilder()
.setURL(client.web)
.setAuthor({
name: interaction.user.tag,
iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
})
.setColor(client.color)
.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`
)
.setTimestamp()
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
}),
],
});
}
if (data.Guild?.Category) {
if (data.Guild.Category.includes(cmd.directory)) {
return interaction.followUp({
content: "This command has been disabled in this server",
});
}
}
if (data.Guild?.Commands) {
if (data.Guild.Commands.includes(cmd.name)) {
return interaction.followUp({
content: "This command has been disabled in this server",
});
}
}
if (cmd.timeout) {
const current_time = Date.now();
const cooldown_amount = cmd.timeout;
cooldown.findOne(
{ User: interaction.user.id, CMD: cmd.name },
async (er, d) => {
if (d) {
const expiration_time = d.Time + cooldown_amount;
if (current_time < expiration_time) {
if (data.Guild.Tips) utils.tips(interaction, client);
utils.cooldown(d.Time, cooldown_amount, interaction);
} else {
if (data.Guild.Tips) utils.tips(interaction, client);
await cooldown.findOneAndUpdate(
{ User: interaction.user.id, CMD: cmd.name },
{ Time: current_time }
);
cmd
.run(client, interaction, args, utils, data)
.catch(e => sendE(e, interaction));
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})\``,
});
}
} else {
if (data.Guild.Tips) utils.tips(interaction, client);
cmd
.run(client, interaction, args, utils, data)
.catch(e => sendE(e, interaction));
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})\``,
});
new cooldown({
User: interaction.user.id,
CMD: cmd.name,
Time: current_time,
Cooldown: cmd.timeout,
}).save();
}
}
);
} else {
if (data.Guild.Tips) utils.tips(interaction, client);
cmd
.run(client, interaction, args, utils, data)
.catch(e => sendE(e, interaction));
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})\``,
});
}
}
if (interaction.isContextMenuCommand()) {
await interaction.deferReply({ ephemeral: false });
const command = client.slashCommands.get(interaction.commandName);
if (command) command.run(client, interaction);
}
});
client.on("interactionCreate", async interaction => {
if (interaction.isCommand()) {
await interaction.deferReply({ ephemeral: false }).catch(() => {});
const ownercmd = client.hide.get(interaction.commandName);
if (!ownercmd) return;
const args = [];
for (const option of interaction.options.data) {
if (option.type === 1) {
if (option.name) args.push(option.name);
option.options?.forEach(x => {
if (x.value) args.push(x.value);
});
} else if (option.value) {
args.push(option.value);
}
}
interaction.member = interaction.guild.members.cache.get(
interaction.user.id
);
ownercmd
.run(client, interaction, args, utils)
.catch(e => sendE(e, interaction));
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})\``,
});
}
});
function sendE(e, i) {
console.error(e.stack);
const embed = new EmbedBuilder()
.setTitle("Command Error")
.setDescription(`\`\`\`yaml\n${e.stack}\`\`\``)
.setTimestamp()
.setColor(client.color)
.setFooter({ text: client.user.username });
i.channel.send({ embeds: [embed] });
client.channels.cache.get(client.config.ErrorLog).send({ embeds: [embed] });
}

View file

@ -1,245 +1,245 @@
const client = require("..");
const { EmbedBuilder, ChannelType } = require("discord.js");
const Utils = require("../util/functions/function");
const domains = require("../util/Data/domains.json");
client.on("messageCreate", async message => {
if (message.author.bot || !message.guild) return;
const data = {};
const guildDB = await client.data.getGuild(message.guild.id);
if (!guildDB) return;
const userDB = await client.data.getUser(message.author?.id);
if (!userDB) return;
data.Guild = guildDB;
data.User = userDB;
if (!guildDB) await client.data.CreateGuild(message.guild.id);
if (message.content.match(new RegExp(`^<@!?${client.user.id}>( |)$`))) {
const _ = new EmbedBuilder()
.addFields(
{
name: "Prefix/Usage",
value: "Run `/help` to start using the bot",
inline: true,
},
{
name: ":link: **Invite Me**",
value: `[Click Here](${Utils.inviteLink(client)})`,
inline: true,
},
{
name: "<:support1:867093614403256350> **Need Help ?**",
value: `Join our [Support Server](https://discord.gg/SbQHChmGcp)`,
inline: true,
},
{
name: "<:YouTube:841186450497339412> **Video Guide**",
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
inline: true,
},
{
name: `<:nyx_description:897379659665264650> Documentation`,
value: `[Click here](${client.docs})`,
inline: true,
},
{
name: "<a:donate:896985486260846614> **Support us**",
value: `[KoFi](https://ko-fi.com/cathteam)`,
inline: true,
},
{
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.`,
inline: false,
}
)
.setTitle(client.user.username)
.setThumbnail(client.user.displayAvatarURL({ dynamic: true }))
.setURL(client.web)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp()
.setColor(client.color);
try {
const m = await message.reply({
embeds: [_],
components: Utils.buttons(client),
});
setTimeout(() => m.delete(), 15000);
} catch (_) {}
}
if (data.User?.Blacklist) return;
try {
if (
domains.iplogger.includes(
message.content
.toLowerCase()
.match(
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
)?.[0]
.replace(/(https|http):\/\/+/g, "")
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
.slice(0, -1)
) ||
domains.scam.includes(
message.content
.toLowerCase()
.match(
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
)?.[0]
.replace(/(https|http):\/\/+/g, "")
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
.slice(0, -1)
) ||
domains.ngrok.includes(
message.content
.toLowerCase()
.match(
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
)?.[0]
.replace(/(https|http):\/\/+/g, "")
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
.slice(0, -1)
)
) {
const _ = new EmbedBuilder()
.setTitle(`Scam/IP Grabber detected`)
.setTimestamp()
.setColor(client.color)
.addFields(
{
name: "User",
value: `${message.author.tag} (${message.author.id})`,
inline: true,
},
{
name: "Scam/IP Logger URL",
value: `||https://${message.content
.toLowerCase()
.match(
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
)?.[0]
.replace(/(https|http):\/\/+/g, "")
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
.slice(0, -1)}||`,
inline: true,
}
)
.setFooter({
text: `Tactical Protection by ${client.author}`,
icon_url: client.user.displayAvatarURL({ dynamic: true }),
});
message.channel.send({
embeds: [_],
});
client.channels.cache.get(client.config.ScamLinkLog).send({
embeds: [
_.addFields(
{
name: "Message",
value: message.content,
inline: false,
},
{
name: "Guild",
value: message.guild ? message.guild.name : "None",
inline: true,
}
),
],
});
message.delete().catch(() => {});
}
} catch (_) {}
if (
message?.content.startsWith(data.Guild.Prefix) ||
message?.content.toLowerCase().startsWith("c.")
) {
const embed = new EmbedBuilder()
.setTitle(`Message commands are now disabled`)
.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`
)
.setColor(client.color)
.setThumbnail(message.guild.iconURL({ dynamic: true }))
.addFields(
{
name: ":link: **Invite Me**",
value: `[Click Here](${Utils.inviteLink(client.user.id)})`,
inline: true,
},
{
name: "<:support1:867093614403256350> **Need Help ?**",
value: `Join our [Support Server](https://discord.gg/SbQHChmGcp)`,
inline: true,
},
{
name: "<:YouTube:841186450497339412> **Video Guide**",
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
inline: true,
},
{
name: `<:nyx_description:897379659665264650> Documentation`,
value: `[Click here](${client.docs})`,
inline: true,
},
{
name: "<a:donate:896985486260846614> **Support us**",
value: `[KoFi](https://ko-fi.com/cathteam)`,
inline: true,
},
{
name: "<a:booster:896527475063025704> **Premium**",
value: `You can either boost support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team.`,
inline: false,
}
)
.setURL(client.web)
.setFooter({
text: `Requested by ${message.author.tag}`,
iconURL: message.author.displayAvatarURL({ dynamic: true }),
})
.setThumbnail(
"https://raw.githubusercontent.com/night0721/cath.exe/main/util/assets/images/nyx_logo_transparent.webp"
)
.setTimestamp();
message.reply({
embeds: [embed],
components: Utils.buttons(client),
});
}
});
client.on("messageCreate", async message => {
if (message.channel.type === ChannelType.DM && !message.author.bot) {
if (message.attachments && message?.content) {
message.attachments.map(e =>
client.channels.cache.get(client.config.DMLog).send({
content: `\`${message.author.tag}(${message.author.id})\`: ${
message.content + e.url
}`,
})
);
} else {
message.attachments.map(e =>
client.channels.cache.get(client.config.DMLog).send({
content: `\`${message.author.tag}(${message.author.id})\`: ${e.url}`,
})
);
}
if (message.content) {
client.channels.cache.get(client.config.DMLog).send({
embeds: [
new EmbedBuilder()
.setDescription(message.content)
.setColor(client.color)
.setAuthor({
name: message.author.tag,
iconURL: message.author.displayAvatarURL({ dynamic: true }),
}),
],
});
}
}
});
const client = require("..");
const { EmbedBuilder, ChannelType } = require("discord.js");
const Utils = require("../util/functions/function");
const domains = require("../util/Data/domains.json");
client.on("messageCreate", async message => {
if (message.author.bot || !message.guild) return;
const data = {};
const guildDB = await client.data.getGuild(message.guild.id);
if (!guildDB) return;
const userDB = await client.data.getUser(message.author?.id);
if (!userDB) return;
data.Guild = guildDB;
data.User = userDB;
if (!guildDB) await client.data.CreateGuild(message.guild.id);
if (message.content.match(new RegExp(`^<@!?${client.user.id}>( |)$`))) {
const _ = new EmbedBuilder()
.addFields(
{
name: "Prefix/Usage",
value: "Run `/help` to start using the bot",
inline: true,
},
{
name: ":link: **Invite Me**",
value: `[Click Here](${Utils.inviteLink(client)})`,
inline: true,
},
{
name: "<:support1:867093614403256350> **Need Help ?**",
value: `Join our [Support Server](https://discord.gg/SbQHChmGcp)`,
inline: true,
},
{
name: "<:YouTube:841186450497339412> **Video Guide**",
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
inline: true,
},
{
name: `<:nyx_description:897379659665264650> Documentation`,
value: `[Click here](${client.docs})`,
inline: true,
},
{
name: "<a:donate:896985486260846614> **Support us**",
value: `[KoFi](https://ko-fi.com/cathteam)`,
inline: true,
},
{
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.`,
inline: false,
}
)
.setTitle(client.user.username)
.setThumbnail(client.user.displayAvatarURL({ dynamic: true }))
.setURL(client.web)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp()
.setColor(client.color);
try {
const m = await message.reply({
embeds: [_],
components: Utils.buttons(client),
});
setTimeout(() => m.delete(), 15000);
} catch (_) {}
}
if (data.User?.Blacklist) return;
try {
if (
domains.iplogger.includes(
message.content
.toLowerCase()
.match(
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
)?.[0]
.replace(/(https|http):\/\/+/g, "")
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
.slice(0, -1)
) ||
domains.scam.includes(
message.content
.toLowerCase()
.match(
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
)?.[0]
.replace(/(https|http):\/\/+/g, "")
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
.slice(0, -1)
) ||
domains.ngrok.includes(
message.content
.toLowerCase()
.match(
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
)?.[0]
.replace(/(https|http):\/\/+/g, "")
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
.slice(0, -1)
)
) {
const _ = new EmbedBuilder()
.setTitle(`Scam/IP Grabber detected`)
.setTimestamp()
.setColor(client.color)
.addFields(
{
name: "User",
value: `${message.author.tag} (${message.author.id})`,
inline: true,
},
{
name: "Scam/IP Logger URL",
value: `||https://${message.content
.toLowerCase()
.match(
/(https|http):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+~-]*[\w.,@?^=%&:/~+~-])+/g
)?.[0]
.replace(/(https|http):\/\/+/g, "")
.match(/\s*([^)]+?)\s*\/+/g, "")[0]
.slice(0, -1)}||`,
inline: true,
}
)
.setFooter({
text: `Tactical Protection by ${client.author}`,
icon_url: client.user.displayAvatarURL({ dynamic: true }),
});
message.channel.send({
embeds: [_],
});
client.channels.cache.get(client.config.ScamLinkLog).send({
embeds: [
_.addFields(
{
name: "Message",
value: message.content,
inline: false,
},
{
name: "Guild",
value: message.guild ? message.guild.name : "None",
inline: true,
}
),
],
});
message.delete().catch(() => {});
}
} catch (_) {}
if (
message?.content.startsWith(data.Guild.Prefix) ||
message?.content.toLowerCase().startsWith("c.")
) {
const embed = new EmbedBuilder()
.setTitle(`Message commands are now disabled`)
.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`
)
.setColor(client.color)
.setThumbnail(message.guild.iconURL({ dynamic: true }))
.addFields(
{
name: ":link: **Invite Me**",
value: `[Click Here](${Utils.inviteLink(client.user.id)})`,
inline: true,
},
{
name: "<:support1:867093614403256350> **Need Help ?**",
value: `Join our [Support Server](https://discord.gg/SbQHChmGcp)`,
inline: true,
},
{
name: "<:YouTube:841186450497339412> **Video Guide**",
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
inline: true,
},
{
name: `<:nyx_description:897379659665264650> Documentation`,
value: `[Click here](${client.docs})`,
inline: true,
},
{
name: "<a:donate:896985486260846614> **Support us**",
value: `[KoFi](https://ko-fi.com/cathteam)`,
inline: true,
},
{
name: "<a:booster:896527475063025704> **Premium**",
value: `You can either boost support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team.`,
inline: false,
}
)
.setURL(client.web)
.setFooter({
text: `Requested by ${message.author.tag}`,
iconURL: message.author.displayAvatarURL({ dynamic: true }),
})
.setThumbnail(
"https://raw.githubusercontent.com/night0721/cath.exe/main/util/assets/images/nyx_logo_transparent.webp"
)
.setTimestamp();
message.reply({
embeds: [embed],
components: Utils.buttons(client),
});
}
});
client.on("messageCreate", async message => {
if (message.channel.type === ChannelType.DM && !message.author.bot) {
if (message.attachments && message?.content) {
message.attachments.map(e =>
client.channels.cache.get(client.config.DMLog).send({
content: `\`${message.author.tag}(${message.author.id})\`: ${
message.content + e.url
}`,
})
);
} else {
message.attachments.map(e =>
client.channels.cache.get(client.config.DMLog).send({
content: `\`${message.author.tag}(${message.author.id})\`: ${e.url}`,
})
);
}
if (message.content) {
client.channels.cache.get(client.config.DMLog).send({
embeds: [
new EmbedBuilder()
.setDescription(message.content)
.setColor(client.color)
.setAuthor({
name: message.author.tag,
iconURL: message.author.displayAvatarURL({ dynamic: true }),
}),
],
});
}
}
});

View file

@ -1,4 +1,4 @@
const client = require("..");
client.on("ready", async () => {
console.log(`${client.user.username}`);
});
const client = require("..");
client.on("ready", async () => {
console.log(`${client.user.username}`);
});

View file

@ -1,15 +1,15 @@
const { ChannelType } = require("discord.js");
const client = require("..");
client.on("typingStart", async typing => {
if (
!typing.user ||
typing.user.bot ||
!typing.channel ||
typing.channel.type != ChannelType.DM
)
return;
typing.user.send({
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]```",
});
});
const { ChannelType } = require("discord.js");
const client = require("..");
client.on("typingStart", async typing => {
if (
!typing.user ||
typing.user.bot ||
!typing.channel ||
typing.channel.type != ChannelType.DM
)
return;
typing.user.send({
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]```",
});
});

View file

@ -1,5 +1,5 @@
const NYX = require("./client/NYX");
const client = new NYX();
module.exports = client;
process.on("unhandledRejection", () => {}); // add // when need to debug
client.start();
const NYX = require("./client/NYX");
const client = new NYX();
module.exports = client;
process.on("unhandledRejection", () => {}); // add // when need to debug
client.start();

View file

@ -1,22 +1,22 @@
const { Schema, model } = require("mongoose");
module.exports = model(
"cooldown",
new Schema({
User: {
type: String,
required: true,
},
CMD: {
type: String,
default: "",
},
Time: {
type: Number,
default: 0,
},
Cooldown: {
type: Number,
default: 0,
},
})
);
const { Schema, model } = require("mongoose");
module.exports = model(
"cooldown",
new Schema({
User: {
type: String,
required: true,
},
CMD: {
type: String,
default: "",
},
Time: {
type: Number,
default: 0,
},
Cooldown: {
type: Number,
default: 0,
},
})
);

View file

@ -1,28 +1,28 @@
const mongoose = require("mongoose");
const prefix = require("../config").prefix;
module.exports = mongoose.model(
"guild",
new mongoose.Schema({
Guild: String,
Prefix: {
type: String,
default: prefix,
},
Premium: {
type: Boolean,
default: false,
},
Category: {
type: Array,
default: [],
},
Commands: {
type: Array,
default: [],
},
Tips: {
type: Boolean,
default: true,
},
})
);
const mongoose = require("mongoose");
const prefix = require("../config").prefix;
module.exports = mongoose.model(
"guild",
new mongoose.Schema({
Guild: String,
Prefix: {
type: String,
default: prefix,
},
Premium: {
type: Boolean,
default: false,
},
Category: {
type: Array,
default: [],
},
Commands: {
type: Array,
default: [],
},
Tips: {
type: Boolean,
default: true,
},
})
);

View file

@ -1,31 +1,31 @@
const mongoose = require("mongoose");
module.exports = mongoose.model(
"user",
new mongoose.Schema({
User: String,
Tier: {
type: Number,
default: 0,
},
Premium: {
type: Boolean,
default: false,
},
Blacklist: {
type: Boolean,
default: false,
},
Blacklist_Reason: {
type: String,
default: "null",
},
PremiumServers: {
type: Array,
default: [],
},
CommandUsed: {
type: Number,
default: 0,
},
})
);
const mongoose = require("mongoose");
module.exports = mongoose.model(
"user",
new mongoose.Schema({
User: String,
Tier: {
type: Number,
default: 0,
},
Premium: {
type: Boolean,
default: false,
},
Blacklist: {
type: Boolean,
default: false,
},
Blacklist_Reason: {
type: String,
default: "null",
},
PremiumServers: {
type: Array,
default: [],
},
CommandUsed: {
type: Number,
default: 0,
},
})
);

View file

@ -1,32 +1,32 @@
// Do we still need this ?
const mongoose = require("mongoose");
module.exports = mongoose.model(
"weapons",
new mongoose.Schema({
Categories: {
type: Array,
default: [],
},
Primary: {
type: Array,
default: [],
},
Secondary: {
type: Array,
default: [],
},
Equipment: {
type: Array,
default: [],
},
OperatorSkill: {
type: Array,
default: [],
},
Perk: {
type: Array,
default: [],
},
})
);
// Do we still need this ?
const mongoose = require("mongoose");
module.exports = mongoose.model(
"weapons",
new mongoose.Schema({
Categories: {
type: Array,
default: [],
},
Primary: {
type: Array,
default: [],
},
Secondary: {
type: Array,
default: [],
},
Equipment: {
type: Array,
default: [],
},
OperatorSkill: {
type: Array,
default: [],
},
Perk: {
type: Array,
default: [],
},
})
);

View file

@ -1,50 +1,50 @@
{
"name": "cath.exe",
"version": "0.0.1",
"description": "NYX bot created by Team NYX",
"engines": {
"node": "*",
"npm": "*"
},
"main": "index.js",
"scripts": {
"dev": "node . --dev",
"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-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"
},
"repository": {
"type": "git",
"url": "git+https://github.com/night0721/cath.exe.git"
},
"keywords": [
"bot",
"nyx",
"codm",
"discord",
"gunsmith"
],
"author": "Ń1ght#0001",
"license": "CC-BY-NC-SA-4.0",
"bugs": {
"url": "https://github.com/night0721/cath.exe/issues"
},
"homepage": "https://github.com/night0721/cath.exe#readme",
"funding": {
"type": "individual",
"url": "https://ko-fi.com/cathteam"
},
"devDependencies": {
"node": "^19.0.0"
},
"dependencies": {
"axios": "^1.1.3",
"cath": "^1.5.13",
"discord.js": "^14.9.0",
"dotenv": "^16.0.3",
"goosecache": "^9.0.14",
"mongoose": "^5.13.14",
"quickchart-js": "^3.1.0"
}
}
{
"name": "cath.exe",
"version": "0.0.1",
"description": "NYX bot created by Team NYX",
"engines": {
"node": "*",
"npm": "*"
},
"main": "index.js",
"scripts": {
"dev": "node . --dev",
"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-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"
},
"repository": {
"type": "git",
"url": "git+https://github.com/night0721/cath.exe.git"
},
"keywords": [
"bot",
"nyx",
"codm",
"discord",
"gunsmith"
],
"author": "Ń1ght#0001",
"license": "CC-BY-NC-SA-4.0",
"bugs": {
"url": "https://github.com/night0721/cath.exe/issues"
},
"homepage": "https://github.com/night0721/cath.exe#readme",
"funding": {
"type": "individual",
"url": "https://ko-fi.com/cathteam"
},
"devDependencies": {
"node": "^19.0.0"
},
"dependencies": {
"axios": "^1.1.3",
"cath": "^1.5.13",
"discord.js": "^14.9.0",
"dotenv": "^16.0.3",
"goosecache": "^9.0.14",
"mongoose": "^5.13.14",
"quickchart-js": "^3.1.0"
}
}

View file

@ -1,78 +1,78 @@
const { EmbedBuilder } = require("discord.js"); //@night0721 You need to make this
const items = require("../../util/Data/loadout.json");
module.exports = {
name: "class",
description: "Generate A Random Loadout",
category: "CODM",
run: async (client, interaction) => {
// const data = async () => {
// const d = await model.findOne({});
// const types = d.Categories;
// const names = d.Primary;
// const category = types[Math.floor(Math.random() * types.length)];
// const weapons = names[0][category];
// return `${weapons[Math.floor(Math.random() * weapons.length)]}`;
// };
// const primary_weapon = await data();
// const primary = primary_weapon.replace(/[ -]/g, "_").replace(/\./g, "");
// const slots = shuffle(Object.keys(Attachments[primary][0]));
// const slot_1 = slots.next().value,
// slot_2 = slots.next().value,
// slot_3 = slots.next().value,
// slot_4 = slots.next().value,
// slot_5 = slots.next().value;
const result = new EmbedBuilder()
.setColor(client.color)
.setFooter({ text: `Made by ${client.author}` })
.setURL(client.web)
.setTitle(`🎲 A Randomly Generated Loadout 🎲`)
.setDescription(
`This loadout is a randomly generated, Also try, \`/class\` to get a randomally generated primary weapon gunsmith build`
)
.addFields(
{
name: `Secondary Weapon`,
value: ``,
inline: true,
},
{
name: `Operator Skill`,
value: ``,
inline: true,
},
{
name: `Scorestreak`, // 3 perks
value: ``,
inline: true,
},
{
name: `🔴 Red Perk`,
value: ``,
inline: true,
},
{
name: `🟢 Green Perk`,
value: ``,
inline: true,
},
{
name: `🔵 Blue Perk`,
value: ``,
inline: true,
}
)
.setTimestamp();
interaction.followUp({ embeds: [result] });
// function* shuffle(array) {
// let i = array.length;
// while (i--) {
// yield array.splice(Math.floor(Math.random() * (i + 1)), 1)[0];
// }
// }
// function getAttachment(gun, slot) {
// const ca = Attachments[gun][0][slot];
// return ca[Math.floor(Math.random() * ca.length)];
// }
},
};
const { EmbedBuilder } = require("discord.js"); //@night0721 You need to make this
const items = require("../../util/Data/loadout.json");
module.exports = {
name: "class",
description: "Generate A Random Loadout",
category: "CODM",
run: async (client, interaction) => {
// const data = async () => {
// const d = await model.findOne({});
// const types = d.Categories;
// const names = d.Primary;
// const category = types[Math.floor(Math.random() * types.length)];
// const weapons = names[0][category];
// return `${weapons[Math.floor(Math.random() * weapons.length)]}`;
// };
// const primary_weapon = await data();
// const primary = primary_weapon.replace(/[ -]/g, "_").replace(/\./g, "");
// const slots = shuffle(Object.keys(Attachments[primary][0]));
// const slot_1 = slots.next().value,
// slot_2 = slots.next().value,
// slot_3 = slots.next().value,
// slot_4 = slots.next().value,
// slot_5 = slots.next().value;
const result = new EmbedBuilder()
.setColor(client.color)
.setFooter({ text: `Made by ${client.author}` })
.setURL(client.web)
.setTitle(`🎲 A Randomly Generated Loadout 🎲`)
.setDescription(
`This loadout is a randomly generated, Also try, \`/class\` to get a randomally generated primary weapon gunsmith build`
)
.addFields(
{
name: `Secondary Weapon`,
value: ``,
inline: true,
},
{
name: `Operator Skill`,
value: ``,
inline: true,
},
{
name: `Scorestreak`, // 3 perks
value: ``,
inline: true,
},
{
name: `🔴 Red Perk`,
value: ``,
inline: true,
},
{
name: `🟢 Green Perk`,
value: ``,
inline: true,
},
{
name: `🔵 Blue Perk`,
value: ``,
inline: true,
}
)
.setTimestamp();
interaction.followUp({ embeds: [result] });
// function* shuffle(array) {
// let i = array.length;
// while (i--) {
// yield array.splice(Math.floor(Math.random() * (i + 1)), 1)[0];
// }
// }
// function getAttachment(gun, slot) {
// const ca = Attachments[gun][0][slot];
// return ca[Math.floor(Math.random() * ca.length)];
// }
},
};

File diff suppressed because it is too large Load diff

View file

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

View file

@ -1,85 +1,85 @@
{
"weaponActualName": [
"Man-O-War",
"Peacekeeper MK2",
"Type 25",
"QQ9",
"Razorback",
".50 GS",
"Arctic .50",
"Kilo Bolt-Action",
"Fennec",
"FR .556",
"DR-H",
"RUS-79U",
"J358",
"NA-45",
"HS2126",
"QXR",
"Locus",
"Outlaw",
"Renetti",
"PP19 Bizon",
"AGR 556",
"BK57",
"ASM10",
"CR-56 AMAX",
"Shorty",
"Crossbow",
"R9-0",
"PPSh-41",
"CBR4",
"SVD"
],
"weaponAlliasName": [
["MoW"],
["PK"],
["T25"],
["MP5"],
["RB", "RZBK"],
["Deagle", "Desert Eagle"],
["A50", "Artic"],
["Kar98k"],
["Vector"],
["FAMAS"],
["Scar", "Scar-H", "Scar-L"],
["AKS", "AKS 47U"],
["Revolver"],
["gae"],
["Burst Shotty", "Burst Shotgun"],
["MP7", "QQ11"],
["Slow Outlaw", "Slower Outlaw"],
["bae"],
["Reneti", "Renneti", "Rennetti", "Burst Pistol"],
["pp bizon", "pp19"],
["AUG"],
["AKBP", "Vepr"],
["AN94"],
["CR56", "AMAX"],
["725"],
["cb", "bow"],
["r9", "R9-O"],
["ppsh", "pp41"],
["p90"],
["Dragonov"]
],
"attachmentActualName": [
["akimbo", "Stopping Power"],
["Tactical Scope", "Laser", "Slug", "Magazine", "Reload", "Tactical Laser Sight"],
["5x [.338] Mag","5x [.300] Mag"],
["Bowstring"]
],
"attachmentAlliasName": [
[["akim", "akimbo"], ["SP"]],
[
["1.5x", "1.5x Scope", "acog", "acog Scope"],
["Lazer"],
["Slugs"],
["Ammo", "Reload", "Mag"],
["Ammo", "Reload"],
["OWC Laser", "OWC Lazer"]
],
[[".338",".338 reload", "lapua"],[".300",".300 reload", "norma"]],
[["String"]]
]
}
{
"weaponActualName": [
"Man-O-War",
"Peacekeeper MK2",
"Type 25",
"QQ9",
"Razorback",
".50 GS",
"Arctic .50",
"Kilo Bolt-Action",
"Fennec",
"FR .556",
"DR-H",
"RUS-79U",
"J358",
"NA-45",
"HS2126",
"QXR",
"Locus",
"Outlaw",
"Renetti",
"PP19 Bizon",
"AGR 556",
"BK57",
"ASM10",
"CR-56 AMAX",
"Shorty",
"Crossbow",
"R9-0",
"PPSh-41",
"CBR4",
"SVD"
],
"weaponAlliasName": [
["MoW"],
["PK"],
["T25"],
["MP5"],
["RB", "RZBK"],
["Deagle", "Desert Eagle"],
["A50", "Artic"],
["Kar98k"],
["Vector"],
["FAMAS"],
["Scar", "Scar-H", "Scar-L"],
["AKS", "AKS 47U"],
["Revolver"],
["gae"],
["Burst Shotty", "Burst Shotgun"],
["MP7", "QQ11"],
["Slow Outlaw", "Slower Outlaw"],
["bae"],
["Reneti", "Renneti", "Rennetti", "Burst Pistol"],
["pp bizon", "pp19"],
["AUG"],
["AKBP", "Vepr"],
["AN94"],
["CR56", "AMAX"],
["725"],
["cb", "bow"],
["r9", "R9-O"],
["ppsh", "pp41"],
["p90"],
["Dragonov"]
],
"attachmentActualName": [
["akimbo", "Stopping Power"],
["Tactical Scope", "Laser", "Slug", "Magazine", "Reload", "Tactical Laser Sight"],
["5x [.338] Mag","5x [.300] Mag"],
["Bowstring"]
],
"attachmentAlliasName": [
[["akim", "akimbo"], ["SP"]],
[
["1.5x", "1.5x Scope", "acog", "acog Scope"],
["Lazer"],
["Slugs"],
["Ammo", "Reload", "Mag"],
["Ammo", "Reload"],
["OWC Laser", "OWC Lazer"]
],
[[".338",".338 reload", "lapua"],[".300",".300 reload", "norma"]],
[["String"]]
]
}

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -1,24 +1,24 @@
{
"ipgrabber": [
"iplogger.org",
"2no.co",
"iplogger.com",
"iplogger.ru",
"yip.su",
"iplogger.co",
"iplogger.info",
"ipgrabber.ru",
"ipgraber.ru",
"iplis.ru",
"02ip.ru",
"ezstat.ru"
],
"other": [
"www.ps3cfw.com/cool",
"www.ythingy.com",
"blasze.tk",
"www.fuekos.com",
"www.myiptest.com"
]
}
{
"ipgrabber": [
"iplogger.org",
"2no.co",
"iplogger.com",
"iplogger.ru",
"yip.su",
"iplogger.co",
"iplogger.info",
"ipgrabber.ru",
"ipgraber.ru",
"iplis.ru",
"02ip.ru",
"ezstat.ru"
],
"other": [
"www.ps3cfw.com/cool",
"www.ythingy.com",
"blasze.tk",
"www.fuekos.com",
"www.myiptest.com"
]
}

View file

@ -1,48 +1,48 @@
{
"attachmentTypes": [
"Optics",
"Underbarrel",
"Rear Grip",
"Laser",
"Muzzle",
"Barrel",
"Stock",
"Ammunition",
"Perk",
"Trigger Action",
"Guard",
"Bolt",
"Bowstring",
"Limb",
"Smoothbore"
],
"weaponTypes": [
"AR",
"Sniper",
"LMG",
"SMG",
"Shotgun",
"Marksman",
"Pistol"
],
"firingModes": [
"Full Auto",
"Semi Auto",
"Burst",
"Break Action",
"Pump Action",
"Lever Action",
"Bolt Action"
],
"penetrationLevels": [
"Zero",
"Low",
"Medium",
"High"
],
"reloadTypes": [
"Magazine",
"Single",
"Belt"
]
{
"attachmentTypes": [
"Optics",
"Underbarrel",
"Rear Grip",
"Laser",
"Muzzle",
"Barrel",
"Stock",
"Ammunition",
"Perk",
"Trigger Action",
"Guard",
"Bolt",
"Bowstring",
"Limb",
"Smoothbore"
],
"weaponTypes": [
"AR",
"Sniper",
"LMG",
"SMG",
"Shotgun",
"Marksman",
"Pistol"
],
"firingModes": [
"Full Auto",
"Semi Auto",
"Burst",
"Break Action",
"Pump Action",
"Lever Action",
"Bolt Action"
],
"penetrationLevels": [
"Zero",
"Low",
"Medium",
"High"
],
"reloadTypes": [
"Magazine",
"Single",
"Belt"
]
}

View file

@ -1,24 +1,24 @@
{
"firingMode": "Firing Mode",
"rof": "Rate of fire",
"penetrationLevel": "Penetration Level",
"adsTime": "ADS Time",
"adsZoom": "ADS Zoom%",
"bht": "Breath Hold Time",
"bsa": "Bullet Spread Accuracy",
"bulletVelocity": "Bullet Velocity",
"bulletsPerShot": "Bullets Per Shot",
"burstRpmDelay": "Burst Delay",
"hipfireSpread": "Hipfire Spread",
"magazineSize": "Magazine Size",
"reserve": "Magazine Reserve",
"reloadTime": "Reload Time",
"reloadCancel": "Reload Cancel",
"ReloadTimeEmpty": "Empty Reload Time",
"reloadCancelEmpty": "Empty Reload Cancel",
"stf": "Sprint to fire",
"raiseTime": "Raise Time",
"dropTime": "Drop Time",
"sprinting": "Sprinting Speed",
"walking": "Movement Speed"
}
{
"firingMode": "Firing Mode",
"rof": "Rate of fire",
"penetrationLevel": "Penetration Level",
"adsTime": "ADS Time",
"adsZoom": "ADS Zoom%",
"bht": "Breath Hold Time",
"bsa": "Bullet Spread Accuracy",
"bulletVelocity": "Bullet Velocity",
"bulletsPerShot": "Bullets Per Shot",
"burstRpmDelay": "Burst Delay",
"hipfireSpread": "Hipfire Spread",
"magazineSize": "Magazine Size",
"reserve": "Magazine Reserve",
"reloadTime": "Reload Time",
"reloadCancel": "Reload Cancel",
"ReloadTimeEmpty": "Empty Reload Time",
"reloadCancelEmpty": "Empty Reload Cancel",
"stf": "Sprint to fire",
"raiseTime": "Raise Time",
"dropTime": "Drop Time",
"sprinting": "Sprinting Speed",
"walking": "Movement Speed"
}

View file

@ -1,72 +1,72 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="1030.303"
height="1000"
viewBox="0 0 1030.303 1000"
version="1.1"
id="svg9"
sodipodi:docname="apex-legends-logo-white.svg"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="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:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
id="namedview11"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="0.59916667"
inkscape:cx="514.88178"
inkscape:cy="499.86092"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="svg9" />
<title
id="title2">Apex Legends Symbol</title>
<defs
id="defs4" />
<g
id="Page-1"
stroke="none"
stroke-width="1"
fill="none"
fill-rule="evenodd"
transform="translate(-285,-100)"
style="fill:#ffffff">
<g
id="apex-legends-symbol"
transform="translate(285,100)"
fill="#130c0d"
fill-rule="nonzero"
style="fill:#ffffff">
<polygon
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 "
style="fill:#ffffff" />
</g>
</g>
<metadata
id="metadata13">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:title>Apex Legends Symbol</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="1030.303"
height="1000"
viewBox="0 0 1030.303 1000"
version="1.1"
id="svg9"
sodipodi:docname="apex-legends-logo-white.svg"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="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:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
id="namedview11"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="0.59916667"
inkscape:cx="514.88178"
inkscape:cy="499.86092"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="svg9" />
<title
id="title2">Apex Legends Symbol</title>
<defs
id="defs4" />
<g
id="Page-1"
stroke="none"
stroke-width="1"
fill="none"
fill-rule="evenodd"
transform="translate(-285,-100)"
style="fill:#ffffff">
<g
id="apex-legends-symbol"
transform="translate(285,100)"
fill="#130c0d"
fill-rule="nonzero"
style="fill:#ffffff">
<polygon
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 "
style="fill:#ffffff" />
</g>
</g>
<metadata
id="metadata13">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:title>Apex Legends Symbol</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
</svg>

Before

(image error) Size: 2.1 KiB

After

(image error) Size: 2.2 KiB

View file

@ -1,20 +1,20 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="1000.000000pt" height="1034.000000pt" viewBox="0 0 1000.000000 1034.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,1034.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M590 5165 l0 -5170 680 680 680 680 0 3810 0 3810 -680 680 -680 680
0 -5170z"/>
<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"/>
<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
-3 807 -1312 -1312z"/>
<path d="M5742 4467 l-452 -452 1190 -1190 1190 -1190 0 905 0 905 -738 738
-737 737 -453 -453z"/>
</g>
</svg>
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="1000.000000pt" height="1034.000000pt" viewBox="0 0 1000.000000 1034.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,1034.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M590 5165 l0 -5170 680 680 680 680 0 3810 0 3810 -680 680 -680 680
0 -5170z"/>
<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"/>
<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
-3 807 -1312 -1312z"/>
<path d="M5742 4467 l-452 -452 1190 -1190 1190 -1190 0 905 0 905 -738 738
-737 737 -453 -453z"/>
</g>
</svg>

Before

(image error) Size: 924 B

After

(image error) Size: 944 B

68
util/dist/handler.js vendored
View file

@ -1,34 +1,34 @@
const fs = require("fs");
const cmds = [];
const ownercmds = [];
module.exports = async client => {
fs.readdirSync("./events").forEach(file => {
require(`${process.cwd()}/events/${file}`);
});
fs.readdirSync("./command").forEach(directory => {
if (directory !== "Owner") {
const commands = fs.readdirSync(`./command/${directory}/`);
commands.map(value => {
const file = require(`${process.cwd()}/command/${directory}/${value}`);
if (file.name) {
const properties = { directory, ...file };
client.slashCommands.set(file.name, properties);
}
if (["MESSAGE", "USER"].includes(file.type)) delete file.description;
if (file.UserPerms) file.defaultPermission = false;
cmds.push(file);
});
}
});
fs.readdirSync("./command/Owner").forEach(f => {
const file = require(`${process.cwd()}/command/Owner/${f}`);
client.hide.set(file.name, file);
if (["MESSAGE", "USER"].includes(file.type)) delete file.description;
if (file.UserPerms) file.defaultPermission = false;
ownercmds.push(file);
});
client.on("ready", async () => {
await client.guilds.cache.get("840225563193114624").commands.set(ownercmds);
await client.application.commands.set(cmds);
});
};
const fs = require("fs");
const cmds = [];
const ownercmds = [];
module.exports = async client => {
fs.readdirSync("./events").forEach(file => {
require(`${process.cwd()}/events/${file}`);
});
fs.readdirSync("./command").forEach(directory => {
if (directory !== "Owner") {
const commands = fs.readdirSync(`./command/${directory}/`);
commands.map(value => {
const file = require(`${process.cwd()}/command/${directory}/${value}`);
if (file.name) {
const properties = { directory, ...file };
client.slashCommands.set(file.name, properties);
}
if (["MESSAGE", "USER"].includes(file.type)) delete file.description;
if (file.UserPerms) file.defaultPermission = false;
cmds.push(file);
});
}
});
fs.readdirSync("./command/Owner").forEach(f => {
const file = require(`${process.cwd()}/command/Owner/${f}`);
client.hide.set(file.name, file);
if (["MESSAGE", "USER"].includes(file.type)) delete file.description;
if (file.UserPerms) file.defaultPermission = false;
ownercmds.push(file);
});
client.on("ready", async () => {
await client.guilds.cache.get("840225563193114624").commands.set(ownercmds);
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

View file

@ -1,324 +1,324 @@
const mongoose = require("mongoose");
const { GooseCache } = require("goosecache");
const cachegoose = new GooseCache(mongoose, {
engine: "memory",
});
mongoose.set("useFindAndModify", false);
const u = require("../../models/users");
const g = require("../../models/guilds");
module.exports = {
/**
* @param {String} URI - Mongo Connection URI
*/
async connect(URI) {
if (!URI) throw new Error("Please provide a Mongoose URI");
return mongoose.connect(URI, {
useNewUrlParser: true,
useUnifiedTopology: true,
});
},
/**
* @param {String} ID - Guild ID
*/
async getGuild(ID) {
if (!ID) throw new Error("Guild ID?");
const guild = await g.findOne({ Guild: ID }).lean().cache(120);
if (!guild) {
const gg = new g({ Guild: ID });
const { Guild, Prefix, Premium, Category, Commands, Tips } = gg;
await gg.save().catch(error => console.log(error));
return {
Guild,
Prefix,
Premium,
Category,
Commands,
Tips,
};
} else {
const Guild = guild.Guild;
const Prefix = guild.Prefix;
const Premium = guild.Premium;
const Category = guild.Category;
const Commands = guild.Commands;
const Tips = guild.Tips;
return {
Guild,
Prefix,
Premium,
Category,
Commands,
Tips,
};
}
},
/**
* @param {String} ID - User ID
*/
async getUser(ID) {
if (!ID) throw new Error("User ID?");
const user = await u.findOne({ User: ID }).lean().cache(120);
if (!user) {
const ss = new u({ User: ID });
const {
User,
Tier,
Premium,
Blacklist,
Blacklist_Reason,
PremiumServers,
} = ss;
await ss.save().catch(error => console.log(error));
return {
User,
Tier,
Premium,
Blacklist,
Blacklist_Reason,
PremiumServers,
};
} else {
const User = user.User;
const Tier = user.Tier;
const Premium = user.Premium;
const Blacklist = user.Blacklist;
const Blacklist_Reason = user.Blacklist_Reason;
const PremiumServers = user.PremiumServers;
return {
User,
Tier,
Premium,
Blacklist,
Blacklist_Reason,
PremiumServers,
};
}
},
/**
* @param {String} ID - ID of the User
* @param {String} Toggle - Blacklist Toggle(true/false)
* @param {String} Reason - Blacklist Reason
*/
async BK(ID, Toggle, Reason) {
if (!ID) throw new Error("User ID?");
// if (!Toggle) throw new Error("Blacklist Toggle?");
if (!Reason) throw new Error("Blacklist Feason?");
const user = await u.findOne({ User: ID });
if (!user) {
const sus = new u({ User: ID });
if (Toggle == true) {
user.Blacklist = true;
user.Blacklist_Reason = Reason;
} else {
user.Blacklist = false;
user.Blacklist_Reason = null;
}
await sus.save().catch(error => console.log(error));
cachegoose.clearCache();
return { Reason };
} else {
if (Toggle == true) {
user.Blacklist = true;
user.Blacklist_Reason = Reason;
} else {
user.Blacklist = false;
user.Blacklist_Reason = null;
}
await user.save().catch(error => console.log(error));
cachegoose.clearCache();
return { Reason };
}
},
/**
* @param {String} ID - ID of the User
* @param {Boolean} Toggle - Premium Toggle(true/false)
* @param {Number} Tier - Tier
*/
async Premium(ID, Toggle, Tier) {
if (!ID) throw new Error("User ID?");
if (!Toggle) throw new Error("Premium Toggle?");
if (!Tier) throw new Error("Premium Feason?");
const user = await u.findOne({ User: ID });
if (!user) {
const sus = new u({ User: ID });
if (Toggle == "true") {
user.Premium = true;
user.Tier = Tier;
} else {
user.Premium = false;
user.Tier = 0;
}
await sus.save().catch(error => console.log(error));
cachegoose.clearCache();
return { Tier };
} else {
if (Toggle == "true") {
user.Premium = true;
user.Tier = Tier;
} else {
user.Premium = false;
user.Tier = 0;
}
await user.save().catch(error => console.log(error));
cachegoose.clearCache();
return { Tier };
}
},
/**
* @param {String} ID
*/
async CreateGuild(ID) {
await new g({ Guild: ID });
return;
},
/**
* @param {String} ID
*/
async CreateBot(ID) {
await new m({ Guild: ID });
return;
},
/**
* @param {String} ID - Guild ID
*/
async DelGuild(ID) {
await g.deleteMany({ Guild: ID });
return;
},
/**
* @param {String} ID - Guild ID
* @param {String} Toggle - premium Toggle
*/
async setPremium(ID, Toggle) {
if (!ID) throw new Error("Please Provide a Guild ID");
if (!Toggle) throw new Error("Please Provide a Toggle!");
const guild = await g.findOne({ Guild: ID });
if (!guild) {
const newU = new g({ Guild: ID });
if (Toggle == "true") {
guild.Premium = true;
} else {
guild.Premium = false;
}
await newU.save().catch(error => console.log(error));
return;
} else if (Toggle == "true") {
guild.Premium = true;
} else {
guild.Premium = false;
}
await guild.save().catch(error => console.log(error));
cachegoose.clearCache();
return;
},
/**
* @param {String} User - User ID
* @param {String} ID - Guild ID
* @param {String} Method - Method
*/
async pushGuild(User, ID, method) {
if (!method) return new Error("Method?");
u.findOne({ User: User }, async (err, data) => {
if (err) throw err;
if (!data) return new Error("User not found");
if (method === "push") {
await data.PremiumServers.push(ID);
await data.save().catch(error => console.log(error));
data.save();
}
if (method === "splice") {
const index = data.PremiumServers.indexOf(ID);
data.PremiumServers.splice(index, 1);
data.save();
}
cachegoose.clearCache();
return { User };
});
},
/**
* @param {String} ID - Guild ID
* @param {String} Type - Type
* @param {String} Name - Name
*/
async disable(ID, Type, Name) {
if (!Name) throw new Error("Name?");
if (!Type) throw new Error("Type?");
if (!ID) throw new Error("Guild ID?");
if (Type === "category") {
const db = await g.findOne({ Guild: ID });
if (!db) {
const newdoc = await new g({ Guild: ID });
await newdoc.save().catch(error => console.log(error));
}
await db.Category.push(Name);
await db.save().catch(e => console.log(e));
}
if (Type === "command") {
const db = await g.findOne({ Guild: ID });
if (!db) {
const newdoc = await new g({ Guild: ID });
await newdoc.save().catch(error => console.log(error));
}
await db.Commands.push(Name);
await db.save().catch(e => console.log(e));
}
cachegoose.clearCache();
return { Name };
},
/**
* @param {String} ID - Guild ID
* @param {String} Type - Type
* @param {String} Name - Name
*/
async enable(ID, Type, Name) {
if (!ID) throw new Error("Guild ID?");
if (!Name) throw new Error("Name?");
if (!Type) throw new Error("Type?");
if (Type === "category") {
const db = await g.findOne({ Guild: ID });
if (!db) {
return false;
}
const index = db.Category.indexOf(Name.toLowerCase());
await db.Category.splice(index, 1);
await db.save().catch(e => console.log(e));
}
if (Type === "command") {
const db = await g.findOne({ Guild: ID });
if (!db) {
return false;
}
const index = db.Commands.indexOf(Name);
await db.Commands.splice(index, 1);
await db.save().catch(e => console.log(e));
}
cachegoose.clearCache();
return true;
},
/**
* @param {String} ID - Guild ID
* @param {String} Toggle - Level Toggle
*/
async setTips(ID, Toggle) {
if (!ID) throw new Error("Please Provide a Guild ID");
if (!Toggle) throw new Error("Please Provide a Toggle!");
const guild = await g.findOne({ Guild: ID });
if (!guild) {
const newU = new g({ Guild: ID });
if (Toggle == "true") {
guild.Tips = true;
} else {
guild.Tips = false;
}
await newU.save().catch(error => console.log(error));
return;
} else if (Toggle == "true") {
guild.Tips = true;
} else {
guild.Tips = false;
}
await guild.save().catch(error => console.log(error));
cachegoose.clearCache();
return;
},
};
const mongoose = require("mongoose");
const { GooseCache } = require("goosecache");
const cachegoose = new GooseCache(mongoose, {
engine: "memory",
});
mongoose.set("useFindAndModify", false);
const u = require("../../models/users");
const g = require("../../models/guilds");
module.exports = {
/**
* @param {String} URI - Mongo Connection URI
*/
async connect(URI) {
if (!URI) throw new Error("Please provide a Mongoose URI");
return mongoose.connect(URI, {
useNewUrlParser: true,
useUnifiedTopology: true,
});
},
/**
* @param {String} ID - Guild ID
*/
async getGuild(ID) {
if (!ID) throw new Error("Guild ID?");
const guild = await g.findOne({ Guild: ID }).lean().cache(120);
if (!guild) {
const gg = new g({ Guild: ID });
const { Guild, Prefix, Premium, Category, Commands, Tips } = gg;
await gg.save().catch(error => console.log(error));
return {
Guild,
Prefix,
Premium,
Category,
Commands,
Tips,
};
} else {
const Guild = guild.Guild;
const Prefix = guild.Prefix;
const Premium = guild.Premium;
const Category = guild.Category;
const Commands = guild.Commands;
const Tips = guild.Tips;
return {
Guild,
Prefix,
Premium,
Category,
Commands,
Tips,
};
}
},
/**
* @param {String} ID - User ID
*/
async getUser(ID) {
if (!ID) throw new Error("User ID?");
const user = await u.findOne({ User: ID }).lean().cache(120);
if (!user) {
const ss = new u({ User: ID });
const {
User,
Tier,
Premium,
Blacklist,
Blacklist_Reason,
PremiumServers,
} = ss;
await ss.save().catch(error => console.log(error));
return {
User,
Tier,
Premium,
Blacklist,
Blacklist_Reason,
PremiumServers,
};
} else {
const User = user.User;
const Tier = user.Tier;
const Premium = user.Premium;
const Blacklist = user.Blacklist;
const Blacklist_Reason = user.Blacklist_Reason;
const PremiumServers = user.PremiumServers;
return {
User,
Tier,
Premium,
Blacklist,
Blacklist_Reason,
PremiumServers,
};
}
},
/**
* @param {String} ID - ID of the User
* @param {String} Toggle - Blacklist Toggle(true/false)
* @param {String} Reason - Blacklist Reason
*/
async BK(ID, Toggle, Reason) {
if (!ID) throw new Error("User ID?");
// if (!Toggle) throw new Error("Blacklist Toggle?");
if (!Reason) throw new Error("Blacklist Feason?");
const user = await u.findOne({ User: ID });
if (!user) {
const sus = new u({ User: ID });
if (Toggle == true) {
user.Blacklist = true;
user.Blacklist_Reason = Reason;
} else {
user.Blacklist = false;
user.Blacklist_Reason = null;
}
await sus.save().catch(error => console.log(error));
cachegoose.clearCache();
return { Reason };
} else {
if (Toggle == true) {
user.Blacklist = true;
user.Blacklist_Reason = Reason;
} else {
user.Blacklist = false;
user.Blacklist_Reason = null;
}
await user.save().catch(error => console.log(error));
cachegoose.clearCache();
return { Reason };
}
},
/**
* @param {String} ID - ID of the User
* @param {Boolean} Toggle - Premium Toggle(true/false)
* @param {Number} Tier - Tier
*/
async Premium(ID, Toggle, Tier) {
if (!ID) throw new Error("User ID?");
if (!Toggle) throw new Error("Premium Toggle?");
if (!Tier) throw new Error("Premium Feason?");
const user = await u.findOne({ User: ID });
if (!user) {
const sus = new u({ User: ID });
if (Toggle == "true") {
user.Premium = true;
user.Tier = Tier;
} else {
user.Premium = false;
user.Tier = 0;
}
await sus.save().catch(error => console.log(error));
cachegoose.clearCache();
return { Tier };
} else {
if (Toggle == "true") {
user.Premium = true;
user.Tier = Tier;
} else {
user.Premium = false;
user.Tier = 0;
}
await user.save().catch(error => console.log(error));
cachegoose.clearCache();
return { Tier };
}
},
/**
* @param {String} ID
*/
async CreateGuild(ID) {
await new g({ Guild: ID });
return;
},
/**
* @param {String} ID
*/
async CreateBot(ID) {
await new m({ Guild: ID });
return;
},
/**
* @param {String} ID - Guild ID
*/
async DelGuild(ID) {
await g.deleteMany({ Guild: ID });
return;
},
/**
* @param {String} ID - Guild ID
* @param {String} Toggle - premium Toggle
*/
async setPremium(ID, Toggle) {
if (!ID) throw new Error("Please Provide a Guild ID");
if (!Toggle) throw new Error("Please Provide a Toggle!");
const guild = await g.findOne({ Guild: ID });
if (!guild) {
const newU = new g({ Guild: ID });
if (Toggle == "true") {
guild.Premium = true;
} else {
guild.Premium = false;
}
await newU.save().catch(error => console.log(error));
return;
} else if (Toggle == "true") {
guild.Premium = true;
} else {
guild.Premium = false;
}
await guild.save().catch(error => console.log(error));
cachegoose.clearCache();
return;
},
/**
* @param {String} User - User ID
* @param {String} ID - Guild ID
* @param {String} Method - Method
*/
async pushGuild(User, ID, method) {
if (!method) return new Error("Method?");
u.findOne({ User: User }, async (err, data) => {
if (err) throw err;
if (!data) return new Error("User not found");
if (method === "push") {
await data.PremiumServers.push(ID);
await data.save().catch(error => console.log(error));
data.save();
}
if (method === "splice") {
const index = data.PremiumServers.indexOf(ID);
data.PremiumServers.splice(index, 1);
data.save();
}
cachegoose.clearCache();
return { User };
});
},
/**
* @param {String} ID - Guild ID
* @param {String} Type - Type
* @param {String} Name - Name
*/
async disable(ID, Type, Name) {
if (!Name) throw new Error("Name?");
if (!Type) throw new Error("Type?");
if (!ID) throw new Error("Guild ID?");
if (Type === "category") {
const db = await g.findOne({ Guild: ID });
if (!db) {
const newdoc = await new g({ Guild: ID });
await newdoc.save().catch(error => console.log(error));
}
await db.Category.push(Name);
await db.save().catch(e => console.log(e));
}
if (Type === "command") {
const db = await g.findOne({ Guild: ID });
if (!db) {
const newdoc = await new g({ Guild: ID });
await newdoc.save().catch(error => console.log(error));
}
await db.Commands.push(Name);
await db.save().catch(e => console.log(e));
}
cachegoose.clearCache();
return { Name };
},
/**
* @param {String} ID - Guild ID
* @param {String} Type - Type
* @param {String} Name - Name
*/
async enable(ID, Type, Name) {
if (!ID) throw new Error("Guild ID?");
if (!Name) throw new Error("Name?");
if (!Type) throw new Error("Type?");
if (Type === "category") {
const db = await g.findOne({ Guild: ID });
if (!db) {
return false;
}
const index = db.Category.indexOf(Name.toLowerCase());
await db.Category.splice(index, 1);
await db.save().catch(e => console.log(e));
}
if (Type === "command") {
const db = await g.findOne({ Guild: ID });
if (!db) {
return false;
}
const index = db.Commands.indexOf(Name);
await db.Commands.splice(index, 1);
await db.save().catch(e => console.log(e));
}
cachegoose.clearCache();
return true;
},
/**
* @param {String} ID - Guild ID
* @param {String} Toggle - Level Toggle
*/
async setTips(ID, Toggle) {
if (!ID) throw new Error("Please Provide a Guild ID");
if (!Toggle) throw new Error("Please Provide a Toggle!");
const guild = await g.findOne({ Guild: ID });
if (!guild) {
const newU = new g({ Guild: ID });
if (Toggle == "true") {
guild.Tips = true;
} else {
guild.Tips = false;
}
await newU.save().catch(error => console.log(error));
return;
} else if (Toggle == "true") {
guild.Tips = true;
} else {
guild.Tips = false;
}
await guild.save().catch(error => console.log(error));
cachegoose.clearCache();
return;
},
};