Compare commits

..

135 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
6f1bb6a646
Merge pull request #91 from venom7aries/patch-5
domains.json
2023-05-21 17:43:28 +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
Tac Shadow
dfff57bb3b
domains.json
Added 4000+ links to the existing.
2023-04-08 22:50:47 +05:30
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
Night Kaly
3c03e88bb3
Merge pull request #58 from night0721/main
domains.json update
2022-03-02 11:09:36 +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
Night Kaly
cd59a40d19
Merge pull request #55 from night0721/dependabot/npm_and_yarn/dotenv-16.0.0
Bump dotenv from 15.0.1 to 16.0.0
2022-03-02 11:07:27 +00:00
Night Kaly
138be9072d
Merge pull request #57 from night0721/dependabot/npm_and_yarn/quickchart-js-3.0.0
Bump quickchart-js from 2.0.3 to 3.0.0
2022-03-02 11:07:14 +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
ThunderEmperor
3d35e1d838 Merge remote-tracking branch 'origin/main' into main 2022-02-22 19:37:07 +00:00
Night Kaly
f44ab76d85 botinfo as thunder want it 2022-02-22 19:37:06 +00:00
night0721
bffaf93184 fix known bugs 2022-02-23 03:36:09 +08:00
night0721
170583415a update 2022-02-23 03:34:26 +08:00
dependabot[bot]
7f153658ad
Bump quickchart-js from 2.0.3 to 3.0.0
Bumps [quickchart-js](https://github.com/typpo/quickchart-js) from 2.0.3 to 3.0.0.
- [Release notes](https://github.com/typpo/quickchart-js/releases)
- [Commits](https://github.com/typpo/quickchart-js/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-14 13:21:59 +00:00
night0721
a5e78a23c4 updated links 2022-02-08 20:10:53 +08:00
night0721
6381a49bdd del 2022-02-05 09:38:02 +08:00
night0721
7e0793133d fix 2022-02-05 09:35:26 +08:00
night0721
055dec1ffa ?? 2022-02-05 09:06:33 +08:00
night0721
b123c4e148 Merge branch 'main' of https://github.com/night0721/cath.exe 2022-02-05 09:01:53 +08:00
night0721
9121680874 ? 2022-02-05 09:01:51 +08:00
Night Kaly
c45e40cb32 bruh 2022-02-04 12:09:24 +00:00
night0721
e1d538cb33 ?? 2022-02-04 20:07:17 +08:00
night0721
96235e022b maybe? 2022-02-04 19:50:08 +08:00
night0721
5813259731 bug fix and 363/824 44% 2022-02-04 06:08:59 +08:00
dependabot[bot]
2a6601f3cb
Bump dotenv from 15.0.1 to 16.0.0
Bumps [dotenv](https://github.com/motdotla/dotenv) from 15.0.1 to 16.0.0.
- [Release notes](https://github.com/motdotla/dotenv/releases)
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/motdotla/dotenv/compare/v15.0.1...v16.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-03 13:20:07 +00:00
night0721
2cac998d50 319/817 39% 2022-02-03 19:21:05 +08:00
night0721
44bc2865f3 snd 2022-02-03 18:59:03 +08:00
night0721
610ed6810a yoooo 2022-02-03 18:57:59 +08:00
ThunderE75
a189834933 Relocated IP Grabber-update.json file & removed ngork 2022-02-03 14:48:29 +05:30
ThunderE75
1540d7843c
Added SOD for Marksman Builds & more
Added SOD for Marksman Builds
Fixed Embed for Mobile
2022-02-03 14:45:25 +05:30
ThunderE75
324d307a80 Fixing embed for mobile 2022-02-03 14:43:53 +05:30
ThunderE75
3654a418f2
Merge branch 'main' into dev 2022-02-03 14:23:05 +05:30
ThunderE75
712bd42494
updated domains.json from tac's fork
updated domains.json from tac's fork
& removed comments to avoid errors
2022-02-03 14:14:47 +05:30
ThunderE75
d247f2ca1c
removed comments 2022-02-03 14:13:15 +05:30
ThunderE75
1f0361c4b9 Added SOD for Builds 2022-02-03 03:50:03 +05:30
Night Kaly
e4308a2783
Merge pull request #51 from night0721/main
ipgrabber-domains.json
2022-02-02 17:24:34 +00:00
Tac Shadow
b6a2a615bc
ipgrabber-domains.json
updated version of domains.json.
2022-02-02 22:44:30 +05:30
226 changed files with 27395 additions and 26474 deletions

View file

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

2
.gitattributes vendored
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
@ -105,7 +105,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban ### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community **Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals. individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within **Consequence**: A permanent ban from any sort of public interaction within

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

222
.github/README.md vendored
View file

@ -1,113 +1,109 @@
<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://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://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://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://github.com/night0721/cath"><img alt = 'NPM Package' src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white"> <a href="https://nyx-bot.statuspage.io/"target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=NYX&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://thunder75.gitbook.io/cath-bot" target="_blank"><img src="https://img.shields.io/static/v1?label=Docs&message=available&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a> <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://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> <img src ="https://forthebadge.com/images/badges/built-with-love.svg" width = "122">
<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> </p>
<a href="https://nyx-bot.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=NYX%202&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://nyx-bot.statuspage.io/" target="_blank"><img alt='StatusPage' src="https://img.shields.io/static/v1?&label=API&message=Online&color=00DA83&logo=statuspage&logoColor=white&style=for-the-badge&scale=1.4"></a> <p align = "center">
</p> <a href="https://rebrand.ly/cathSupport"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner2" alt="Support Server" /></a>
</p>
<p align = "center">
<a href="https://rebrand.ly/cathSupport"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner2" alt="Support Server" /></a> <!-- description -->
</p>
**NYX** _(previously known as Cath)_ is a first and only **COD Mobile Statistics & Gunsmith** Bot which also doubles as a multipurpose discord bot with many features that include but are not limited to Moderation, Music and Economy. <br>
<!-- description --> 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.
**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> <br><br>
The Call of Duty Stats are courtesy of **Round Table** by Cygnoux Familia.<br><br> If you like this bot, feel free to :star: **Star** this repository.<br>
If you like this bot, feel free to :star: **Star** this repository.<br>
> ⚠ The Verifed bot instance is current called Cath.exe, we are working on getting it changed
> ⚠ The Verifed bot instance is current called Cath.exe, we are working on getting it changed > <br>
> <br>
# Features
# Features
> _This is a Non-Exhaustive list for commands. To access the full list of commands, check out our [Documentation](https://thunder75.gitbook.io/cath-bot/core/commands)._
> _This is a Non-Exhaustive list for commands. To access the full list of commands, check out our [Documentation](https://thunder75.gitbook.io/cath-bot/core/commands)._
<a href="https://thunder75.gitbook.io/cath-bot/core/commands" ><img src="https://img.shields.io/static/v1?label=List %20OF&message=Commands&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
<a href="https://thunder75.gitbook.io/cath-bot/core/commands" ><img src="https://img.shields.io/static/v1?label=List %20OF&message=Commands&color=5865F2&logo=gitbook&logoColor=white&style=for-the-badge&scale=1.4"></a>
🚨 **Moderation** - Classic commands like kick, ban, warn, role and many more. <br>
🚨 **Moderation** - Classic commands like kick, ban, warn, role and many more. <br> 📈 **Economy** - A Robust economy system, inspired by **pepe bot** <br>
📈 **Economy** - A Robust economy system, inspired by **pepe bot** <br> **Fun Commands** - A massive collection of fun commands `(35+ commands)` <br>
**Fun Commands** - A massive collection of fun commands `(35+ commands)` <br> 🎵 **Music** - Classic Music Commands that can play from various sources. <br>
🎵 **Music** - Classic Music Commands that can play from various sources. <br> 🛠 **Utility** - A wide range of useful commands `(Around 20)` <br>
🛠 **Utility** - A wide range of useful commands `(Around 20)` <br> 🕹 **Games** - Many fun games to spend your time <br>
🕹 **Games** - Many fun games to spend your time <br> 🎮 **Call of Duty** - Check the list of Call of Duty Mobile Commands
🎮 **Call of Duty** - Check the list of Call of Duty Mobile Commands
## <img height="18px" src="../util/assets/images/cod_logo.svg"> **Call of Duty Mobile**
## <img height="18px" src="../util/assets/images/cod_logo.svg"> **Call of Duty Mobile**
- **Weapon Statistics** courtesy of **Round Table** & **Stats On Duty**
- **Weapon Statistics** courtesy of **Lighthouse v2.1** - **Currated Gunsmith Builds** by various content creators like Jokesta, dHitman, Path.exe, Stats On Duty and more comming soon.
> Will soon be using stats provided by **Stats On Duty**. - **Perks** detailed info about the perks.
- **Currated Gunsmith Builds** by various content creators like Jokesta, dHitman, Path.exe and more comming soon. - **Scorestreak** detailed info about scorestreak with preview videos.
- **Perks** detailed info about the perks. - **Randomly Generated Class** Wanna try something challenging? try our Randomly Generated Gunsmith builds.
- **Scorestreak** detailed info about scorestreak with preview videos.
- **Randomly Generated Class** Wanna try something challenging? try our Randomly Generated Gunsmith builds. > We also provide access to our database that includes In-depth Weapon statistics & Gunsmith Builds from various Content Creators, & other Call of duty related info, please [contact us](https://rebrand.ly/cathSupport) for more info.
> 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**
## More Info > ⚠ _Coming Soon™_
[![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) - **Player Stats** view your in-game stats. <!-- if they support mobile for the stats api -->
[![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) - **Legends** detailed info about legends & their abilities.
<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> - **Guns** detailed info about guns.
- **Random Combos** Wanna try something challenging? try to win a game with a random selected legend & Gun combination
A detailed Deployment guide can be found [here](https://thunder75.gitbook.io/cath-bot/deployment). - _& many more, coming soon!_
<!-- <details> ## More Info
<summary>Made With</summary>
[![Top language](https://img.shields.io/github/languages/top/night0721/cath.exe?labelColor=F7DF1E&color=555555&style=for-the-badge&scale=1.4)](https://github.com/night0721/cath.exe)
[![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) [![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)
[![node](https://img.shields.io/badge/Node.js-43853D?style=for-the-badge&logo=node.js&logoColor=white)](https://nodejs.org/en/) [YouTube Deployment video](https://www.youtube.com/watch?v=9Dmtuv6tlTE)
[![npm](https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/)
[![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white)](https://mongodb.com/) <details>
<img src ="https://forthebadge.com/images/badges/built-with-love.svg" width = "122"><br> <summary>Made With</summary>
</details>
[![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
<details> [![node](https://img.shields.io/badge/Node.js-43853D?style=for-the-badge&logo=node.js&logoColor=white)](https://nodejs.org/en/)
<summary>Github Stats</summary> [![npm](https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/)
[![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white)](https://mongodb.com/)
![Lines of code](https://img.shields.io/tokei/lines/github/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge) <img src ="https://forthebadge.com/images/badges/built-with-love.svg" width = "122"><br>
![GitHub Discussions](https://img.shields.io/github/discussions/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge) </details>
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/night0721/cath.exe?color=5865F2&logo=github&logoColor=ffffff&style=for-the-badge)
[![Last commit](https://img.shields.io/github/last-commit/night0721/cath.exe?icon=discord&color=5865F2&style=for-the-badge&scale=1.4)](https://github.com/night0721/cath.exe) <details>
<!-- [![Files](https://tokei.rs/b1/github/night0721/cath.exe?category=files&style=for-the-badge)](https://github.com/night0721/cath.exe) <summary>Github Stats</summary>
</details> --> ![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)
<h1 align = "center"> Support, Feature Request & Bug Reports </h1>
</details>
## <img src = "https://cdn.discordapp.com/emojis/867093614403256350.png?v=1" width = 18> Support & Feature Request
<h1 align = "center"> Support, Feature Request & Bug Reports </h1>
Join the official [Support Server](https://rebrand.ly/cathSupport) on Discord & we will be happy to assist you. <br>
To Request new features contact us on Discord using the support server. ## <img src = "https://cdn.discordapp.com/emojis/867093614403256350.png?v=1" width = 18> Support & Feature Request
## <img src = "https://cdn.discordapp.com/emojis/867093601962950666.png?v=1" width = "18"> Report Bugs Join the official [Support Server](https://rebrand.ly/cathSupport) on Discord & we will be happy to assist you. <br>
To Request new features contact us on Discord using the support server.
You can report bugs or issues by opening a issue in this repository. Alternatevely you can also contact us on Discord using the support server.
## <img src = "https://cdn.discordapp.com/emojis/867093601962950666.png?v=1" width = "18"> Report Bugs
<p align = "center">
<a href="https://rebrand.ly/cathSupport" target="_blank"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner1"></a> You can report bugs or issues by opening a issue in this repository. Alternatevely you can also contact us on Discord using the support server.
</p>
<p align = "center">
<h1 align="center"> Contributors </h1> <a href="https://rebrand.ly/cathSupport" target="_blank"><img src="https://discordapp.com/api/guilds/718762019586572341/widget.png?style=banner1"></a>
</p>
Contributions are always welcomed, but make sure to read [Contributing.md](/CONTRIBUTING.md) first.
<h1 align="center"> Contributors </h1>
![Contributors](https://badges.pufler.dev/contributors/night0721/cath.exe?bots=false)
Contributions are always welcomed, but make sure to read [Contributing.md](/CONTRIBUTING.md) first.
<!-- ## Special Thanks to The Roound Table from Cygnoux Familia.
![Contributors](https://badges.pufler.dev/contributors/night0721/cath.exe?bots=false)
<p align = "center">
<a href="https://discord.gg/mjVwkCsWY7" target="_blank"><img src="https://discordapp.com/api/guilds/756525751594909797/widget.png?style=banner1"></a>
</p> --> <img src="https://socialify.git.ci/night0721/cath.exe/image?description=1&descriptionEditable=A%20Discord.js%20v13%20Template%20based%20on%20cath.exe&font=Raleway&forks=1&issues=1&language=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Dark">
<!-- <img src="https://socialify.git.ci/night0721/cath.exe/image?description=1&descriptionEditable=A%20Discord.js%20v13%20Template%20based%20on%20cath.exe&font=Raleway&forks=1&issues=1&language=1&owner=1&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Dark"> -->

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

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

View file

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

View file

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

1111
LICENSE

File diff suppressed because it is too large Load diff

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

File diff suppressed because it is too large Load diff

View file

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

View file

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

View file

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

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

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,106 +0,0 @@
const axios = require("axios");
const { MessageAttachment } = require("discord.js");
module.exports = {
name: "watermark",
description: "Add a water to leaks",
options: [
{
type: 3,
name: "photo",
description: "Link of photo",
required: true,
},
{
type: 3,
name: "position",
description: "Where you want to place the water mark",
required: true,
choices: [
{
name: "Middle",
value: "middle",
},
{
name: "ButtomRight",
value: "buttomright",
},
],
},
{
type: 3,
name: "opacity",
description:
"Opacity of watermark(50 - 100) Lower or higher will be ignored",
required: true,
},
{
type: 3,
name: "logo",
description: "The Logo you want to use",
required: true,
choices: [
{
name: "Discord Nicecat",
value: "discord_nicecat",
},
{
name: "NoLink Leakers",
value: "nolink_leakers",
},
{
name: "Discord Leakers",
value: "discord_leakers",
},
{
name: "DogeBeanie",
value: "doge",
},
{
name: "CODM N3W3",
value: "n3w3",
},
{
name: "Alyan Gaming",
value: "alyan",
},
{
name: "Murdablast",
value: "murdablast",
},
{
name: "Sasha",
value: "sasha",
},
{
name: "Umair Gamer",
value: "umair",
},
],
},
{
type: 3,
name: "password",
description: "The password in order to use this command",
required: true,
},
],
run: async (client, interaction, args) => {
const data = await axios
.get(
`${process.env.api}/api/v1/codm/watermark?photo=${args[0]}&position=${args[1]}&opacity=${args[2]}&logo=${args[3]}&password=${args[4]}`
)
.then(res => res.data)
.catch();
if (!data) {
interaction.followUp({
content: "You have either wrong input or you are unauthorized",
});
} else {
const ima = new MessageAttachment(
`${process.env.api}/api/v1/codm/watermark?photo=${args[0]}&position=${args[1]}&opacity=${args[2]}&logo=${args[3]}&password=${args[4]}`,
`${args[2]}.png`
);
interaction.followUp({ files: [ima] });
}
},
};

View file

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

View file

@ -1,537 +1,246 @@
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", description: "Configure settings for the server",
description: "Configure settings for the server", UserPerms: ["ADMINISTRATOR"],
UserPerms: ["ADMINISTRATOR"], category: "Config",
category: "Config", options: [
options: [ {
{ type: 2,
type: 1, name: "enable",
name: "muterole", description: "Enable commands/category for the server",
description: "Configure mute role settings for the server", options: [
options: [ {
{ type: 1,
type: 8, name: "command",
name: "role", description: "To enable commands",
description: "The role for muted users", options: [
required: true, {
}, type: 3,
], name: "name",
}, description: "The command name to be enabled",
{ required: true,
type: 1, },
name: "prefix", ],
description: "Configure prefix settings for the server", },
options: [ {
{ type: 1,
type: 3, name: "category",
name: "prefix", description: "To enable categories",
description: "The prefix for the server", options: [
required: true, {
choices: [], type: 3,
}, name: "name",
], description: "The category name to be enabled",
}, required: true,
{ choices: [
type: 1, {
name: "welcome", name: "codm",
description: "Configure welcome channel settings for the server", value: "CODM",
options: [ },
{ {
type: 7, name: "config",
name: "channel", value: "Config",
description: "The channel for welcome messages", },
required: true, {
channelTypes: ["GUILD_TEXT"], name: "information",
}, value: "Information",
], },
}, {
{ name: "utilities",
type: 1, value: "Utilities",
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: 2,
}, name: "disable",
], description: "Disable commands/category for the server",
}, options: [
{ {
type: 1, type: 1,
name: "starboard", name: "command",
description: "Configure starboard channel settings for the server", description: "To disable commands",
options: [ options: [
{ {
type: 7, type: 3,
name: "channel", name: "name",
description: "The channel for starboard messages", description: "The command name to be disabled",
required: true, required: true,
channelTypes: ["GUILD_TEXT"], },
}, ],
{ },
type: 4, {
name: "starcount", type: 1,
description: "The required amount of star to trigger the starboard", name: "category",
required: true, description: "To disable categories",
}, options: [
], {
}, type: 3,
{ name: "name",
type: 1, description: "The category name to be disabled",
name: "chatbot", required: true,
description: "Configure chatbot channel settings for the server", choices: [
options: [ {
{ name: "codm",
type: 7, value: "CODM",
name: "channel", },
description: "The channel for chatbotmessages", {
required: true, name: "config",
channelTypes: ["GUILD_TEXT"], value: "Config",
}, },
],
}, {
{ name: "information",
type: 1, value: "Information",
name: "log", },
description: "Configure log channel settings for the server", {
options: [ name: "utilities",
{ value: "Utilities",
type: 7, },
name: "channel", ],
description: "The channel for log messages", },
required: true, ],
channelTypes: ["GUILD_TEXT"], },
}, ],
], },
}, {
{ type: 1,
type: 2, name: "tips",
name: "enable", description: "Configure tips settings for the server",
description: "Enable commands/category for the server", options: [
options: [ {
{ type: 5,
type: 1, name: "choice",
name: "command", description: "Set whether tips system is activated for the server",
description: "To enable commands", required: true,
options: [ },
{ ],
type: 3, },
name: "name", {
description: "The command name to be enabled", type: 1,
required: true, name: "overall",
}, description: "See overall settings for the server",
], options: [],
}, },
{ ],
type: 1, run: async (client, interaction, args, utils, data) => {
name: "category", if (args[0].toLowerCase() === "tips") {
description: "To enable categories", if (args[1]) {
options: [ await client.data.setTips(interaction.guild.id, "true");
{ interaction.followUp({
type: 3, content: `Tips is enabled in this server now.`,
name: "name", });
description: "The category name to be enabled", } else {
required: true, await client.data.setTips(interaction.guild.id, "false");
choices: [ interaction.followUp({
{ content: `Tips is disabled in this server now.`,
name: "codm", });
value: "CODM", }
}, } else if (args[0].toLowerCase() === "enable") {
{ const type = args[1].toLowerCase();
name: "config", const name = args[2].toLowerCase();
value: "Config", if (type === "command") {
}, if (!!client.slashCommands.get(name) === false) {
{ interaction.followUp({
name: "economy", content: `There isn't any command/category named \`${name}\``,
value: "Economy", });
}, } else if (!data.Guild.Commands.includes(name)) {
{ interaction.followUp({
name: "fun", content: `\`${args[2]}\` command had already been enabled`,
value: "Fun", });
}, } else if (
{ data.Guild.Commands.includes(name) &&
name: "information", !!client.slashCommands.get(name) === true
value: "Information", ) {
}, await client.data.enable(interaction.guild.id, "command", name);
{ interaction.followUp({
name: "moderation", content: `\`${args[2]}\` command is now enabled`,
value: "Moderation", });
}, }
{ }
name: "utilities", if (type === "category") {
value: "Utilities", const category = fs.readdirSync("./command");
}, if (!data.Guild.Category.includes(args[2])) {
], interaction.followUp({
}, content: `\`${args[2]}\` category had already been enabled`,
], });
}, }
], if (
}, data.Guild.Category.includes(args[2]) &&
{ category.includes(args[2])
type: 2, ) {
name: "disable", await client.data.enable(interaction.guild.id, "category", args[2]);
description: "Disable commands/category for the server", interaction.followUp({
options: [ content: `\`${args[2]}\` category is now enabled`,
{ });
type: 1, }
name: "command", }
description: "To disable commands", } else if (args[0].toLowerCase() === "disable") {
options: [ const type = args[1].toLowerCase();
{ const name = args[2].toLowerCase();
type: 3, if (type === "command") {
name: "name", if (!!client.slashCommands.get(name) === false) {
description: "The command name to be disabled", interaction.followUp({
required: true, content: `There isn't any command/category named \`${name}\``,
}, });
], } else if (data.Guild.Commands.includes(name)) {
}, interaction.followUp({
{ content: `\`${args[2]}\` command had already been disabled`,
type: 1, });
name: "category", } else if (
description: "To disable categories", !data.Guild.Commands.includes(name) &&
options: [ !!client.slashCommands.get(name) === true
{ ) {
type: 3, await client.data.disable(interaction.guild.id, "command", name);
name: "name", interaction.followUp({
description: "The category name to be disabled", content: `\`${args[2]}\` command is now disabled`,
required: true, });
choices: [ }
{ }
name: "codm", if (type === "category") {
value: "CODM", const category = fs.readdirSync("./command");
}, if (data.Guild.Category.includes(args[2])) {
{ interaction.followUp({
name: "config", content: `\`${args[2]}\` category had already been disabled`,
value: "Config", });
}, }
{ if (
name: "economy", !data.Guild.Category.includes(args[2]) &&
value: "Economy", category.includes(args[2])
}, ) {
{ await client.data.disable(interaction.guild.id, "category", args[2]);
name: "fun", interaction.followUp({
value: "Fun", content: `\`${args[2]}\` category is now disabled`,
}, });
{ }
name: "information", }
value: "Information", } else {
}, const d = `
{ **Prefix**: ${data.Guild.Prefix ? data.Guild.Prefix : "C."}
name: "moderation", **Tips**: ${data.Guild.Tips ? "Enable" : "Disabled"}
value: "Moderation", **Disabled Commands**: ${
}, data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None"
{ }
name: "utilities", **Disabled Categories**: ${
value: "Utilities", data.Guild.Category.length ? data.Guilds.Category.join(",") : "None"
}, }
], `;
}, const embed = new EmbedBuilder()
], .setTitle(`**${interaction.guild.name}** Settings`)
}, .setColor(client.color)
], .setFooter({
}, text: `Made by ${client.author}`,
{ iconURL: client.user.displayAvatarURL({ dynamic: true }),
type: 1, })
name: "level", .setTimestamp()
description: "Configure level settings for the server", .setDescription(d);
options: [ interaction.followUp({ embeds: [embed] });
{ }
type: 5, },
name: "choice", };
description: "Set whether level system is activated for the server",
required: true,
},
],
},
{
type: 1,
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: 1,
name: "tips",
description: "Configure tips settings for the server",
options: [
{
type: 5,
name: "choice",
description: "Set whether tips system is activated for the server",
required: true,
},
],
},
{
type: 1,
name: "overall",
description: "See overall settings for the server",
options: [],
},
],
run: async (client, interaction, args, utils, data) => {
if (args[0].toLowerCase() === "muterole") {
const role = interaction.guild.roles.cache.get(args[1]);
if (role.managed) {
interaction.followUp({ content: "You must provide a non bot role" });
} else {
await client.data.setMuterole(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${role.name}** as the mute role`,
});
}
} else if (args[0].toLowerCase() === "prefix") {
await client.data.setPrefix(interaction.guild.id, args[1]);
interaction.followUp({ content: `Saved \`${args[2]}\` as the prefix` });
} else if (args[0].toLowerCase() === "welcome") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
await client.data.setWelcome(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the welcome channel`,
});
}
} else if (args[0].toLowerCase() === "goodbye") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
await client.data.setGoodbye(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the goodbye channel`,
});
}
} else if (args[0].toLowerCase() === "starboard") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
starboardClient.config.guilds.add({
id: interaction.guild.id,
options: {
starCount: args[2],
starboardChannel: args[1],
},
});
await client.data.setStarboard(interaction.guild.id, args[1], args[2]);
interaction.followUp({
content: `Saved **${channel}** as the starboard channel`,
});
}
} else if (args[0].toLowerCase() === "chatbot") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
await client.data.setChatbot(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the chatbot channel`,
});
}
} else if (args[0].toLowerCase() === "log") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
let webhookid;
let webhooktoken;
await channel
.createWebhook(interaction.guild.name, {
avatar: interaction.guild.iconURL({ format: "png" }),
})
.then(webhook => {
webhookid = webhook.id;
webhooktoken = webhook.token;
});
await client.data.setLog(
interaction.guild.id,
channel.id,
webhookid,
webhooktoken
);
interaction.followUp({
content: `Saved **${channel}** as the log channel`,
});
}
} else if (args[0].toLowerCase() === "level") {
if (args[1]) {
await client.data.setGLevel(interaction.guild.id, "true");
interaction.followUp({
content: `Levelling is enabled in this server now.`,
});
} else {
await client.data.setGLevel(interaction.guild.id, "false");
interaction.followUp({
content: `Levelling is disabled in this server now.`,
});
}
} else if (args[0].toLowerCase() === "nsfw") {
if (args[1]) {
await client.data.setNSFW(interaction.guild.id, "true");
interaction.followUp({
content: `NSFW is enabled in this server now.`,
});
} else {
await client.data.setNSFW(interaction.guild.id, "false");
interaction.followUp({
content: `NSFW is disabled in this server now.`,
});
}
} else if (args[0].toLowerCase() === "tips") {
if (args[1]) {
await client.data.setTips(interaction.guild.id, "true");
interaction.followUp({
content: `Tips is enabled in this server now.`,
});
} else {
await client.data.setTips(interaction.guild.id, "false");
interaction.followUp({
content: `Tips is disabled in this server now.`,
});
}
} else if (args[0].toLowerCase() === "enable") {
const type = args[1].toLowerCase();
const name = args[2].toLowerCase();
if (type === "command") {
if (!!client.slashCommands.get(name) === false) {
interaction.followUp({
content: `There isn't any command/category named \`${name}\``,
});
} else if (!data.Guild.Commands.includes(name)) {
interaction.followUp({
content: `\`${args[2]}\` command had already been enabled`,
});
} else if (
data.Guild.Commands.includes(name) &&
!!client.slashCommands.get(name) === true
) {
await client.data.enable(interaction.guild.id, "command", name);
interaction.followUp({
content: `\`${args[2]}\` command is now enabled`,
});
}
}
if (type === "category") {
const category = fs.readdirSync("./command");
if (!data.Guild.Category.includes(args[2])) {
interaction.followUp({
content: `\`${args[2]}\` category had already been enabled`,
});
}
if (
data.Guild.Category.includes(args[2]) &&
category.includes(args[2])
) {
await client.data.enable(interaction.guild.id, "category", args[2]);
interaction.followUp({
content: `\`${args[2]}\` category is now enabled`,
});
}
}
} else if (args[0].toLowerCase() === "disable") {
const type = args[1].toLowerCase();
const name = args[2].toLowerCase();
if (type === "command") {
if (!!client.slashCommands.get(name) === false) {
interaction.followUp({
content: `There isn't any command/category named \`${name}\``,
});
} else if (data.Guild.Commands.includes(name)) {
interaction.followUp({
content: `\`${args[2]}\` command had already been disabled`,
});
} else if (
!data.Guild.Commands.includes(name) &&
!!client.slashCommands.get(name) === true
) {
await client.data.disable(interaction.guild.id, "command", name);
interaction.followUp({
content: `\`${args[2]}\` command is now disabled`,
});
}
}
if (type === "category") {
const category = fs.readdirSync("./command");
if (data.Guild.Category.includes(args[2])) {
interaction.followUp({
content: `\`${args[2]}\` category had already been disabled`,
});
}
if (
!data.Guild.Category.includes(args[2]) &&
category.includes(args[2])
) {
await client.data.disable(interaction.guild.id, "category", args[2]);
interaction.followUp({
content: `\`${args[2]}\` category is now disabled`,
});
}
}
} else {
const d = `
**Mute Role**: ${
interaction.guild.roles.cache.get(data.Guild.Muterole)
? interaction.guild.roles.cache.get(data.Guild.Muterole)
: "None"
}
**Prefix**: ${data.Guild.Prefix ? data.Guild.Prefix : "C."}
**Welcome Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Welcome)
? interaction.guild.channels.cache.get(data.Guild.Welcome)
: "None"
}
**Goodbye Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Goodbye)
? interaction.guild.channels.cache.get(data.Guild.Goodbye)
: "None"
}
**Starboard Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Starboard)
? interaction.guild.channels.cache.get(data.Guild.Starboard)
: "None"
}
**Chatbot Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Chatbot)
? interaction.guild.channels.cache.get(data.Guild.Chatbot)
: "None"
}
**Log Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Log)
? interaction.guild.channels.cache.get(data.Guild.Log)
: "None"
}
**Level**: ${data.Guild.Level ? "Enable" : "Disabled"}
**NSFW**: ${data.Guild.NSFW ? "Enable" : "Disabled"}
**Tips**: ${data.Guild.Tips ? "Enable" : "Disabled"}
**Disabled Commands**: ${
data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None"
}
**Disabled Categories**: ${
data.Guild.Category.length ? data.Guilds.Category.join(",") : "None"
}
`;
const embed = new MessageEmbed()
.setTitle(`**${interaction.guild.name}** Settings`)
.setColor(client.color)
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp()
.setDescription(d);
interaction.followUp({ embeds: [embed] });
}
},
};

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: 1,
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: 1,
name: "list",
description: "See the information for the guns",
options: [],
},
{
type: 1,
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(dares[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(truth[Math.round(Math.random() * tnd.truth.length)])
.setColor(client.color)
.setFooter({
text: `Made by ${client.author}`,
iconURL: client.user.displayAvatarURL(),
})
.setTimestamp();
interaction.followUp({ embeds: [embed] });
},
};

View file

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

View file

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

View file

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

View file

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

View file

@ -1,32 +1,34 @@
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 EmbedBuilder()
const Embed = new MessageEmbed() .setTitle("<a:pong:897383314405605436> Pong!")
.setTitle("<a:pong:897383314405605436> Pong!") .setAuthor({
.setAuthor( name: interaction.user.username,
`${interaction.user.username}`, iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
interaction.user.displayAvatarURL() })
) .setDescription(
.setDescription( `\n 📨 • **Message Latency** \`${Math.floor(messageping)}ms\`
`\n 📨 • **Message Latency** \`${Math.floor(messageping)}ms\` \n🛰 **Bot Latency** \`${Math.round(client.ws.ping)}ms\``
\n🛰 **Bot Latency** \`${Math.round(client.ws.ping)}ms\`` )
) .setFooter({
.setFooter(`Made by ${client.author}`, client.user.displayAvatarURL()) text: `Made by ${client.author}`,
.setTimestamp() iconURL: client.user.displayAvatarURL({ dynamic: true }),
.setColor( })
messageping < 350 .setTimestamp()
? "GREEN" .setColor(
: messageping < 500 && messageping > 350 messageping < 350
? "YELLOW" ? "#008000"
: "RED" : messageping < 500 && messageping > 350
); ? "#ffff31"
interaction.followUp({ embeds: [Embed] }); : "#ff0000"
}, );
}; interaction.followUp({ embeds: [Embed] });
},
};

View file

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

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: 1,
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: 1,
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: 1,
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: 1,
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: 1,
name: "track",
description: "Loop the track",
options: [],
},
{
type: 1,
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,40 +0,0 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "ass",
description: "Get some ass images",
run: async (client, interaction) => {
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(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
} else {
const subreddits = ["ass", "BestBooties", "BootyGIFs", "booty_queens"];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
interaction.followUp({
embeds: [
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 }),
},
}),
],
});
}
},
};

View file

@ -1,48 +0,0 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "blowjob",
description: "Get some blowjob images",
run: async (client, interaction) => {
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(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
} else {
const subreddits = [
"BlowJob",
"blowjobs",
"blowjobgifs",
"OralSex",
"PushHerHead",
"ThroatFuck",
];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
interaction.followUp({
embeds: [
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 }),
},
}),
],
});
}
},
};

View file

@ -1,40 +0,0 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "boobs",
description: "Get some boobie images",
run: async (client, interaction) => {
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(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
} else {
const subreddits = ["boobs", "GrabHerTitties", "titfuck"];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
interaction.followUp({
embeds: [
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 }),
},
}),
],
});
}
},
};

View file

@ -1,40 +0,0 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "hentai",
description: "Get some hentai images",
run: async (client, interaction) => {
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(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
} else {
const subreddits = ["hentai", "HentaiAnime", "nekogirls"];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
interaction.followUp({
embeds: [
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 }),
},
}),
],
});
}
},
};

View file

@ -1,42 +0,0 @@
const { MessageEmbed } = require("discord.js");
const { getreddit } = require("cath");
module.exports = {
name: "pussy",
description: "Get some vagina images",
run: async (client, interaction) => {
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(`Made by ${client.author}`, client.user.displayAvatarURL())
.setTimestamp();
interaction.followUp({ embeds: [embed] });
return;
} else {
const subreddits = ["vagina", "GodPussy", "peachlips"];
const reddit = subreddits[Math.round(Math.random() * subreddits.length)];
const data = await getreddit(reddit);
interaction.followUp({
embeds: [
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 }),
},
}),
],
});
}
},
};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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