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

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

2
.gitattributes vendored
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 Examples of behavior that contributes to a positive environment for our
community include: community include:
* Demonstrating empathy and kindness toward other people - Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences - Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback - Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, - Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience and learning from the experience
* Focusing on what is best not just for us as individuals, but for the - Focusing on what is best not just for us as individuals, but for the
overall community overall community
Examples of unacceptable behavior include: Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or - The use of sexualized language or imagery, and sexual attention or
advances of any kind advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks - Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment - Public or private harassment
* Publishing others' private information, such as a physical or email - Publishing others' private information, such as a physical or email
address, without their explicit permission address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a - Other conduct which could reasonably be considered inappropriate in a
professional setting professional setting
## Enforcement Responsibilities ## Enforcement Responsibilities
@ -59,7 +59,7 @@ representative at an online or offline event.
## Enforcement ## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at our [Discord Server](https://discord.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 complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the All community leaders are obligated to respect the privacy and security of the

View file

@ -1,5 +1,5 @@
<h1 align="center">Contributing</h1> <h1 align="center">Contributing</h1>
When contributing to this repository, please first discuss the change you wish to make via issue or on our [discord server](https://discord.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.**

50
.github/README.md vendored
View file

@ -1,17 +1,14 @@
<h1 align="center"> NYX [Cath.exe] </h1> <h1 align="center"> NYX [Cath.exe] </h1>
<!-- header --> <!-- header -->
<p align="center"> <p align="center">
<a href="https://rebrand.ly/cathSupport" target="_blank"><img alt="NYX_banner" src = "https://media.discordapp.net/attachments/896078559293104128/896091759157858394/nyx_banner_3d.png?width=1341&height=447"></a> <a href="https://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> <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://discord.com/oauth2/authorize?client_id=1071021943484055563&permissions=4231314550&scope=bot%20applications.commands" target="_blank"><img alt='Invite' src="https://img.shields.io/badge/-Invite-5865f2?logo=discord&logoColor=white&style=for-the-badge"></a>
<a href= "https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank"><img alt='Licence CC BY-NC-SA 4.0' src ="https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-nc-sa.svg" width="82">
<a href="https://trello.com/b/dIgR0QNm" target="_blank"><img alt='Trello' src="https://img.shields.io/badge/Trello-5865F2?style=for-the-badge&logo=trello&logoColor=white"></a>
<a href="https://github.com/night0721/cath"><img alt = 'NPM Package' src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white"> <a href="https://github.com/night0721/cath"><img alt = 'NPM Package' src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white">
<a href="https://thunder75.gitbook.io/cath-bot" target="_blank"><img src="https://img.shields.io/static/v1?label=Docs&message=available&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://ko-fi.com/I2I35XISJ" target="_blank"><img alt='Kofi' src="https://img.shields.io/static/v1?label=Support%20Us&message=KO.FI&color=ff5e5b&logo=kofi&logoColor=white&style=for-the-badge&scale=1.4"></a> <br> <a href="https://ko-fi.com/I2I35XISJ" target="_blank"><img alt='Kofi' src="https://img.shields.io/static/v1?label=Support%20Us&message=KO.FI&color=ff5e5b&logo=kofi&logoColor=white&style=for-the-badge&scale=1.4"></a> <br>
<a href="https://nyx-bot.statuspage.io/"target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=NYX&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a> <a href="https://nyx-bot.statuspage.io/"target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=NYX&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://nyx-bot.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=NYX%202&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://nyx-bot.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=API&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a> <a href="https://nyx-bot.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=API&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<img src ="https://forthebadge.com/images/badges/built-with-love.svg" width = "122">
</p> </p>
<p align = "center"> <p align = "center">
@ -21,7 +18,9 @@
<!-- description --> <!-- description -->
**NYX** _(previously known as Cath)_ is a first and only **COD Mobile Statistics & Gunsmith** Bot which also doubles as a multipurpose discord bot with many features that include but are not limited to Moderation, Music and Economy. <br> **NYX** _(previously known as Cath)_ is a first and only **COD Mobile Statistics & Gunsmith** Bot which also doubles as a multipurpose discord bot with many features that include but are not limited to Moderation, Music and Economy. <br>
The Call of Duty Stats are courtesy of **Round Table** by Cygnoux Familia.<br><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> If you like this bot, feel free to :star: **Star** this repository.<br>
> ⚠ The Verifed bot instance is current called Cath.exe, we are working on getting it changed > ⚠ The Verifed bot instance is current called Cath.exe, we are working on getting it changed
@ -43,24 +42,31 @@ If you like this bot, feel free to :star: **Star** this repository.<br>
## <img height="18px" src="../util/assets/images/cod_logo.svg"> **Call of Duty Mobile** ## <img height="18px" src="../util/assets/images/cod_logo.svg"> **Call of Duty Mobile**
- **Weapon Statistics** courtesy of **Lighthouse v2.1** - **Weapon Statistics** courtesy of **Round Table** & **Stats On Duty**
> Will soon be using stats provided by **Stats On Duty**. - **Currated Gunsmith Builds** by various content creators like Jokesta, dHitman, Path.exe, Stats On Duty and more comming soon.
- **Currated Gunsmith Builds** by various content creators like Jokesta, dHitman, Path.exe and more comming soon.
- **Perks** detailed info about the perks. - **Perks** detailed info about the perks.
- **Scorestreak** detailed info about scorestreak with preview videos. - **Scorestreak** detailed info about scorestreak with preview videos.
- **Randomly Generated Class** Wanna try something challenging? try our Randomly Generated Gunsmith builds. - **Randomly Generated Class** Wanna try something challenging? try our Randomly Generated Gunsmith builds.
> We also provide access to our database that includes In-depth Weapon statistics & Gunsmith Builds from various Content Creators, & other Call of duty related info, please [contact us](https://rebrand.ly/cathSupport) for more info. > We also provide access to our database that includes In-depth Weapon statistics & Gunsmith Builds from various Content Creators, & other Call of duty related info, please [contact us](https://rebrand.ly/cathSupport) for more info.
## <img height="16px" src="../util/assets/images/apex/apex-legends-logo-white.svg"> **Apex Legends Mobile**
> ⚠ _Coming Soon™_
- **Player Stats** view your in-game stats. <!-- if they support mobile for the stats api -->
- **Legends** detailed info about legends & their abilities.
- **Guns** detailed info about guns.
- **Random Combos** Wanna try something challenging? try to win a game with a random selected legend & Gun combination
- _& many more, coming soon!_
## More Info ## More Info
[![Top language](https://img.shields.io/github/languages/top/night0721/cath.exe?labelColor=F7DF1E&color=555555&style=for-the-badge&scale=1.4)](https://github.com/night0721/cath.exe) [![Top language](https://img.shields.io/github/languages/top/night0721/cath.exe?labelColor=F7DF1E&color=555555&style=for-the-badge&scale=1.4)](https://github.com/night0721/cath.exe)
[![CodeFactor](https://www.codefactor.io/repository/github/night0721/cath.js/badge?s=57e6f566f73892f4303edbfeb2fe3ea0b849c876&style=for-the-badge)](https://www.codefactor.io/repository/github/night0721/cath.js) [![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)
<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> [YouTube Deployment video](https://www.youtube.com/watch?v=9Dmtuv6tlTE)
A detailed Deployment guide can be found [here](https://thunder75.gitbook.io/cath-bot/deployment). <details>
<!-- <details>
<summary>Made With</summary> <summary>Made With</summary>
[![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black)](https://developer.mozilla.org/en-US/docs/Web/JavaScript) [![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
@ -73,13 +79,10 @@ A detailed Deployment guide can be found [here](https://thunder75.gitbook.io/cat
<details> <details>
<summary>Github Stats</summary> <summary>Github Stats</summary>
![Lines of code](https://img.shields.io/tokei/lines/github/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge)
![GitHub Discussions](https://img.shields.io/github/discussions/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge)
[![Last commit](https://img.shields.io/github/last-commit/night0721/cath.exe?icon=discord&color=5865F2&style=for-the-badge&scale=1.4)](https://github.com/night0721/cath.exe) [![Last commit](https://img.shields.io/github/last-commit/night0721/cath.exe?icon=discord&color=5865F2&style=for-the-badge&scale=1.4)](https://github.com/night0721/cath.exe)
<!-- [![Files](https://tokei.rs/b1/github/night0721/cath.exe?category=files&style=for-the-badge)](https://github.com/night0721/cath.exe)
</details> --> </details>
<h1 align = "center"> Support, Feature Request & Bug Reports </h1> <h1 align = "center"> Support, Feature Request & Bug Reports </h1>
@ -102,12 +105,5 @@ Contributions are always welcomed, but make sure to read [Contributing.md](/CONT
![Contributors](https://badges.pufler.dev/contributors/night0721/cath.exe?bots=false) ![Contributors](https://badges.pufler.dev/contributors/night0721/cath.exe?bots=false)
<!-- ## Special Thanks to The Roound Table from Cygnoux Familia.
<p align = "center"> <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">
<a href="https://discord.gg/mjVwkCsWY7" target="_blank"><img src="https://discordapp.com/api/guilds/756525751594909797/widget.png?style=banner1"></a>
</p> -->
<!-- <img src="https://socialify.git.ci/night0721/cath.exe/image?description=1&descriptionEditable=A%20Discord.js%20v13%20Template%20based%20on%20cath.exe&font=Raleway&forks=1&issues=1&language=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Dark"> -->

5
.github/TOS.md vendored 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"

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 +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,8 +1,11 @@
const { Client, Collection, MessageEmbed } = require("discord.js"); const {
const { Manager } = require("erela.js"); Client,
Collection,
EmbedBuilder,
GatewayIntentBits,
Partials,
} = require("discord.js");
const config = require("../config"); const config = require("../config");
const Spotify = require("erela.js-spotify");
const utils = require("../util/functions/function");
require("dotenv").config(); require("dotenv").config();
class NYX extends Client { class NYX extends Client {
@ -15,23 +18,31 @@ class NYX extends Client {
activities: [ activities: [
{ {
name: `/help`, name: `/help`,
type: "STREAMING", type: 1,
url: "https://www.youtube.com/watch?v=YSKDu1gKntY", url: "https://www.youtube.com/watch?v=YSKDu1gKntY",
}, },
], ],
}, },
shard: "auto", shards: "auto",
restTimeOffset: 0, partials: [
restRequestTimeout: 99999, Partials.Message,
partials: ["MESSAGE", "CHANNEL", "REACTION", "GUILD_MEMBER"], Partials.Channel,
intents: 24207, Partials.Reaction,
Partials.GuildMember,
],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
// GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.DirectMessageTyping,
GatewayIntentBits.DirectMessages,
],
} }
) { ) {
super(options); super(options);
this.slashCommands = new Collection(); this.slashCommands = new Collection();
this.hide = new Collection(); this.hide = new Collection();
this.esnipes = new Collection();
this.snipes = new Collection();
this.config = config; this.config = config;
this.data = require("../util/functions/mongoose"); this.data = require("../util/functions/mongoose");
this.color = config.color; this.color = config.color;
@ -44,105 +55,47 @@ class NYX extends Client {
"534027706325532694", // Cat drinking a cat "534027706325532694", // Cat drinking a cat
"381442059111759883", // Thunder "381442059111759883", // Thunder
"556808365574193194", // chunchunmaru "556808365574193194", // chunchunmaru
"746753527338238115", // mightyful "687622268037365774", // Tac Shadow
"309681798957498368", // Sideload
"707177879984668673", // Random rock
"757530324686340197", // Madhav
"804712098625486848", // hcs
"1078015817184182414", // gaba
"774390900411465769", // Alphaus
]; ];
this.currency = "<:nyx_currency:918584872333893703>"; this.currency = "<:nyx_currency:918584872333893703>";
this.xp = "<:nyx_xp:900309007472926720>"; this.xp = "<:nyx_xp:900309007472926720>";
this.dev = "<:discord_bot_dev:840231906200387666>";
this.path = [ this.path = [
"614423108388126731", // Camper on Duty "614423108388126731", // Camper on Duty
"767173194943168542", // Dark Bonker "767173194943168542", // Dark Bonker
"718762019586572341", // NYX Nation "718762019586572341", // NYX Nation
"840225563193114624", // Command Test "840225563193114624", // Command Test
]; ];
const client = this;
require("../util/functions/economy")(client);
this.manager = new Manager({
plugins: [
new Spotify({
clientID: process.env.SPOTIFY_ID,
clientSecret: process.env.SPOTIFY_SECRET,
}),
],
nodes: [
{
host: config.Lavalink.Host,
port: config.Lavalink.Port,
password: config.Lavalink.Password,
retryDelay: 5000,
},
],
autoPlay: true,
send: (id, payload) => {
const guild = client.guilds.cache.get(id);
if (guild) guild.shard.send(payload);
},
})
.on("nodeConnect", node =>
console.log(`Node "${node.options.identifier}" has connected`)
)
.on("nodeError", (node, error) =>
console.log(
`Node "${node.options.identifier}" encountered an error: ${error.message}`
)
)
.on("trackStart", (player, track) => {
const channel = client.channels.cache.get(player.textChannel);
const embed = new MessageEmbed()
.setColor(config.color)
.setAuthor(
`Now Playing`,
"https://cdn.discordapp.com/emojis/897017864085712936.gif"
)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setThumbnail(player.queue.current.displayThumbnail())
.setDescription(`[${track.title}](${track.uri})`)
.addField(
"Duration",
`\`${utils.prettyMs(track.duration, {
colonNotation: true,
})}\``,
true
);
channel.send({ embeds: [embed] });
})
.on("queueEnd", player => {
const channel = client.channels.cache.get(player.textChannel);
const embed2 = new MessageEmbed()
.setColor(config.color)
.setAuthor(
`Queue has ended`,
"https://cdn.discordapp.com/emojis/897017864085712936.gif"
)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
channel.send({ embeds: [embed2] });
// player.destroy(); Remove if 24/7
});
} }
start() { start() {
require("../util/dist/handler")(this); require("../util/dist/handler")(this);
this.login(
process.argv[2] == "--dev" ? process.env.DEV : process.env.TOKEN
);
this.data this.data
.connect(process.env.MONGO) .connect(process.env.MONGO)
.then(() => console.log("Connected to MongoDB ✅")) .then(() => console.log("Connected to MongoDB ✅"))
.catch(e => console.log(e)); .catch(e => console.log(e));
this.login(process.env.TOKEN);
} }
err(c, e) { err(interaction, error) {
const embed = new MessageEmbed() const embed = new EmbedBuilder()
.setTitle("An Error Occured") .setTitle("An Error Occured")
.setColor("RED") .setColor("Red")
.setDescription(`❌ | ${e}`) .setDescription(`❌ | ${error}`)
.setTimestamp() .setTimestamp()
.setFooter(`Made by ${this.author}`, this.user.displayAvatarURL()); .setFooter({
c.followUp({ embeds: [embed] }); text: `Made by ${this.author}`,
} iconURL: this.user.displayAvatarURL({ dynamic: true }),
se(c, e) { });
const embed = new MessageEmbed() interaction.channel.send({ embeds: [embed] });
.setColor(this.color) this.channels.cache.get(this.config.ErrorLog).send({ embeds: [embed] });
.setDescription(e)
.setTimestamp();
c.followUp({ embeds: [embed] });
} }
} }

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();

View file

@ -1,15 +1,13 @@
const { MessageEmbed } = require("discord.js"); const { Client, CommandInteraction, EmbedBuilder } = require("discord.js");
const moment = require("moment");
const axios = require("axios"); const axios = require("axios");
module.exports = { module.exports = {
name: "build", name: "build",
description: "Get gunsmith builds", description: "Get gunsmith builds",
usage: "[Weapon Name] [Author] [Tag]", usage: "[Weapon Name] [Author] [Tag]",
type: "CHAT_INPUT",
category: "CODM", category: "CODM",
options: [ options: [
{ {
type: "SUB_COMMAND", type: 1,
name: "assault_rifle", name: "assault_rifle",
description: "Get a gunsmith build for a Assault Rifle", description: "Get a gunsmith build for a Assault Rifle",
options: [ options: [
@ -152,7 +150,7 @@ module.exports = {
], ],
}, },
{ {
type: "SUB_COMMAND", type: 1,
name: "sub_machine_gun", name: "sub_machine_gun",
description: "Get a gunsmith build for a Sub Machine Gun", description: "Get a gunsmith build for a Sub Machine Gun",
options: [ options: [
@ -275,7 +273,7 @@ module.exports = {
], ],
}, },
{ {
type: "SUB_COMMAND", type: 1,
name: "sniper_rifle", name: "sniper_rifle",
description: "Get a gunsmith build for a Sniper Rifle", description: "Get a gunsmith build for a Sniper Rifle",
options: [ options: [
@ -362,7 +360,7 @@ module.exports = {
], ],
}, },
{ {
type: "SUB_COMMAND", type: 1,
name: "light_machine_gun", name: "light_machine_gun",
description: "Get a gunsmith build for a Light Machine Gun", description: "Get a gunsmith build for a Light Machine Gun",
options: [ options: [
@ -445,7 +443,7 @@ module.exports = {
], ],
}, },
{ {
type: "SUB_COMMAND", type: 1,
name: "shotgun", name: "shotgun",
description: "Get a gunsmith build for a Shotgun", description: "Get a gunsmith build for a Shotgun",
options: [ options: [
@ -483,6 +481,10 @@ module.exports = {
name: "R9-0", name: "R9-0",
value: "E07", value: "E07",
}, },
{
name: "JAK-12",
value: "E08",
},
], ],
}, },
{ {
@ -520,7 +522,7 @@ module.exports = {
], ],
}, },
{ {
type: "SUB_COMMAND", type: 1,
name: "marksman_rifle", name: "marksman_rifle",
description: "Get a gunsmith build for a Marksman Rifle", description: "Get a gunsmith build for a Marksman Rifle",
options: [ options: [
@ -587,7 +589,7 @@ module.exports = {
], ],
}, },
{ {
type: "SUB_COMMAND", type: 1,
name: "pistol", name: "pistol",
description: "Get a gunsmith build for a Pistol", description: "Get a gunsmith build for a Pistol",
options: [ options: [
@ -654,7 +656,13 @@ module.exports = {
], ],
}, },
], ],
run: async (client, interaction, args) => { /**
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String[]} args
*/
run: async (client, interaction, args, utils) => {
const cwts = args[1]; const cwts = args[1];
const cc = args[2]; const cc = args[2];
const tag = args[3]; const tag = args[3];
@ -669,28 +677,33 @@ module.exports = {
) )
.then(res => res.data) .then(res => res.data)
.catch(e => null); .catch(e => null);
console.log(data);
if (!data?.cwts) { if (!data?.cwts) {
const embed = new MessageEmbed() const embed = new EmbedBuilder()
.setDescription( .setDescription(
`<:nyx_not_available:897378400031879188> We don't have a **${tag}** gunsmith build for the gun with **CWTS 🆔 ${cwts}** by **${cc}**, Please try another tag or a differnt content creator` `<:nyx_not_available:897378400031879188> We don't have a **${tag}** gunsmith build for the gun with **CWTS 🆔 ${cwts}** by **${cc}**, Please try another tag or a differnt content creator`
) )
.setColor(client.color); .setColor(client.color);
try {
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
} catch (e) {
interaction.editReply({ embeds: [embed] });
}
} else { } else {
const arr = []; const arr = [];
data.attachments.map((e, i) => { data.attachments.map((e, i) => {
return arr.push(`**${i + 1}:** ${e}`); return arr.push(`**${i + 1}:** ${e}`);
}); });
const embed = new MessageEmbed() const embed = new EmbedBuilder()
.setTitle(`${tag} build for ${data.weaponName} from ${data.author}`) .setTitle(`${tag} build for ${data.weaponName} from ${data.author}`)
.setDescription( .setDescription(
`<:nyx_description:897379659665264650> **Description** \`\`\`\n${data.notes}\n \`\`\`` `<:nyx_description:897379659665264650> **Description** \`\`\`\n${data.notes}\n \`\`\``
) )
.setColor(16580400) .setColor(16580400)
.setImage(data.imageUrl) .setImage(data.imageUrl ? data.imageUrl : null)
.setFooter({ .setFooter({
text: `Builds Aggregated by ${client.author}`, text: `Builds Aggregated by ${client.author}`,
iconURL: client.user.displayAvatarURL(), iconURL: client.user.displayAvatarURL({ dynamic: true }),
}) })
.setTimestamp() .setTimestamp()
.addFields( .addFields(
@ -701,8 +714,8 @@ module.exports = {
}, },
{ {
name: "<a:lastupdate:897381474330873887> Last Updated:", name: "<a:lastupdate:897381474330873887> Last Updated:",
value: `\`\`\`\n${moment(Date.parse(data.lastUpdate)).format( value: `\`\`\`\n${utils.parseShortDate(
"MMMM Do YYYY" new Date(data.lastUpdate)
)}\n\`\`\``, )}\n\`\`\``,
inline: true, inline: true,
}, },
@ -721,9 +734,13 @@ module.exports = {
} }
) )
.setURL(client.web); .setURL(client.web);
try {
interaction.followUp({ interaction.followUp({
embeds: [embed], embeds: [embed],
}); });
} catch (e) {
interaction.editReply({ embeds: [embed] });
}
} }
}, },
}; };

View file

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

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

View file

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

View file

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

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

View file

@ -1,5 +1,4 @@
const starboardClient = require("../../client/StarboardClient"); const { EmbedBuilder } = require("discord.js");
const { MessageEmbed } = require("discord.js");
const fs = require("fs"); const fs = require("fs");
module.exports = { module.exports = {
name: "settings", name: "settings",
@ -7,116 +6,13 @@ module.exports = {
UserPerms: ["ADMINISTRATOR"], UserPerms: ["ADMINISTRATOR"],
category: "Config", category: "Config",
options: [ 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, type: 2,
name: "enable", name: "enable",
description: "Enable commands/category for the server", description: "Enable commands/category for the server",
options: [ options: [
{ {
type: "SUB_COMMAND", type: 1,
name: "command", name: "command",
description: "To enable commands", description: "To enable commands",
options: [ options: [
@ -129,7 +25,7 @@ module.exports = {
], ],
}, },
{ {
type: "SUB_COMMAND", type: 1,
name: "category", name: "category",
description: "To enable categories", description: "To enable categories",
options: [ options: [
@ -147,22 +43,10 @@ module.exports = {
name: "config", name: "config",
value: "Config", value: "Config",
}, },
{
name: "economy",
value: "Economy",
},
{
name: "fun",
value: "Fun",
},
{ {
name: "information", name: "information",
value: "Information", value: "Information",
}, },
{
name: "moderation",
value: "Moderation",
},
{ {
name: "utilities", name: "utilities",
value: "Utilities", value: "Utilities",
@ -179,7 +63,7 @@ module.exports = {
description: "Disable commands/category for the server", description: "Disable commands/category for the server",
options: [ options: [
{ {
type: "SUB_COMMAND", type: 1,
name: "command", name: "command",
description: "To disable commands", description: "To disable commands",
options: [ options: [
@ -192,7 +76,7 @@ module.exports = {
], ],
}, },
{ {
type: "SUB_COMMAND", type: 1,
name: "category", name: "category",
description: "To disable categories", description: "To disable categories",
options: [ options: [
@ -210,22 +94,11 @@ module.exports = {
name: "config", name: "config",
value: "Config", value: "Config",
}, },
{
name: "economy",
value: "Economy",
},
{
name: "fun",
value: "Fun",
},
{ {
name: "information", name: "information",
value: "Information", value: "Information",
}, },
{
name: "moderation",
value: "Moderation",
},
{ {
name: "utilities", name: "utilities",
value: "Utilities", value: "Utilities",
@ -237,33 +110,7 @@ module.exports = {
], ],
}, },
{ {
type: "SUB_COMMAND", type: 1,
name: "level",
description: "Configure level settings for the server",
options: [
{
type: 5,
name: "choice",
description: "Set whether level system is activated for the server",
required: true,
},
],
},
{
type: "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", name: "tips",
description: "Configure tips settings for the server", description: "Configure tips settings for the server",
options: [ options: [
@ -276,123 +123,14 @@ module.exports = {
], ],
}, },
{ {
type: "SUB_COMMAND", type: 1,
name: "overall", name: "overall",
description: "See overall settings for the server", description: "See overall settings for the server",
options: [], options: [],
}, },
], ],
run: async (client, interaction, args, utils, data) => { run: async (client, interaction, args, utils, data) => {
if (args[0].toLowerCase() === "muterole") { if (args[0].toLowerCase() === "tips") {
const role = interaction.guild.roles.cache.get(args[1]);
if (role.managed) {
interaction.followUp({ content: "You must provide a non bot role" });
} else {
await client.data.setMuterole(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${role.name}** as the mute role`,
});
}
} else if (args[0].toLowerCase() === "prefix") {
await client.data.setPrefix(interaction.guild.id, args[1]);
interaction.followUp({ content: `Saved \`${args[2]}\` as the prefix` });
} else if (args[0].toLowerCase() === "welcome") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
await client.data.setWelcome(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the welcome channel`,
});
}
} else if (args[0].toLowerCase() === "goodbye") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
await client.data.setGoodbye(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the goodbye channel`,
});
}
} else if (args[0].toLowerCase() === "starboard") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
starboardClient.config.guilds.add({
id: interaction.guild.id,
options: {
starCount: args[2],
starboardChannel: args[1],
},
});
await client.data.setStarboard(interaction.guild.id, args[1], args[2]);
interaction.followUp({
content: `Saved **${channel}** as the starboard channel`,
});
}
} else if (args[0].toLowerCase() === "chatbot") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
await client.data.setChatbot(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the chatbot channel`,
});
}
} else if (args[0].toLowerCase() === "log") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
let webhookid;
let webhooktoken;
await channel
.createWebhook(interaction.guild.name, {
avatar: interaction.guild.iconURL({ format: "png" }),
})
.then(webhook => {
webhookid = webhook.id;
webhooktoken = webhook.token;
});
await client.data.setLog(
interaction.guild.id,
channel.id,
webhookid,
webhooktoken
);
interaction.followUp({
content: `Saved **${channel}** as the log channel`,
});
}
} else if (args[0].toLowerCase() === "level") {
if (args[1]) {
await client.data.setGLevel(interaction.guild.id, "true");
interaction.followUp({
content: `Levelling is enabled in this server now.`,
});
} else {
await client.data.setGLevel(interaction.guild.id, "false");
interaction.followUp({
content: `Levelling is disabled in this server now.`,
});
}
} else if (args[0].toLowerCase() === "nsfw") {
if (args[1]) {
await client.data.setNSFW(interaction.guild.id, "true");
interaction.followUp({
content: `NSFW is enabled in this server now.`,
});
} else {
await client.data.setNSFW(interaction.guild.id, "false");
interaction.followUp({
content: `NSFW is disabled in this server now.`,
});
}
} else if (args[0].toLowerCase() === "tips") {
if (args[1]) { if (args[1]) {
await client.data.setTips(interaction.guild.id, "true"); await client.data.setTips(interaction.guild.id, "true");
interaction.followUp({ interaction.followUp({
@ -484,39 +222,7 @@ module.exports = {
} }
} else { } else {
const d = ` const d = `
**Mute Role**: ${
interaction.guild.roles.cache.get(data.Guild.Muterole)
? interaction.guild.roles.cache.get(data.Guild.Muterole)
: "None"
}
**Prefix**: ${data.Guild.Prefix ? data.Guild.Prefix : "C."} **Prefix**: ${data.Guild.Prefix ? data.Guild.Prefix : "C."}
**Welcome Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Welcome)
? interaction.guild.channels.cache.get(data.Guild.Welcome)
: "None"
}
**Goodbye Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Goodbye)
? interaction.guild.channels.cache.get(data.Guild.Goodbye)
: "None"
}
**Starboard Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Starboard)
? interaction.guild.channels.cache.get(data.Guild.Starboard)
: "None"
}
**Chatbot Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Chatbot)
? interaction.guild.channels.cache.get(data.Guild.Chatbot)
: "None"
}
**Log Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Log)
? interaction.guild.channels.cache.get(data.Guild.Log)
: "None"
}
**Level**: ${data.Guild.Level ? "Enable" : "Disabled"}
**NSFW**: ${data.Guild.NSFW ? "Enable" : "Disabled"}
**Tips**: ${data.Guild.Tips ? "Enable" : "Disabled"} **Tips**: ${data.Guild.Tips ? "Enable" : "Disabled"}
**Disabled Commands**: ${ **Disabled Commands**: ${
data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None" data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None"
@ -525,10 +231,13 @@ module.exports = {
data.Guild.Category.length ? data.Guilds.Category.join(",") : "None" data.Guild.Category.length ? data.Guilds.Category.join(",") : "None"
} }
`; `;
const embed = new MessageEmbed() const embed = new EmbedBuilder()
.setTitle(`**${interaction.guild.name}** Settings`) .setTitle(`**${interaction.guild.name}** Settings`)
.setColor(client.color) .setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL()) .setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
})
.setTimestamp() .setTimestamp()
.setDescription(d); .setDescription(d);
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });

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

View file

@ -1,32 +1,26 @@
const { MessageEmbed, version: djsversion } = require("discord.js"); const { EmbedBuilder, version: djsversion } = require("discord.js");
const version = require("../../../package.json").version; const version = require("../../package.json").version;
const { utc } = require("moment");
// const os = require("os");
module.exports = { module.exports = {
name: "botinfo", name: "botinfo",
description: "Check the info of the bot", description: "Check the info of the bot",
category: "Information", category: "Information",
type: "CHAT_INPUT",
run: async (client, interaction, args, utils) => { run: async (client, interaction, args, utils) => {
// const core = os.cpus()[0]; const embed = new EmbedBuilder()
const embed = new MessageEmbed()
.setTitle(`NYX - CODM Gunsmith Bot`) .setTitle(`NYX - CODM Gunsmith Bot`)
.setURL( .setURL(utils.inviteLink(client.user.id))
`https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=4231314550&scope=bot%20applications.commands`
)
.setThumbnail( .setThumbnail(
"https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp" "https://media.discordapp.net/attachments/896078559293104128/896392631565828146/nyx_logo_transparent.webp"
) )
.setColor(client.color) .setColor(client.color)
.addFields( .addFields([
{ {
name: `General`, name: `General`,
value: ` value: `
<:nyx_owner:897418259433943120> Owner <@452076196419600394> <:nyx_owner:897418259433943120> Owner <@452076196419600394>
Bot ${client.user.tag} Bot ${client.user.tag}
Bot ID \`${client.user.id}\` Bot ID \`${client.user.id}\`
Created on \`${utc(client.user.createdTimestamp).format( Created on \`${utils.botDate(
"MMMM Do YYYY" new Date(client.user.createdTimestamp)
)}\``, )}\``,
inline: true, inline: true,
}, },
@ -38,41 +32,28 @@ module.exports = {
.reduce((a, b) => a + b.memberCount, 0) .reduce((a, b) => a + b.memberCount, 0)
.toLocaleString()} .toLocaleString()}
Channels \`${client.channels.cache.size.toLocaleString()}\` Channels \`${client.channels.cache.size.toLocaleString()}\`
Commands \`${client.commands.size}\` Commands \`${client.slashCommands.size}\`
`, `,
inline: true, inline: true,
} },
)
.addFields(
{ {
name: `Platform`, name: `Platform`,
value: ` value: `
NYX \`v${version}\` NYX \`v${version}\`
Discord.js \`v${djsversion}\` Discord.js \`v${djsversion}\`
Node.js \`${process.version}\``, Node.js \`${process.version}\``,
} },
// 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}**`, name: `**${client.author}**`,
value: `**Development Management**\n\u3000Ń1ght#0001\n\u3000Cat drinking a cat#0795\n\u3000mightyful#6536\n\u3000Thunder#2128\n\u3000mobo#9277\n value: `**Development Management**\n\u3000Ń1ght#0001\n\u3000Cat drinking a cat#0795\n\u3000mightyful#6536\n\u3000Thunder#2128\n\u3000mobo#9277\n
**Research & Documentation**\n\u3000𝔔𝓻𝔦𝔁𝔖𝔦ӄø#0690\n\u3000Thunder#2128\n **Research & Documentation**\n\u3000Thunder#2128\n
**Website**\n\u3000Chunchunmaru#8570`, **Website**\n\u3000Chunchunmaru#8570`,
},
])
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL({ dynamic: true }),
}) })
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp(); .setTimestamp();
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
}, },

View file

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

View file

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

View file

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

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

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

View file

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

View file

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

View file

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

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

View file

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

View file

@ -1,58 +0,0 @@
const { MessageEmbed } = require("discord.js");
const axios = require("axios");
const { Pagination } = require("cath");
module.exports = {
name: "lyrics",
description: "Get lyrics for the currently playing song",
category: "Music",
usage: "(Song)",
options: [
{
type: 3,
name: "song",
description: "The song to search",
required: true,
},
],
run: async (client, interaction, args) => {
const splitlyrics = new Pagination();
const lyricsdata = await axios
.get(
`${process.env.api}/api/v1/lyrics?name=${encodeURIComponent(args[0])}`
)
.then(res => res.data);
if (!lyricsdata?.lyrics) {
interaction.followUp({
content: `**No lyrics are found for ${args[0]}**`,
});
} else {
const splittedLyrics = splitlyrics.chunk(lyricsdata.lyrics, 1024);
const lyricsEmbed = new MessageEmbed()
.setAuthor(`Lyrics`)
.setColor("YELLOW")
.addFields(
{ name: "Song Name", value: lyricsdata.title, inline: true },
{ name: "", value: "", inline: true },
{
name: "Full Lyrics",
value: `${
process.env.api
}/api/v1/lyrics/full?name=${encodeURIComponent(args[0])}`,
inline: true,
}
)
.setDescription(splittedLyrics[0])
.setFooter(`Page 1 of ${splittedLyrics.length}`)
.setThumbnail(lyricsdata.image)
.setTimestamp();
const lyricsMsg = await interaction.followUp({ embeds: [lyricsEmbed] });
if (splittedLyrics.length > 1) {
await splitlyrics.pagination(
lyricsMsg,
interaction.user,
splittedLyrics
);
}
}
},
};

View file

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

View file

@ -1,4 +1,4 @@
const { MessageEmbed } = require("discord.js"); const { EmbedBuilder } = require("discord.js");
module.exports = { module.exports = {
name: "poll", name: "poll",
category: "Utilities", category: "Utilities",
@ -48,21 +48,25 @@ module.exports = {
}, },
], ],
run: async (client, interaction, args) => { run: async (client, interaction, args) => {
const pollCreateEmbed = new MessageEmbed() const pollCreateEmbed = new EmbedBuilder()
.setTitle(`📣 **${args[0]}**`) .setTitle(`📣 **${args[0]}**`)
.setColor("RED") .setColor("Red")
.setFooter({ .setFooter({
text: `Made by ${client.author}`, text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(), iconURL: client.user.displayAvatarURL({ dynamic: true }),
}) })
.setTimestamp(); .setTimestamp();
let fields = [];
for (let i = 0; i < args.length - 1; i++) { for (let i = 0; i < args.length - 1; i++) {
pollCreateEmbed.addField( fields.push({
"", name: "",
`:regional_indicator_${String.fromCharCode(97 + i)}: ${args[i + 1]} value: `:regional_indicator_${String.fromCharCode(97 + i)}: ${
` args[i + 1]
);
} }
`,
});
}
pollCreateEmbed.addFields(fields);
let embedMessage = await interaction.followUp({ let embedMessage = await interaction.followUp({
embeds: [pollCreateEmbed], embeds: [pollCreateEmbed],
}); });

View file

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

View file

@ -1,122 +0,0 @@
const { MessageEmbed } = require("discord.js");
const moment = require("moment");
module.exports = {
name: "snipe",
description: "Snipes a deleted 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.snipes.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**Content:** ${m.content}\n${map ? map.join("\n") : ""}`;
i++;
} else {
description += `\n\n**Author:** None (Deleted ${moment(
m.date
).fromNow()})\n\n**Content:** ${m.content}\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**Content:** ${msg.content}\n${map ? map.join("\n") : ""}`;
i++;
} else {
description += `\n\n**Author:** None (Deleted ${moment(
msg.date
).fromNow()})\n\n**Content:** ${msg.content}\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**Content:** ${m.content}\n${map ? map.join("\n") : ""}`;
i++;
} else {
description += `\n\n**Author:** None (Deleted ${moment(
m.date
).fromNow()})\n\n**Content:** ${m.content}\n${
map ? map.join("\n") : ""
}`;
i++;
}
});
embed.setDescription(description);
return interaction.followUp({ embeds: [embed] });
}
},
};

View file

@ -1,91 +1,44 @@
const { MessageEmbed } = require("discord.js"); const { EmbedBuilder } = require("discord.js");
module.exports = { module.exports = {
name: "suggest", name: "suggest",
description: "Make a suggestion of the bot", description: "Make a suggestion of the bot",
category: "Utilities", category: "Utilities",
type: "CHAT_INPUT", options: [
{
type: 3,
name: "suggestion",
description: "The suggestion",
required: true,
},
],
run: async (client, interaction, args) => { run: async (client, interaction, args) => {
const questions = [ client.channels.cache.get(client.config.Suggestion).send({
"Describe the suggestion",
// "question 2"
];
let collectCounter = 0;
let endCounter = 0;
const filter = m => m.author.id === interaction.user.id;
interaction.followUp("Check your dm.");
const appStart = await interaction.user.send({
embeds: [ embeds: [
new MessageEmbed() new EmbedBuilder()
.setAuthor( .setAuthor({
interaction.user.username, name: interaction.user.tag,
interaction.user.displayAvatarURL() iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
) })
.setDescription(questions[collectCounter++]) .setTitle("New Suggestion")
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL()) .setDescription(args[0])
.setColor("Orange")
.setTimestamp(), .setTimestamp(),
], ],
}); });
const channel = appStart.channel; interaction.followUp({
const collector = channel.createMessageCollector({ filter });
collector.on("collect", () => {
if (collectCounter < questions.length) {
channel.send({
embeds: [ embeds: [
new MessageEmbed() new EmbedBuilder()
.setAuthor(
interaction.user.username,
interaction.user.displayAvatarURL()
)
.setDescription(questions[collectCounter++])
.setFooter(
`Made by ${client.author}`,
client.user.displayAvatarURL()
)
.setTimestamp(),
],
});
} else {
channel.send({
embeds: [
new MessageEmbed()
.setTitle("SUCCESS!") .setTitle("SUCCESS!")
.setDescription( .setDescription(
"You have sent a suggestion.\nPlease wait for us to review it" "You have sent a suggestion.\nPlease wait for us to review it"
) )
.setColor("GREEN") .setColor("Green")
.setFooter( .setFooter({
`Made by ${client.author}`, text: `Made by ${client.author}`,
client.user.displayAvatarURL() iconURL: client.user.displayAvatarURL({ dynamic: true }),
)
.setTimestamp(),
],
});
collector.stop("fulfilled");
}
});
const appsChannel = client.channels.cache.get(client.config.Config);
collector.on("end", (collected, reason) => {
if (reason === "fulfilled") {
const mapedResponses = collected
.map(msg => {
return `${questions[endCounter++]}**\n->** ${msg.content}`;
}) })
.join("\n\n");
appsChannel.send({
embeds: [
new MessageEmbed()
.setAuthor(
interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true })
)
.setTitle("New Suggestion")
.setDescription(mapedResponses)
.setColor("ORANGE")
.setTimestamp(), .setTimestamp(),
], ],
}); });
}
});
}, },
}; };

View file

@ -1,6 +1,6 @@
module.exports = { module.exports = {
prefix: "C.", prefix: "C.",
URL: "https://cath.gq/", URL: "https://night0721.me/",
color: "ff3636", color: "ff3636",
Suggestion: "853319776034226186", Suggestion: "853319776034226186",
Report: "853319776034226186", Report: "853319776034226186",
@ -9,9 +9,5 @@ module.exports = {
CMDLog: "848613827226239046", CMDLog: "848613827226239046",
ErrorLog: "938538311537012796", ErrorLog: "938538311537012796",
ServerLog: "848613714537873518", ServerLog: "848613714537873518",
Lavalink: { ScamLinkLog: "936986641585799178",
Host: "lavalink-repl.thunderemperor.repl.co",
Port: 443,
Password: "0638xxtXRH887UQQ",
},
}; };

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