Compare commits

..

102 commits

Author SHA1 Message Date
night0721
6e23aed812 readme update 2023-11-02 00:26:36 +00:00
night0721
b454fd8f6b Change License to GPL v3 2023-10-31 01:42:53 +00:00
night0721
e6ea923687 unix from dos 2023-10-31 01:39:28 +00:00
NK
0e6804fd56 yt link 2023-06-22 17:10:35 +01:00
NK
c17d39396a Merge branch 'main' of https://github.com/night0721/cath.exe 2023-05-25 01:36:58 +01:00
NK
fb44d2cf35 update discord links 2023-05-25 01:36:57 +01:00
Night
b3de34678b
Merge pull request #101 from hcs1219/patch-3
Update userinfo.js
2023-05-22 21:51:51 +01:00
hcs1219
031c95a8e0
Update userinfo.js 2023-05-23 03:16:36 +08:00
Night
60e761a8e2
Merge pull request #100 from hcs1219/patch-2
Update userinfo.js
2023-05-21 22:21:37 +01:00
hcs1219
411c084d46
Update userinfo.js 2023-05-22 02:08:27 +08:00
Night
e7f4d3ff59
Merge pull request #99 from night0721/tac-dev
Tac dev
2023-05-21 17:44:33 +01:00
Night
603f8af515
Merge pull request #98 from hcs1219/main
userinfo
2023-05-21 17:43:12 +01:00
hcs1219
5f978c1392
Update userinfo.js 2023-05-22 00:37:29 +08:00
hcs1219
362f4ea98d
Update userinfo.js 2023-05-22 00:20:41 +08:00
hcs1219
936a1dbc9d
Update NYX.js 2023-05-21 23:56:49 +08:00
NK
74348b708f fix 2023-04-14 14:44:37 +01:00
NK
55b35a0e11 upate in tos 2023-04-14 14:00:35 +01:00
NK
401e962ea1 fix image not showing 2023-04-14 13:34:41 +01:00
NK
6ff8a030ec fix 2023-04-14 13:33:26 +01:00
NK
dae0c55813 tos and privacy policy 2023-04-14 12:06:12 +01:00
NK
f856b1c474 fix 2023-04-13 14:50:37 +01:00
NK
4ee5c2286c fix 2023-04-06 14:21:34 +01:00
NK
d51d489a0b uh 2023-04-06 14:17:35 +01:00
NK
3fb1b8bea3 fix 2023-04-06 14:10:43 +01:00
NK
6da0a868a2 debugging + the great revamp 2023-04-06 13:40:00 +01:00
NK
294bfd8d03 remove apex as it is dying 2023-04-06 13:35:28 +01:00
NK
3a2e52d660 the great revamp 2.0 2023-04-06 13:32:44 +01:00
NK
2f394a83ba the great revamp 2023-04-06 13:23:31 +01:00
NK
4001080638 remove moment dependency 2023-04-06 12:13:46 +01:00
NK
1b93be6599 ? 2023-04-06 11:43:44 +01:00
NK
7613c26752 broken af 2023-04-06 01:28:29 +01:00
NK
6d82a842cf ? 2023-04-04 23:06:53 +01:00
NK
47405bb769 still 2023-04-04 16:28:24 +01:00
NK
49b2b3aca5 still removing 2023-04-04 16:26:56 +01:00
NK
2e2501cf90 remove useless 2023-04-04 16:21:49 +01:00
NK
c047fbb980 the great revamp 2023-04-02 13:12:53 +01:00
NK
6430e26479 remove redundant code again 2023-03-31 15:40:30 +01:00
NK
b7c4519a49 rm 2023-03-31 15:16:20 +01:00
NK
753b3f0fd3 remove redutant code 2023-03-31 14:15:23 +01:00
NK
a9d1bbc1e3 remove reduntant stuff 2023-03-31 14:15:13 +01:00
NK
b93358346a fix 2023-02-03 22:28:45 +00:00
NK
0c160b0621 fix 2023-02-03 22:02:41 +00:00
NK
bb11d4d79a fixing bugs 2023-02-03 19:14:39 +00:00
NK
dfcae1590d removing errors due to discord.js kind of cringe 2023-02-03 19:11:17 +00:00
NK
d4c85f5e9e Merge branch 'main' of https://github.com/night0721/cath.exe 2023-02-03 11:08:53 +00:00
NK
cca8472575 changing clinet id 2023-02-03 11:08:49 +00:00
Night Kaly
40f0f3783b
Merge pull request #90 from hcs1219/patch-1 2023-02-01 19:41:29 +00:00
hcs1219
174c960577
Update avatar.js 2023-02-02 02:50:35 +08:00
NK
85078f6f50 Merge branch 'main' of https://github.com/night0721/cath.exe
z
2023-01-31 14:08:21 +00:00
NK
5015b7a9dc remove unused things due to copyright 2023-01-31 14:06:38 +00:00
Night Kaly
1abeb62830
Merge pull request #84 from night0721/dependabot/npm_and_yarn/goosecache-10.0.0
Bump goosecache from 9.0.14 to 10.0.0
2022-12-30 19:19:11 +00:00
dependabot[bot]
8d62affdac
Bump goosecache from 9.0.14 to 10.0.0
Bumps [goosecache](https://github.com/kensingtontech/goosecache) from 9.0.14 to 10.0.0.
- [Release notes](https://github.com/kensingtontech/goosecache/releases)
- [Commits](https://github.com/kensingtontech/goosecache/commits)

---
updated-dependencies:
- dependency-name: goosecache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-14 13:06:56 +00:00
NK
eabc27286b Merge branch 'main' of https://github.com/night0721/cath.exe 2022-10-27 20:05:05 +00:00
Night Kaly
5f44400893
Merge pull request #82 from night0721/dependabot/npm_and_yarn/axios-1.1.3
Bump axios from 0.27.2 to 1.1.3
2022-10-27 20:02:19 +00:00
Night Kaly
08f483c11f
Merge pull request #83 from night0721/dependabot/npm_and_yarn/node-19.0.0
Bump node from 18.11.0 to 19.0.0
2022-10-27 20:01:32 +00:00
NK
916e0b9c2b slight fix for v14 2022-10-27 20:00:04 +00:00
dependabot[bot]
f8263cf415
Bump axios from 0.27.2 to 1.1.3
Bumps [axios](https://github.com/axios/axios) from 0.27.2 to 1.1.3.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.27.2...v1.1.3)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-26 10:47:36 +00:00
NK
36fd3341a7 fix 2022-10-26 10:38:28 +00:00
dependabot[bot]
bf0e5a656c
Bump node from 18.11.0 to 19.0.0
Bumps [node](https://github.com/aredridel/node-bin-gen) from 18.11.0 to 19.0.0.
- [Release notes](https://github.com/aredridel/node-bin-gen/releases)
- [Commits](https://github.com/aredridel/node-bin-gen/commits)

---
updated-dependencies:
- dependency-name: node
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-19 13:28:07 +00:00
night0721
6c3223b7f0 still lagging 2022-07-30 16:06:26 +01:00
night0721
3e74186158 this commit cost my computer to lag as dumb... 2022-07-30 15:54:39 +01:00
Night Kaly
4491b1b9f5
Merge pull request #65 from night0721/dependabot/npm_and_yarn/axios-0.27.2
Bump axios from 0.26.1 to 0.27.2
2022-07-29 20:12:47 +01:00
Night Kaly
be1deb3222
Merge pull request #72 from night0721/dependabot/npm_and_yarn/node-18.7.0
Bump node from 17.9.1 to 18.7.0
2022-07-29 20:12:30 +01:00
Night Kaly
753f9a1284
Merge pull request #70 from night0721/main
.
2022-07-29 20:12:22 +01:00
dependabot[bot]
28c5db0e98
Bump node from 17.9.1 to 18.7.0
Bumps [node](https://github.com/aredridel/node-bin-gen) from 17.9.1 to 18.7.0.
- [Release notes](https://github.com/aredridel/node-bin-gen/releases)
- [Commits](https://github.com/aredridel/node-bin-gen/commits)

---
updated-dependencies:
- dependency-name: node
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-28 13:34:47 +00:00
night0721
092581c5fb Finally realise I mistype BotPerms in kick command and wtf discord devs removed command perms!?!?!?!?! 2022-07-02 10:06:48 +01:00
ThunderE75
868d66acda
Added attachments for new weapons
Added attachments for new weapons
2022-05-12 15:42:17 +05:30
ThunderE75
855d07273e
api response for legends 2022-05-12 15:20:19 +05:30
ThunderE75
178d9aa925
Added attachments for koshka & Oden 2022-05-12 00:37:54 +05:30
ThunderE75
96176eb59b
added apex json template 2022-05-09 00:04:55 +05:30
dependabot[bot]
765caa17e7
Bump axios from 0.26.1 to 0.27.2
Bumps [axios](https://github.com/axios/axios) from 0.26.1 to 0.27.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.26.1...v0.27.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-27 13:23:24 +00:00
night0721
0444dc2ee8 alright it is finally working 2022-03-25 03:36:31 +08:00
ThunderE75
eaea49de85
Added Mac & 🧀
Merge pull request #63 from night0721/dev
2022-03-24 23:51:26 +05:30
ThunderE75
3612e8a9a8
Added Mac 10 & New AK attachment, and fixed embed 2022-03-24 23:49:17 +05:30
night0721
aa4e4bb391 nsfw bug fixing 2022-03-25 01:51:00 +08:00
Night Kaly
1f8c857915
Merge pull request #62 from night0721/dev
Dev
2022-03-24 17:20:48 +00:00
Night Kaly
4f60a07863
Merge branch 'main' into dev 2022-03-24 17:20:31 +00:00
night0721
e4ab80dc37 fix ur function bro 2022-03-25 01:19:42 +08:00
ThunderE75
b69518eb75
embed fixed 2022-03-24 02:01:23 +05:30
ThunderE75
305b0fb2c8
Moved nsfw commands to unused. 2022-03-23 22:34:16 +05:30
ThunderE75
9ce8e60ea9
Experimenting with embed 2022-03-23 22:13:18 +05:30
Night Kaly
6480e387ea
Merge pull request #61 from vKxni/patch-1 2022-03-20 08:50:15 +00:00
Koni
2b01582a4f
typos 2022-03-20 08:19:22 +01:00
Night Kaly
e0591f36dc useless 2022-03-19 19:46:12 +00:00
night0721
8b7930983e fixed bugs 2022-03-20 00:45:36 +08:00
night0721
a1efe58621 added sensitivity command and added now scam links 2022-03-20 00:45:19 +08:00
night0721
a84539f12c Merge branch 'main' of https://github.com/night0721/cath.exe 2022-03-14 03:15:56 +08:00
Night Kaly
5712beba88
Merge pull request #60 from night0721/dev
Dev
2022-03-13 19:15:40 +00:00
night0721
02c697f71f Merge branch 'dev' 2022-03-14 03:15:16 +08:00
night0721
98bd127e5e . 2022-03-14 03:15:09 +08:00
night0721
d5efd6a7cf simplify 2022-03-14 03:07:05 +08:00
ThunderE75
eb491b23a7
Added Apex Sensitivity 2022-03-10 23:27:40 +05:30
night0721
cc672c163b debug 2022-03-03 02:37:05 +08:00
ThunderE75
afc8d458ed
Updated Readme 2022-03-02 22:51:43 +05:30
night0721
ca5813d12c use less files and fix footer 2022-03-02 22:37:01 +08:00
night0721
182c2a21d6 Merge branch 'main' 2022-03-02 19:13:34 +08:00
night0721
b61b6887c4 update and fix, loadout command 2022-03-02 19:12:53 +08:00
Night Kaly
ac6012db66
Merge pull request #59 from night0721/dev
Dev
2022-03-02 11:12:15 +00:00
Night Kaly
66fd017928
Merge pull request #56 from night0721/dependabot/npm_and_yarn/axios-0.26.0
Bump axios from 0.25.0 to 0.26.0
2022-03-02 11:09:45 +00:00
dependabot[bot]
dcd45778f3
Bump axios from 0.25.0 to 0.26.0
Bumps [axios](https://github.com/axios/axios) from 0.25.0 to 0.26.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.25.0...v0.26.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 11:08:20 +00:00
ThunderE75
5165739b7b
Some Apex stuff 2022-03-02 14:35:43 +05:30
ThunderE75
a6a13af8af
Added New Weapons & Attchments 2022-03-02 14:24:39 +05:30
220 changed files with 27395 additions and 37408 deletions

View file

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

2
.gitattributes vendored
View file

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

View file

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

View file

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

5
.github/PRIVACY_POLICY.md vendored Normal file
View file

@ -0,0 +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.**

222
.github/README.md vendored
View file

@ -1,113 +1,109 @@
<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=800966959268364288&permissions=4231314550&scope=bot%20applications.commands" target="_blank"><img alt='Invite' src="https://img.shields.io/badge/-Invite-5865f2?logo=discord&logoColor=white&style=for-the-badge"></a>
<a href= "https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank"><img alt='Licence CC BY-NC-SA 4.0' src ="https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc-sa.svg" width="82">
<a href="https://trello.com/b/dIgR0QNm" target="_blank"><img alt='Trello' src="https://img.shields.io/badge/Trello-5865F2?style=for-the-badge&logo=trello&logoColor=white"></a>
<a href="https://github.com/night0721/cath"><img alt = 'NPM Package' src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white">
<a href="https://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 **Round Table** by Cygnoux Familia.<br><br>
If you like this bot, feel free to :star: **Star** this repository.<br>
> ⚠ The Verifed bot instance is current called Cath.exe, we are working on getting it changed
> <br>
# Features
> _This is a Non-Exhaustive list for commands. To access the full list of commands, check out our [Documentation](https://thunder75.gitbook.io/cath-bot/core/commands)._
<a href="https://thunder75.gitbook.io/cath-bot/core/commands" ><img src="https://img.shields.io/static/v1?label=List %20OF&message=Commands&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
🚨 **Moderation** - Classic commands like kick, ban, warn, role and many more. <br>
📈 **Economy** - A Robust economy system, inspired by **pepe bot** <br>
**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 **Lighthouse v2.1**
> Will soon be using stats provided by **Stats On Duty**.
- **Currated Gunsmith Builds** by various content creators like Jokesta, dHitman, Path.exe and more comming soon.
- **Perks** detailed info about the perks.
- **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.
## 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://discord.gg/SbQHChmGcp" target="_blank"><img alt="NYX_banner" src = "https://media.discordapp.net/attachments/896078559293104128/896091759157858394/nyx_banner_3d.png?width=1341&height=447"></a>
<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://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://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=API&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<img src ="https://forthebadge.com/images/badges/built-with-love.svg" width = "122">
</p>
<p 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.exe/badge?s=57e6f566f73892f4303edbfeb2fe3ea0b849c876&style=for-the-badge)](https://www.codefactor.io/repository/github/night0721/cath.exe)
[YouTube Deployment video](https://www.youtube.com/watch?v=9Dmtuv6tlTE)
<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>
![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)
</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)
<img src="https://socialify.git.ci/night0721/cath.exe/image?description=1&descriptionEditable=A%20Discord.js%20v13%20Template%20based%20on%20cath.exe&font=Raleway&forks=1&issues=1&language=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Dark">

5
.github/TOS.md vendored Normal file
View file

@ -0,0 +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.

View file

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

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

1111
LICENSE

File diff suppressed because it is too large Load diff

View file

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

View file

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

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,2 +0,0 @@
const { CodeClient } = require("cath");
module.exports = new CodeClient();

View file

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

View file

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

View file

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

View file

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

File diff suppressed because it is too large Load diff

View file

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

74
command/CODM/loadout.js Normal file
View file

@ -0,0 +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];
}
}
},
};

View file

@ -1,195 +1,198 @@
const { MessageEmbed } = require("discord.js");
const c = require("../../client/CODMClient");
module.exports = {
name: "perk",
description: "Get perk stats",
type: "CHAT_INPUT",
usage: "{Perk}",
category: "CODM",
options: [
{
type: "SUB_COMMAND",
name: "red",
description: "Red Perk",
options: [
{
type: 3,
name: "perk",
description: "Perk",
required: true,
choices: [
{
name: "Fast Recover",
value: "fastrecover",
},
{
name: "Persistence",
value: "persistence",
},
{
name: "Flak Jacket",
value: "flakjacket",
},
{
name: "Skulker",
value: "skulker",
},
{
name: "Agile",
value: "agile",
},
{
name: "Lightweight",
value: "lightweight",
},
{
name: "Restock",
value: "restock",
},
{
name: "Tactician",
value: "tactician",
},
{
name: "Overclock",
value: "overclock",
},
{
name: "Martydom",
value: "martydom",
},
{
name: "Iron Lungs",
value: "ironlungs",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "green",
description: "Green Perk",
options: [
{
type: 3,
name: "perk",
description: "Perk",
required: true,
choices: [
{
name: "Vulture",
value: "vulture",
},
{
name: "Toughness",
value: "toughness",
},
{
name: "Tracker",
value: "tracker",
},
{
name: "Ghost",
value: "ghost",
},
{
name: "Cold Blooded",
value: "coldblooded",
},
{
name: "Hardwired",
value: "hardwired",
},
{
name: "Quick Fix",
value: "quickfix",
},
{
name: "Amped",
value: "amped",
},
{
name: "Recon",
value: "recon",
},
{
name: "Gung Ho",
value: "gungho",
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "blue",
description: "Blue Perk",
options: [
{
type: 3,
name: "perk",
description: "Perk",
required: true,
choices: [
{
name: "Hardline",
value: "hardline",
},
{
name: "Demo Expert",
value: "demoexpert",
},
{
name: "Tactical Mask",
value: "tacticalmask",
},
{
name: "Alert",
value: "alert",
},
{
name: "Engineer",
value: "engineer",
},
{
name: "Dead Silence",
value: "deadsilence",
},
{
name: "Shrapnel",
value: "shrapnel",
},
{
name: "High Alert",
value: "highalert",
},
{
name: "Launcher Plus",
value: "launcherplus",
},
],
},
],
},
],
run: async (client, interaction, args) => {
const val = args[1];
const d = await c.getperk(val);
const embed = new MessageEmbed()
.setColor(
d.type == "green"
? "09654a"
: d.type == "red"
? "8a0a0a"
: d.type == "blue"
? "1047a4"
: client.color
)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setTitle(d.perk)
.addField("Effects", d.effects);
interaction.followUp({ embeds: [embed] });
},
};
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,170 +1,169 @@
const { MessageEmbed } = require("discord.js");
const c = require("../../client/CODMClient");
module.exports = {
name: "scorestreak",
description: "Get Scorestreak stats",
type: "CHAT_INPUT",
usage: "{Scorestreak}",
category: "CODM",
options: [
{
type: "SUB_COMMAND",
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: "SUB_COMMAND",
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 MessageEmbed()
.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(),
})
.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,301 +1,297 @@
const common = require("../../util/functions/common");
const data = require("../../util/Data/data.json");
const { MessageEmbed } = require("discord.js");
let currGun,
currStats,
currAttachments,
currRecoilArr,
currDRM,
interpretion,
recoilAvailable,
chart,
hasError;
const errMsg = "*Generic placeholder error message*";
module.exports = {
name: "stats",
description: "Check gun stats",
usage: "(Gun)",
category: "CODM",
options: [
{
type: 3,
name: "gun_name",
description: "Name of the gun",
required: true,
choices: [],
},
{
type: 3,
name: "1st_attchment",
description: "First attachment",
},
{
type: 3,
name: "2nd_attchment",
description: "Second attachment",
},
{
type: 3,
name: "3rd_attchment",
description: "Third attachment",
},
{
type: 3,
name: "4th_attchment",
description: "Forth attachment",
},
{
type: 3,
name: "5th_attchment",
description: "Fifth attachment",
},
],
run: async (client, interaction, args) => {
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}**` });
} 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 MessageEmbed(repEmb)] });
}
},
};
function inpHandler(inpmsg) {
statsHandler(inpmsg.split("+")[0]);
}
function statsHandler(inpmsg) {
let statsNames = [
"Pellets",
"Detonation Range",
"Explosion Radius",
"Explosion Damage",
"Firing Mode",
"Rate of Fire",
"Bullet in Burst",
"Time Between Burst",
"Bullet Speed",
"Penetration Level",
"Bullet Spread",
"Idle Sway",
"Hipfire Pellet Spread",
"ADS Pellet Spread",
"ADS Time",
"Sprint-to-Fire Time",
"ADS Zoom",
"Magazine",
"Reserve",
"Reload Type",
"Cancel Reload Time",
"Reload Time",
"Full Reload Time",
"Drop Time",
"Raise Time",
"Sprinting Speed",
"Walking Speed",
"Straifing Speed",
"Damage per Tick",
"Number of Ticks",
"Time Between Ticks",
"Breath Hold Time",
"shouldNeverHappen0",
"shouldNeverHappen1",
"shouldNeverHappen2",
"shouldNeverHappen3",
"shouldNeverHappen4",
],
out = [];
currGun = common.weaponIdentifier(inpmsg);
if (typeof currGun == "string") {
hasError = true;
return currGun;
}
currStats = currGun.stats;
currDRM = currGun.drm[0];
currAttachments = [];
currAttachments = common.attachmentsIdentifier(inpmsg, currGun);
if (typeof currAttachments == "string") {
hasError = true;
return currAttachments;
}
currRecoilArr = [1, 1, currGun.stats[17]];
if (currAttachments.length != 0) {
const totalEffects = common.totaler(currAttachments);
currStats = common.updateStatswithEffects(totalEffects, currStats);
currRecoilArr = [totalEffects[2], totalEffects[3], currGun.stats[17]]; // must happen after currStats update
currDRM = currGun.drm[totalEffects[37]];
currDRM.range = currDRM.range.map(x =>
Math.round(x * (1 + totalEffects[13] / 100))
);
out = common.attachmentHandler(totalEffects, currStats);
}
function statsWorker() {
if (currStats[19] === 2) {
currStats[21] =
currStats[20] + currStats[21] * currStats[17] + currStats[22];
currStats[20] = 0;
currStats[22] = 0;
}
currStats[25] = (currStats[25] * currStats[26]) / 100;
const outReady = currStats.map((x, i) =>
x ? statsNames[i].padEnd(24) + ":".padEnd(3) + beautifier(i) : ""
);
out = [
...[
"Basic Stats",
"ADS Stats",
"Bullet Stats",
"Magazine",
"Handling Stats",
"Mobility Stats",
"Miscellaneous Stats",
].map((x, i) =>
fieldMaker(
x,
[
[04, 05, 09],
[14, 16, 11, 31],
[00, 06, 07, 08, 10, 12, 13],
[17, 18, 19, 20, 21, 22],
[23, 24],
[25, 26, 27, 15],
[28, 29, 30, 01, 02, 03],
][i]
)
),
...out,
];
function fieldMaker(inpName, inpIndx) {
inpIndx = inpIndx.filter(x => outReady[x]);
return inpIndx.length
? {
name: "**" + inpName + "**",
value: "```\n" + inpIndx.map(x => outReady[x]).join("\n") + "```",
}
: "";
}
}
statsWorker();
function beautifier(j) {
switch (j) {
case 04:
return data.firingModes[currStats[j] - 1];
case 09:
return data.penetrationLevels[currStats[j] - 1];
case 19:
return data.reloadTypes[currStats[j] - 1];
case 08:
if (currStats[j] == -1) {
return "Infinity";
} else {
return parseFloat(currStats[j].toFixed(2)).toString() + " m/s";
}
case 03:
return parseFloat(currStats[j].toFixed(2))
.toString()
.replace(".", " ~ ");
default:
return parseFloat(currStats[j].toFixed(2)).toString() + addUnit(j);
}
function addUnit(j) {
switch (j) {
case 07:
case 14:
case 15:
case 23:
case 24:
case 31:
return " ms";
case 27:
case 28:
case 25:
case 26:
return " m/s";
case 20:
case 21:
case 22:
return " s";
case 16:
return "%";
case 06:
return " Rounds";
case 05:
return " RPM";
default:
return "";
}
}
}
interpretion = currGun.gunname + common.interpretioner(currAttachments);
if (currGun.recoil.hr.length > 2) {
chart = common.recoilHandler(
currGun.recoil.hr,
currGun.recoil.vr,
currRecoilArr[0],
currRecoilArr[1],
currRecoilArr[2]
);
recoilAvailable = true;
} else {
recoilAvailable = false;
}
if (chart == "none") {
recoilAvailable = false;
}
if (chart == "err" || currAttachments == "err") {
hasError = true;
return "Cocaineeee";
}
const dmg =
common.damageHandler(
currDRM.damage,
currDRM.range,
1,
100,
60000 / currStats[5],
currStats[7],
currStats[6],
currStats[0]
) || "```This should never happen```";
out = [
currGun.description
? {
name: "**Description:**",
value: "```\n" + currGun.description + "```",
}
: {},
{ name: "**Damage Profile:**", value: dmg },
...out,
];
out = out.filter(x => x.value);
return {
title: interpretion,
color: 5814783,
fields: out,
footer: {
text: "[OUTDATED] All data courtesy of Project Lighthouse 2.0 and CoDM Research Crew",
icon_url:
"https://media.discordapp.net/attachments/735590814662656102/806960573753327657/cc.png",
},
};
}
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,106 +0,0 @@
const axios = require("axios");
const { MessageAttachment } = require("discord.js");
module.exports = {
name: "watermark",
description: "Add a water to leaks",
options: [
{
type: 3,
name: "photo",
description: "Link of photo",
required: true,
},
{
type: 3,
name: "position",
description: "Where you want to place the water mark",
required: true,
choices: [
{
name: "Middle",
value: "middle",
},
{
name: "ButtomRight",
value: "buttomright",
},
],
},
{
type: 3,
name: "opacity",
description:
"Opacity of watermark(50 - 100) Lower or higher will be ignored",
required: true,
},
{
type: 3,
name: "logo",
description: "The Logo you want to use",
required: true,
choices: [
{
name: "Discord Nicecat",
value: "discord_nicecat",
},
{
name: "NoLink Leakers",
value: "nolink_leakers",
},
{
name: "Discord Leakers",
value: "discord_leakers",
},
{
name: "DogeBeanie",
value: "doge",
},
{
name: "CODM N3W3",
value: "n3w3",
},
{
name: "Alyan Gaming",
value: "alyan",
},
{
name: "Murdablast",
value: "murdablast",
},
{
name: "Sasha",
value: "sasha",
},
{
name: "Umair Gamer",
value: "umair",
},
],
},
{
type: 3,
name: "password",
description: "The password in order to use this command",
required: true,
},
],
run: async (client, interaction, args) => {
const data = await axios
.get(
`${process.env.api}/api/v1/codm/watermark?photo=${args[0]}&position=${args[1]}&opacity=${args[2]}&logo=${args[3]}&password=${args[4]}`
)
.then(res => res.data)
.catch();
if (!data) {
interaction.followUp({
content: "You have either wrong input or you are unauthorized",
});
} else {
const ima = new MessageAttachment(
`${process.env.api}/api/v1/codm/watermark?photo=${args[0]}&position=${args[1]}&opacity=${args[2]}&logo=${args[3]}&password=${args[4]}`,
`${args[2]}.png`
);
interaction.followUp({ files: [ima] });
}
},
};

View file

@ -1,124 +1,128 @@
const { MessageEmbed } = 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") == true) {
if (guild.Premium == true) {
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 MessageEmbed()
.setTitle("Success!")
.setDescription(
`Premium added to **${interaction.guild.name}**! \n`
)
.setFooter("Thank you for supporting Cath!")
.setColor("GREEN")
.setTimestamp()
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true })
),
],
});
client.channels.cache.get(client.config.ServerLog).send({
embeds: [
new MessageEmbed()
.setTitle("New Premium Server")
.addField(
"Server Info",
`**>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 == false) {
interaction.followUp({ content: "This server isn't premium yet" });
}
if (!user.PremiumServers.includes(interaction.guild.id)) {
interaction.followUp({
content:
"You can't remove due to you aren't the person who made the server premium",
});
} else {
await client.data.setPremium(interaction.guild.id, "false");
await client.data.pushGuild(
interaction.user.id,
interaction.guild.id,
"splice"
);
interaction.followUp({
embeds: [
new MessageEmbed()
.setTitle("Removed!")
.setDescription(
`Premium removed from **${interaction.guild.name}**! \n`
)
.setColor("RED")
.setTimestamp()
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true })
),
],
});
client.channels.cache.get(client.config.ServerLog).send({
embeds: [
new MessageEmbed()
.setTitle("Premium Server Removed")
.addField(
"Server Info",
`**>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,537 +1,246 @@
const starboardClient = require("../../client/StarboardClient");
const { MessageEmbed } = require("discord.js");
const fs = require("fs");
module.exports = {
name: "settings",
description: "Configure settings for the server",
UserPerms: ["ADMINISTRATOR"],
category: "Config",
options: [
{
type: "SUB_COMMAND",
name: "muterole",
description: "Configure mute role settings for the server",
options: [
{
type: 8,
name: "role",
description: "The role for muted users",
required: true,
},
],
},
{
type: "SUB_COMMAND",
name: "prefix",
description: "Configure prefix settings for the server",
options: [
{
type: 3,
name: "prefix",
description: "The prefix for the server",
required: true,
choices: [],
},
],
},
{
type: "SUB_COMMAND",
name: "welcome",
description: "Configure welcome channel settings for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for welcome messages",
required: true,
channelTypes: ["GUILD_TEXT"],
},
],
},
{
type: "SUB_COMMAND",
name: "goodbye",
description: "Configure goodbye channel settings for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for goodbye messages",
required: true,
channelTypes: ["GUILD_TEXT"],
},
],
},
{
type: "SUB_COMMAND",
name: "starboard",
description: "Configure starboard channel settings for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for starboard messages",
required: true,
channelTypes: ["GUILD_TEXT"],
},
{
type: 4,
name: "starcount",
description: "The required amount of star to trigger the starboard",
required: true,
},
],
},
{
type: "SUB_COMMAND",
name: "chatbot",
description: "Configure chatbot channel settings for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for chatbotmessages",
required: true,
channelTypes: ["GUILD_TEXT"],
},
],
},
{
type: "SUB_COMMAND",
name: "log",
description: "Configure log channel settings for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for log messages",
required: true,
channelTypes: ["GUILD_TEXT"],
},
],
},
{
type: 2,
name: "enable",
description: "Enable commands/category for the server",
options: [
{
type: "SUB_COMMAND",
name: "command",
description: "To enable commands",
options: [
{
type: 3,
name: "name",
description: "The command name to be enabled",
required: true,
},
],
},
{
type: "SUB_COMMAND",
name: "category",
description: "To enable categories",
options: [
{
type: 3,
name: "name",
description: "The category name to be enabled",
required: true,
choices: [
{
name: "codm",
value: "CODM",
},
{
name: "config",
value: "Config",
},
{
name: "economy",
value: "Economy",
},
{
name: "fun",
value: "Fun",
},
{
name: "information",
value: "Information",
},
{
name: "moderation",
value: "Moderation",
},
{
name: "utilities",
value: "Utilities",
},
],
},
],
},
],
},
{
type: 2,
name: "disable",
description: "Disable commands/category for the server",
options: [
{
type: "SUB_COMMAND",
name: "command",
description: "To disable commands",
options: [
{
type: 3,
name: "name",
description: "The command name to be disabled",
required: true,
},
],
},
{
type: "SUB_COMMAND",
name: "category",
description: "To disable categories",
options: [
{
type: 3,
name: "name",
description: "The category name to be disabled",
required: true,
choices: [
{
name: "codm",
value: "CODM",
},
{
name: "config",
value: "Config",
},
{
name: "economy",
value: "Economy",
},
{
name: "fun",
value: "Fun",
},
{
name: "information",
value: "Information",
},
{
name: "moderation",
value: "Moderation",
},
{
name: "utilities",
value: "Utilities",
},
],
},
],
},
],
},
{
type: "SUB_COMMAND",
name: "level",
description: "Configure level settings for the server",
options: [
{
type: 5,
name: "choice",
description: "Set whether level system is activated for the server",
required: true,
},
],
},
{
type: "SUB_COMMAND",
name: "nsfw",
description: "Configure nsfw settings for the server",
options: [
{
type: 5,
name: "choice",
description: "Set whether NSFW commands are activated for the server",
required: true,
},
],
},
{
type: "SUB_COMMAND",
name: "tips",
description: "Configure tips settings for the server",
options: [
{
type: 5,
name: "choice",
description: "Set whether tips system is activated for the server",
required: true,
},
],
},
{
type: "SUB_COMMAND",
name: "overall",
description: "See overall settings for the server",
options: [],
},
],
run: async (client, interaction, args, utils, data) => {
if (args[0].toLowerCase() === "muterole") {
const role = interaction.guild.roles.cache.get(args[1]);
if (role.managed) {
interaction.followUp({ content: "You must provide a non bot role" });
} else {
await client.data.setMuterole(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${role.name}** as the mute role`,
});
}
} else if (args[0].toLowerCase() === "prefix") {
await client.data.setPrefix(interaction.guild.id, args[1]);
interaction.followUp({ content: `Saved \`${args[2]}\` as the prefix` });
} else if (args[0].toLowerCase() === "welcome") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
await client.data.setWelcome(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the welcome channel`,
});
}
} else if (args[0].toLowerCase() === "goodbye") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
await client.data.setGoodbye(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the goodbye channel`,
});
}
} else if (args[0].toLowerCase() === "starboard") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
starboardClient.config.guilds.add({
id: interaction.guild.id,
options: {
starCount: args[2],
starboardChannel: args[1],
},
});
await client.data.setStarboard(interaction.guild.id, args[1], args[2]);
interaction.followUp({
content: `Saved **${channel}** as the starboard channel`,
});
}
} else if (args[0].toLowerCase() === "chatbot") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
await client.data.setChatbot(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the chatbot channel`,
});
}
} else if (args[0].toLowerCase() === "log") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
let webhookid;
let webhooktoken;
await channel
.createWebhook(interaction.guild.name, {
avatar: interaction.guild.iconURL({ format: "png" }),
})
.then(webhook => {
webhookid = webhook.id;
webhooktoken = webhook.token;
});
await client.data.setLog(
interaction.guild.id,
channel.id,
webhookid,
webhooktoken
);
interaction.followUp({
content: `Saved **${channel}** as the log channel`,
});
}
} else if (args[0].toLowerCase() === "level") {
if (args[1]) {
await client.data.setGLevel(interaction.guild.id, "true");
interaction.followUp({
content: `Levelling is enabled in this server now.`,
});
} else {
await client.data.setGLevel(interaction.guild.id, "false");
interaction.followUp({
content: `Levelling is disabled in this server now.`,
});
}
} else if (args[0].toLowerCase() === "nsfw") {
if (args[1]) {
await client.data.setNSFW(interaction.guild.id, "true");
interaction.followUp({
content: `NSFW is enabled in this server now.`,
});
} else {
await client.data.setNSFW(interaction.guild.id, "false");
interaction.followUp({
content: `NSFW is disabled in this server now.`,
});
}
} else if (args[0].toLowerCase() === "tips") {
if (args[1]) {
await client.data.setTips(interaction.guild.id, "true");
interaction.followUp({
content: `Tips is enabled in this server now.`,
});
} else {
await client.data.setTips(interaction.guild.id, "false");
interaction.followUp({
content: `Tips is disabled in this server now.`,
});
}
} else if (args[0].toLowerCase() === "enable") {
const type = args[1].toLowerCase();
const name = args[2].toLowerCase();
if (type === "command") {
if (!!client.slashCommands.get(name) === false) {
interaction.followUp({
content: `There isn't any command/category named \`${name}\``,
});
} else if (!data.Guild.Commands.includes(name)) {
interaction.followUp({
content: `\`${args[2]}\` command had already been enabled`,
});
} else if (
data.Guild.Commands.includes(name) &&
!!client.slashCommands.get(name) === true
) {
await client.data.enable(interaction.guild.id, "command", name);
interaction.followUp({
content: `\`${args[2]}\` command is now enabled`,
});
}
}
if (type === "category") {
const category = fs.readdirSync("./command");
if (!data.Guild.Category.includes(args[2])) {
interaction.followUp({
content: `\`${args[2]}\` category had already been enabled`,
});
}
if (
data.Guild.Category.includes(args[2]) &&
category.includes(args[2])
) {
await client.data.enable(interaction.guild.id, "category", args[2]);
interaction.followUp({
content: `\`${args[2]}\` category is now enabled`,
});
}
}
} else if (args[0].toLowerCase() === "disable") {
const type = args[1].toLowerCase();
const name = args[2].toLowerCase();
if (type === "command") {
if (!!client.slashCommands.get(name) === false) {
interaction.followUp({
content: `There isn't any command/category named \`${name}\``,
});
} else if (data.Guild.Commands.includes(name)) {
interaction.followUp({
content: `\`${args[2]}\` command had already been disabled`,
});
} else if (
!data.Guild.Commands.includes(name) &&
!!client.slashCommands.get(name) === true
) {
await client.data.disable(interaction.guild.id, "command", name);
interaction.followUp({
content: `\`${args[2]}\` command is now disabled`,
});
}
}
if (type === "category") {
const category = fs.readdirSync("./command");
if (data.Guild.Category.includes(args[2])) {
interaction.followUp({
content: `\`${args[2]}\` category had already been disabled`,
});
}
if (
!data.Guild.Category.includes(args[2]) &&
category.includes(args[2])
) {
await client.data.disable(interaction.guild.id, "category", args[2]);
interaction.followUp({
content: `\`${args[2]}\` category is now disabled`,
});
}
}
} else {
const d = `
**Mute Role**: ${
interaction.guild.roles.cache.get(data.Guild.Muterole)
? interaction.guild.roles.cache.get(data.Guild.Muterole)
: "None"
}
**Prefix**: ${data.Guild.Prefix ? data.Guild.Prefix : "C."}
**Welcome Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Welcome)
? interaction.guild.channels.cache.get(data.Guild.Welcome)
: "None"
}
**Goodbye Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Goodbye)
? interaction.guild.channels.cache.get(data.Guild.Goodbye)
: "None"
}
**Starboard Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Starboard)
? interaction.guild.channels.cache.get(data.Guild.Starboard)
: "None"
}
**Chatbot Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Chatbot)
? interaction.guild.channels.cache.get(data.Guild.Chatbot)
: "None"
}
**Log Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Log)
? interaction.guild.channels.cache.get(data.Guild.Log)
: "None"
}
**Level**: ${data.Guild.Level ? "Enable" : "Disabled"}
**NSFW**: ${data.Guild.NSFW ? "Enable" : "Disabled"}
**Tips**: ${data.Guild.Tips ? "Enable" : "Disabled"}
**Disabled Commands**: ${
data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None"
}
**Disabled Categories**: ${
data.Guild.Category.length ? data.Guilds.Category.join(",") : "None"
}
`;
const embed = new MessageEmbed()
.setTitle(`**${interaction.guild.name}** Settings`)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setDescription(d);
interaction.followUp({ embeds: [embed] });
}
},
};
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,29 +0,0 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "balance",
description: "Show an user's balance",
usage: "(User)",
category: "Economy",
options: [
{
type: 6,
name: "user",
description: "The user you want to see",
required: false,
},
],
type: "CHAT_INPUT",
run: async (client, interaction, args) => {
const user =
interaction.guild.members.cache.get(args[0]) || interaction.member;
const bal = await client.bal(user.id);
const embed = new MessageEmbed()
.setTitle(`${user.displayName}'s Balance`)
.setDescription(`**${bal}** ${client.currency}`)
.setColor(client.color)
.setURL(client.web)
.setTimestamp()
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL());
interaction.followUp({ embeds: [embed] });
},
};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,67 +0,0 @@
const { MessageEmbed } = require("discord.js");
const inv = require("../../models/econ");
const { Pagination } = require("cath");
const items = require("../../util/Data/item.json");
module.exports = {
name: "inventory",
description: "Check the inventory of an user",
usage: "{User}",
category: "Economy",
timeout: 5000,
options: [
{
type: 6,
name: "user",
description: "The user you want to see",
required: false,
},
],
run: async (client, interaction, args) => {
const util = new Pagination();
const user =
interaction.guild.members.cache.get(args[0]) || interaction.member;
inv.findOne({ User: user.id }, async (err, data) => {
if (data) {
if (!data.Inventory) {
return interaction.followUp({
content: `User doesn't have any data`,
});
}
const mappedData = Object.keys(data.Inventory)
.map(key => {
if (data.Inventory[key] == 0) {
return;
} else {
const name = items.find(val => val.dbname === key).name;
const emoji = items.find(val => val.dbname === key).emoji;
const type = items.find(val => val.dbname === key).type;
return `\n**${emoji}${name}** — ${data.Inventory[key]}\n **Type**: \`${type}\``;
}
})
.filter(e => e !== undefined);
if (mappedData.length == 0) {
return interaction.followUp({
content: `User doesn't have any data`,
});
}
const c = util.chunk(mappedData, 5).map(x => x.join("\n"));
const embed = new MessageEmbed()
.setTimestamp()
.setTitle(`${user.displayName}'s inventory`)
.setColor(client.color)
.setDescription(c[0])
.setFooter(`Page 1 of ${c.length}`);
try {
const msg = await interaction.followUp({ embeds: [embed] });
if (mappedData.length > 5) {
await util.pagination(msg, interaction.user, c);
}
} catch (e) {
console.log(e);
}
} else {
return interaction.followUp({ content: `User doesn't have any data` });
}
});
},
};

View file

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

View file

@ -1,49 +0,0 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "profile",
usage: "(User)",
description: "Check an user economy profile",
type: "CHAT_INPUT",
options: [
{
type: 6,
name: "user",
description: "The user you want to see",
required: false,
},
],
run: async (client, interaction, args) => {
const user =
interaction.guild.members.cache.get(args[0]) || interaction.member;
const bjwin = await client.bjWin(user.user.id);
const swin = await client.sWin(user.user.id);
const bwin = await client.bWin(user.user.id);
const cmdused = await client.cmdsUSED(user.user.id);
const bal = await client.bal(user.user.id);
const multi = await client.multi(interaction);
const game = new MessageEmbed()
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setColor("7196ef")
.setTitle(`${user.displayName}'s profile`)
.setDescription(`Current Balance ${bal} ${client.currency}`)
.setURL(client.web)
.addFields(
{
name: "Basic",
value: `
Total Commands Used \`${cmdused}\`\n
${client.xp} Multiplier \`${`1.${multi}x`}\``,
inline: true,
},
{
name: "🎊 Wins",
value: `Overall \`${bjwin + swin + bwin}\`
🃏 Blackjack \`${bjwin}\`\n
🎰 Slots \`${swin}\`\n
🕹 Bets \`${bwin}\`\n`,
inline: true,
}
);
interaction.followUp({ embeds: [game] });
},
};

View file

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

View file

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

View file

@ -1,124 +0,0 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "slots",
usage: "(Number)",
timeout: 5000,
description: "Win more coins by slots",
category: "Economy",
options: [
{
type: 4,
name: "cp",
description: "The number of CP you want to slots",
required: true,
},
],
run: async (client, interaction, args) => {
const max = 100000;
const slots = [
"<:blushca:852174555513618502>",
"<:abusecat:853501068074942464>",
"<:dumbcat:855462498550415362>",
];
const slotOne = slots[Math.floor(Math.random() * slots.length)];
const slotTwo = slots[Math.floor(Math.random() * slots.length)];
const slotThree = slots[Math.floor(Math.random() * slots.length)];
const slotfour = slots[Math.floor(Math.random() * slots.length)];
const slotfive = slots[Math.floor(Math.random() * slots.length)];
const slotsix = slots[Math.floor(Math.random() * slots.length)];
const slotseven = slots[Math.floor(Math.random() * slots.length)];
const sloteight = slots[Math.floor(Math.random() * slots.length)];
const slotnine = slots[Math.floor(Math.random() * slots.length)];
const ar = [1.3, 1.5, 1.7, 1.9, 2.1, 2.3, 2.5, 2.7, 2.9, 3.1, 3.3, 3.5];
const r = ar[Math.floor(Math.random() * ar.length)];
let amt = args[0];
if (amt > max) amt = max;
if (amt < 100) {
interaction.followUp({
content: `You need to slot at least 100${client.currency}`,
});
} else if ((await client.bal(interaction.user.id)) < amt) {
interaction.followUp({ content: "You don't have enough balance" });
} else if (
(slotOne === slotTwo && slotOne === slotThree) ||
(slotfour === slotfive && slotfour === slotsix) ||
(slotseven === sloteight && slotseven === slotnine)
) {
const winamt = Math.round(r * amt);
const multi = (await client.multi(interaction)) / 10 + 1;
await client.add(interaction.user.id, winamt, interaction);
await client.ADDSWin(interaction.user.id);
const won = new MessageEmbed()
.setColor("GREEN")
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.addField(
"|-----|-----|----|",
`| ${slotfour} | ${slotfive} | ${slotsix} |`
)
.addField(
"|-----|-----|----|",
`| ${slotOne} | ${slotTwo} | ${slotThree} |`
)
.addField(
"|-----|-----|----|",
`| ${slotseven} | ${sloteight} | ${slotnine} |`
)
.setTitle(`${interaction.user.username} wins a slots game`)
.addFields(
{
name: "Won",
value: `**${Math.round(winamt * multi)}**${client.currency}`,
inline: true,
},
{
name: "New Balance",
value: `**${Math.round(
(await client.bal(interaction.user.id)) + winamt * multi
)}**${client.currency}`,
inline: true,
},
{
name: "Multiplier",
value: `x${r + multi}`,
inline: true,
}
);
interaction.followUp({ embeds: [won] });
} else {
await client.rmv(interaction.user.id, amt);
const lost = new MessageEmbed()
.setColor("RED")
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.addField(
"|-----|-----|----|",
`| ${slotfour} | ${slotfive} | ${slotsix} |`
)
.addField(
"|-----|-----|----|",
`| ${slotOne} | ${slotTwo} | ${slotThree} |`
)
.addField(
"|-----|-----|----|",
`| ${slotseven} | ${sloteight} | ${slotnine} |`
)
.setTitle(`${interaction.user.username} loses a slots game`)
.addFields(
{
name: "Lost",
value: `**${amt}**${client.currency}`,
inline: true,
},
{
name: "New Balance",
value: `**${
parseInt(await client.bal(interaction.user.id)) - amt
}**${client.currency}`,
inline: true,
}
);
interaction.followUp({ embeds: [lost] });
}
},
};

View file

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

View file

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

View file

@ -1,23 +0,0 @@
const axios = require("axios");
module.exports = {
name: "ascii",
description: "Converts text into ASCII art",
category: "Fun",
type: "CHAT_INPUT",
options: [
{
type: 3,
name: "text",
description: "The text you want to convert",
required: true,
},
],
run: async (client, interaction, args) => {
const data = await axios
.get(
`https://artii.herokuapp.com/make?text=${encodeURIComponent(args[0])}`
)
.then(res => res.data);
interaction.followUp(`\`\`\`${data}\`\`\``);
},
};

View file

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

View file

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

View file

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

View file

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

View file

@ -1,30 +0,0 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "simprate",
description: "Check how simp is the user",
usage: "(@User)",
category: "Fun",
options: [
{
type: 6,
name: "user",
description: "The user you want to see",
required: true,
},
],
run: async (client, interaction, args) => {
const simp = Math.floor(Math.random() * 100);
const user = interaction.guild.members.cache.get(args[0]);
interaction.followUp({
embeds: [
new MessageEmbed()
.setTitle(`${user.user.username}'s simp rate`)
.setDescription(`${user.user.username} is a ${simp}% simp`)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp(),
],
});
},
};

View file

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

View file

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

View file

@ -1,49 +1,50 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "avatar",
description: "Show user's avatar in different formats",
type: "CHAT_INPUT",
usage: "{User}",
category: "Information",
options: [
{
type: 6,
name: "user",
description: "The user you want to see",
required: false,
},
],
run: async (client, interaction, args) => {
const member =
interaction.guild.members.cache.get(args[0]) || interaction.member;
const embed = new MessageEmbed()
.setAuthor(
member.user.tag,
member.user.displayAvatarURL({ dynamic: true, size: 1024 })
)
.setColor(client.color)
.setTitle(`${member.user.username}'s Avatar`)
.setDescription(
`\`Links:\` **[png](${member.user.displayAvatarURL({
format: "png",
size: 2048,
})}) | [jpg](${member.user.displayAvatarURL({
format: "jpg",
size: 2048,
})}) | [webp](${member.user.displayAvatarURL({
format: "webp",
size: 2048,
})}) | [gif](${member.user.displayAvatarURL({
format: "gif",
size: 2048,
})})**`
)
.setImage(
member.user.avatarURL({ size: 2048, dynamic: true, format: "png" })
)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.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,79 +1,60 @@
const { MessageEmbed, version: djsversion } = require("discord.js");
const version = require("../../../package.json").version;
const { utc } = require("moment");
// const os = require("os");
module.exports = {
name: "botinfo",
description: "Check the info of the bot",
category: "Information",
type: "CHAT_INPUT",
run: async (client, interaction, args, utils) => {
// const core = os.cpus()[0];
const embed = new MessageEmbed()
.setTitle(`NYX - CODM Gunsmith Bot`)
.setURL(
`https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=4231314550&scope=bot%20applications.commands`
)
.setThumbnail(
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
)
.setColor(client.color)
.addFields(
{
name: `General`,
value: `
<:nyx_owner:897418259433943120> Owner <@452076196419600394>
Bot ${client.user.tag}
Bot ID \`${client.user.id}\`
Created on \`${utc(client.user.createdTimestamp).format(
"MMMM Do YYYY"
)}\``,
inline: true,
},
{
name: `Bot Stats`,
value: `
Servers ${client.guilds.cache.size.toLocaleString()}
Users ${client.guilds.cache
.reduce((a, b) => a + b.memberCount, 0)
.toLocaleString()}
Channels \`${client.channels.cache.size.toLocaleString()}\`
Commands \`${client.commands.size}\`
`,
inline: true,
}
)
.addFields(
{
name: `Platform`,
value: `
NYX \`v${version}\`
Discord.js \`v${djsversion}\`
Node.js \`${process.version}\``,
}
// Removed OS Info for troubleshooting.
//
// {
// name: `Hardware`,
// value: `
// Uptime:** ${utils.timer(os.uptime() * 1000, { long: true })}
// Platform:** ${process.platform}
// CPU:**
// \u3000 Cores: ${os.cpus().length}
// \u3000 Model: ${core.model}
// \u3000 Speed: ${core.speed}MHz
// **`,
// inline: true,
// }
)
.addFields({
name: `**${client.author}**`,
value: `**Development Management**\n\u3000Ń1ght#0001\n\u3000Cat drinking a cat#0795\n\u3000mightyful#6536\n\u3000Thunder#2128\n\u3000mobo#9277\n
**Research & Documentation**\n\u3000𝔔𝓻𝔦𝔁𝔖𝔦ӄø#0690\n\u3000Thunder#2128\n
**Website**\n\u3000Chunchunmaru#8570`,
})
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
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,200 +1,204 @@
const Discord = require("discord.js");
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,
},
],
run: async (client, interaction, args, utils) => {
if (!args[0]) {
await interaction.deleteReply();
const emoji = {
CODM: "<a:codm:897030768793104385>",
Config: "<a:config:896990033561669762>",
Economy: client.currency,
Fun: "<a:fun:896889821816053790>",
Moderation: "<:discordmod:897364105730617364>",
Information: "<a:information:894962394932064346>",
Utilities: "<a:utilites:897233087941988392>",
Music: "<a:music:897017864085712936>",
Giveaway: "<a:confetti:896763534682226758>",
NSFW: "🍑",
};
const directories = [
...new Set(client.slashCommands.map(cmd => cmd.directory)),
];
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 Discord.MessageEmbed()
.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](https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=4231314550&scope=bot%20applications.commands)`,
inline: true,
},
{
name: "<:support1:867093614403256350> **Need Help ?**",
value: `[Support Server](https://discord.gg/SbQHChmGcp)`,
inline: true,
},
{
name: "<:YouTube:841186450497339412> **Video Guide**",
value: `[How to use Slash Coammands](https://youtu.be/YSKDu1gKntY)`,
inline: true,
},
{
name: `<:nyx_description:897379659665264650> Documentation`,
value: `[Click here](${client.docs})`,
inline: true,
},
{
name: "<a:booster:896527475063025704> **Premium**",
value: `You can either boost support server or subscribe to developer's team [Ko-Fi](https://ko-fi.com/cathteam) or gift a nitro to one of the developer team.`,
inline: false,
}
)
.setURL(client.docs)
.setThumbnail(
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
)
.setFooter(
`Requested by ${interaction.user.tag}`,
interaction.user.displayAvatarURL({ dynamic: true })
);
const components = state => [
new Discord.MessageActionRow().addComponents(
new Discord.MessageSelectMenu()
.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: "SELECT_MENU",
time: 60000,
});
collector.on("collect", async interaction => {
const [directory] = interaction.values;
const category = categories.find(u => u.directory === directory);
const newembed = new Discord.MessageEmbed()
.setTitle(
`${emoji[directory]} ${directory} Commands ${emoji[directory]}`
)
.setTimestamp()
.setColor(client.color)
.setFooter(`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.followUp({
content: `There isn't any command or category named "${args[0]}"`,
});
} else {
if (command.UserPerms && Array.isArray(command.UserPerms)) {
UserPermissions = command.UserPerms;
} else {
UserPermissions = [command.UserPerms ? command.UserPerms : ""];
}
if (command.BotPerms && Array.isArray(command.BotPerms)) {
BotPermissions = command.BotPerms;
} else {
BotPermissions = [command.BotPerms ? command.BotPerms : ""];
}
const BotPerms = BotPermissions.map(x =>
x
.split("_")
.map(y => y[0] + y.substring(1, y.length).toLowerCase())
.join(" ")
).join(", ");
const UserPerms = UserPermissions.map(x =>
x
.split("_")
.map(y => y[0] + y.substring(1, y.length).toLowerCase())
.join(" ")
).join(", ");
const embed = new Discord.MessageEmbed()
.setTitle(`"${command.name}" command details`)
.addField(
"**Command**:",
command.name ? `\`${command.name}\`` : "N/A"
);
if (command.usage) {
embed.addField("**Usage**:", `\`/${command.name} ${command.usage}\``);
} else {
embed.addField("**Usage**:", `\`/${command.name}\``);
}
if (command.description) {
embed.addField("**Description**:", command.description);
}
if (command.timeout) {
embed.addField("**Cooldown**:", utils.timer(command.timeout));
}
if (command.UserPerms) {
embed.addField("**Required User Permission**:", UserPerms);
}
if (command.BotPerms) {
embed.addField("**Required Bot Permission**:", BotPerms);
}
embed
.setFooter(
`Requested by ${interaction.user.tag}`,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setTimestamp()
.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,32 +1,34 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "ping",
description: "Check bot latency to Discord API",
type: "CHAT_INPUT",
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 MessageEmbed()
.setTitle("<a:pong:897383314405605436> Pong!")
.setAuthor(
`${interaction.user.username}`,
interaction.user.displayAvatarURL()
)
.setDescription(
`\n 📨 • **Message Latency** \`${Math.floor(messageping)}ms\`
\n🛰 **Bot Latency** \`${Math.round(client.ws.ping)}ms\``
)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setColor(
messageping < 350
? "GREEN"
: messageping < 500 && messageping > 350
? "YELLOW"
: "RED"
);
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,132 +1,89 @@
const { MessageEmbed } = require("discord.js");
const moment = require("moment");
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,
},
],
type: "CHAT_INPUT",
run: async (client, interaction, args, utils) => {
const member =
interaction.guild.members.cache.get(args[0]) || interaction.member;
const flags = {
DISCORD_EMPLOYEE: "Discord Staff<:staff:840231971526803467>",
PARTNERED_SERVER_OWNER:
"Partnered Server Owner<:partner:840231939944480829>",
BUGHUNTER_LEVEL_1: "Discord Bug Hunter<:bughunter:840231967600803920>",
BUGHUNTER_LEVEL_2: "Discord Bug Hunter<:bughunterlv2:840231970017771571>",
HYPESQUAD_EVENTS: "HypeSquad Events<:HypeSquad:840231908599922721>",
HOUSE_BRAVERY: "HypeSquad Bravery<:bravery:840231941974655007>",
HOUSE_BRILLIANCE: "HypeSquad Brilliance<:brilliance:840231943764443136>",
HOUSE_BALANCE: "HypeSquad Balance<:balance:840231925876523018>",
EARLY_SUPPORTER: "Early Supporter<:earlysupporter:840231983216984085>",
TEAM_USER: "Team User",
SYSTEM: "System",
VERIFIED_BOT: "Verified Bot<:VerifiedBot:840231982054375425>",
EARLY_VERIFIED_BOT_DEVELOPER:
"Early Verified Bot Developer<:discord_bot_dev:840231906200387666>",
DISCORD_CERTIFIED_MODERATOR: "Discord Certified Moderator",
};
// let status;
// switch (member.presence.status) {
// case "online":
// status = "<:online:840231921123721237>Online";
// break;
// case "dnd":
// status = "<:do_not_disturb:840231907715448842>Do Not Disturb";
// break;
// case "idle":
// status = "<:idle:840231935485149184>Idle";
// break;
// case "offline":
// status = "<:offline:840231954897305620>Offline";
// break;
// }
const x = Date.now() - member.user.createdAt;
const 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 !== undefined && member.nickname !== null
? 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())
.slice(0, -1);
const userFlags = member.user.flags.toArray();
const createdate = moment(member.user.createdAt).format(
"dddd, MMMM Do YYYY, HH:mm:ss"
);
const joindate = moment(member.joinedAt).format(
"dddd, MMMM Do YYYY, HH:mm:ss"
);
// let activities;
// if (member.presence.activities[0] && member.presence.activities[1]) {
// activities = member.presence.activities[1].name;
// } else if (
// member.presence.activities[0] &&
// !member.presence.activities[1]
// ) {
// activities = "None";
// } else activities = "None";
const embed = new MessageEmbed()
.setAuthor(
member.user.tag,
member.user.displayAvatarURL({ dynamic: true, size: 2048 })
)
.setTimestamp()
.setColor(member.displayHexColor || client.color)
.setURL(client.web)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setThumbnail(member.user.displayAvatarURL({ dynamic: true, size: 512 }))
.setColor(member.displayHexColor || client.color)
.addField(
"User",
`** Username:** ${member.user.username}
** Discriminator:** ${member.user.discriminator}
** Nickname:** ${nickname}
** User ID:** ${member.id}
** Badge:** ${
userFlags.length
? userFlags.map(flag => flags[flag]).join(" **|** ")
: "None"
}
** Avatar:** [Link to avatar](${member.user.displayAvatarURL({
dynamic: true,
size: 2048,
})})
** Time Created:** ${createdate} \nSince ${created} day(s) ago
\u200b`
) //* * Status:** ${status}* * Game:** ${activities}
.addField(
"Member",
`** Highest Role:** ${
member.roles.highest.id === interaction.guild.id
? "None"
: member.roles.highest.name
}
** Server Join Date:** ${joindate} \nSince ${joined} day(s) ago
** Roles [${roles.length}]:** ${
roles.length < 10
? roles.join(" **|** ")
: roles.length > 10
? utils.trimArray(roles)
: "None"
}
\u200b`
);
interaction.followUp({ embeds: [embed] });
},
};
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,106 +0,0 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "ban",
description: "Ban an user",
BotPerms: ["BAN_MEMBERS"],
UserPerms: ["BAN_MEMBERS"],
usage: "(User) {Reason}",
category: "Moderation",
options: [
{
type: 6,
name: "user",
description: "The user you want to ban",
required: true,
},
{
type: 3,
name: "reason",
description: "The reason you want to ban",
required: false,
},
{
type: 4,
name: "messages",
description:
"Number of days of messages to delete, must be between 0 and 7, inclusive",
required: false,
},
],
run: async (client, interaction, args) => {
const target = interaction.guild.members.cache.get(args[0]);
let reason = args[1] || "No reason provided";
const days = args[2] || 0;
if (days > 7 || days < 0) {
interaction.followUp({
content:
"Number of days of messages to delete must be between 0 and 7, inclusive",
});
} else if (!target) {
try {
const one = await client.users.fetch(args[0]);
if (one.id === interaction.user.id) {
interaction.followUp({ content: "You can't ban yourself" });
}
if (reason.length > 1024) reason = reason.slice(0, 1021) + "...";
const embed = new MessageEmbed()
.setTitle("User Banned")
.addField("**Moderator**", interaction.user.tag, true)
.addField("**User**", one.tag, true)
.addField("**Reason**", reason, true)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
await interaction.guild.members.ban(one.id, {
reason,
days,
});
} catch (e) {
console.log(e);
}
} else {
if (target.id === interaction.user.id) {
interaction.followUp({ content: "You can't ban yourself" });
}
if (
interaction.member.roles.highest.position <
target.roles.highest.position
) {
interaction.followUp({ content: "You don't have enough hierarchy" });
}
if (
interaction.guild.me.roles.highest.position <
target.roles.highest.position
) {
interaction.followUp({ content: "Bot doesn't have enough hierarchy" });
}
if (reason.length > 1024) reason = reason.slice(0, 1021) + "...";
try {
const embed = new MessageEmbed()
.setTitle("User Banned")
.addField("**Moderator**", interaction.user.tag, true)
.addField("**User**", target.user.tag, true)
.addField("**Reason**", reason, true)
.addField(
"Number of days of messages to delete",
days.toString(),
true
)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setThumbnail(interaction.user.displayAvatarURL({ dynamic: true }))
.setColor(client.color);
interaction.followUp({ embeds: [embed] });
await interaction.guild.members.ban(target.id, {
reason,
days,
});
} catch (e) {
console.log(e);
interaction.followUp({ content: `**Error**: ${e.message}` });
}
}
},
};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,59 +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 MessageEmbed()
.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(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
} else {
await client.data.BK(user.id, toggle, reason);
const embed = new MessageEmbed()
.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(`Made by ${client.author}`, client.user.displayAvatarURL())
.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 { MessageEmbed } = 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 MessageEmbed()
.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,131 +1,129 @@
const Discord = require("discord.js");
module.exports = {
name: "eval",
category: "Owner",
usage: "(Code)",
Owner: true,
description: "Eval something",
type: "CHAT_INPUT",
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);
console.log(evaled);
evaled = chunk([evaled], 750);
console.log(evaled);
let reactions = ["❌", "⏪", "◀️", "⏹️", "▶️", "⏩"],
page = 0,
evaledEmbed = new Discord.MessageEmbed()
.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.MessageEmbed()
.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,38 +1,45 @@
const { MessageEmbed } = 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 MessageEmbed()
.setTitle("Guilds")
.setDescription(description)
.setColor(client.color)
.addFields(
{
name: `Total Guilds`,
value: client.guilds.cache.size,
inline: true,
},
{
name: `Total Members`,
value: client.users.cache.size,
inline: true,
}
)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.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,35 +0,0 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "afk",
description: "Tell someone you are AFK.",
usage: "{Status}",
category: "Utilities",
type: "CHAT_INPUT",
options: [
{
type: 3,
name: "status",
description: "The status that shows to user while you are AFK",
required: false,
},
],
run: async (client, interaction, args) => {
const uuser = interaction.guild.members.cache.get(interaction.user.id);
const content = args[0] || "No status provided.";
uuser.setNickname(`[AFK] ${interaction.user.username}`).catch();
await client.data.AFK(interaction.user.id, content);
const embed = new MessageEmbed()
.setDescription(
`${interaction.user.username} is set into AFK.\nStatus : ${content}`
)
.setTimestamp()
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setColor(client.color)
.setAuthor(
interaction.user.username,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setURL(client.web);
interaction.followUp({ embeds: [embed] });
},
};

View file

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

View file

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

View file

@ -1,128 +0,0 @@
const { MessageEmbed } = require("discord.js");
const moment = require("moment");
module.exports = {
name: "editsnipe",
description: "Snipes a edited message",
category: "Utilities",
options: [
{
type: 7,
name: "channel",
description: "The sniped channel",
required: true,
channelTypes: ["GUILD_TEXT"],
},
{
type: 4,
name: "message",
description: "The sniped message",
required: false,
},
],
run: async (client, interaction, args) => {
var i = 0;
let description = "";
const embed = new MessageEmbed()
.setAuthor(
`Sniped by ${interaction.user.tag}`,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setURL(client.web);
const snipes = client.esnipes.get(args[0]) || [];
if (interaction.guild.channels.cache.get(args[0]).type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else if (args[1]) {
const msg = snipes[args[1] - 1];
if (!msg) {
snipes.forEach(m => {
const map = [];
for (var i = 0; i < m.attachment?.length; i++) {
map.push(
`**Attchment ${i + 1}:** [Click to view](${m.attachment[i]})`
);
}
if (m.author !== "No Author") {
description += `\n\n**Author:** ${m.author.username}#${
m.author.discriminator
} (Deleted ${moment(m.date).fromNow()})\n**ID:** ${
m.author.id
}\n**Old Content:** ${m.oldContent}\n**New Content:** ${
m.newContent
}\n${map ? map.join("\n") : ""}`;
i++;
} else {
description += `\n\n**Author:** None (Deleted ${moment(
m.date
).fromNow()})\n\n**Old Content:** ${
m.oldContent
}\n**New Content:** ${m.newContent}\n${map ? map.join("\n") : ""}`;
i++;
}
});
embed.setDescription(description);
return interaction.followUp({ embeds: [embed] });
} else {
const map = [];
for (var i = 0; i < msg.attachment?.length; i++) {
map.push(
`**Attchment ${i + 1}:** [Click to view](${msg.attachment[i]})`
);
}
if (msg.author !== "No Author") {
description += `\n\n**Author:** ${msg.author.username}#${
msg.author.discriminator
} (Deleted ${moment(msg.date).fromNow()})\n**ID:** ${
msg.author.id
}\n**Old Content:** ${m.oldContent}\n**New Content:** ${
m.newContent
}\n${map ? map.join("\n") : ""}`;
i++;
} else {
description += `\n\n**Author:** None (Deleted ${moment(
msg.date
).fromNow()})\n\n**Old Content:** ${m.oldContent}\n**New Content:** ${
m.newContent
}\n${map ? map.join("\n") : ""}`;
i++;
}
embed.setDescription(description);
return interaction.followUp({ embeds: [embed] });
}
} else if (!snipes.length) {
interaction.followUp({
content: "There isn't any snipe in this channel yet",
});
} else {
snipes.forEach(m => {
const map = [];
for (var i = 0; i < m.attachment?.length; i++) {
map.push(
`**Attchment ${i + 1}:** [Click to view](${m.attachment[i]})`
);
}
if (m.author !== "No Author") {
description += `\n\n**Author:** ${m.author.username}#${
m.author.discriminator
} (Deleted ${moment(m.date).fromNow()})\n**ID:** ${
m.author.id
}\n**Old Content:** ${m.oldContent}\n**New Content:** ${
m.newContent
}\n${map ? map.join("\n") : ""}`;
i++;
} else {
description += `\n\n**Author:** None (Deleted ${moment(
m.date
).fromNow()})\n\n**Old Content:** ${m.oldContent}\n**New Content:** ${
m.newContent
}\n${map ? map.join("\n") : ""}`;
i++;
}
});
embed.setDescription(description);
return interaction.followUp({ embeds: [embed] });
}
},
};

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