Compare commits

..

176 Commits

Author SHA1 Message Date
3db736d3f3 Merge pull request #75 from warengroup/develop
Version 0.3.11
2021-09-18 15:24:36 +03:00
22bb8c7467 Update Streamer class 2021-09-18 15:09:34 +03:00
12db2c5fcc Fix typo & memory leak in Streamer class 2021-09-18 15:02:13 +03:00
51a038096a Fix typo in maintenance command 2021-09-18 15:01:27 +03:00
53fda7c401 Catch errors inside loadEntry method in Datastore class 2021-09-18 02:17:00 +03:00
a7f3029be0 Fix typo in maintenance command 2021-09-18 02:14:13 +03:00
9f373368b3 Bumb Version 2021-09-17 23:48:49 +03:00
0945c7c26c Merge pull request #72 from warengroup/develop
Version 0.3.10
2021-09-17 23:41:31 +03:00
871cb475f9 Streamlined restore method in Radio class with play command 2021-09-17 23:29:04 +03:00
57aaf92947 Prevent loadState function updating datastore entries everytime 2021-09-17 23:24:48 +03:00
dc7b14b11a Fix Stations class bug 2021-09-17 23:14:24 +03:00
0f5022df15 Bumb Version 2021-09-17 13:07:43 +03:00
8f256d9bc3 Merge pull request #63 from warengroup/develop
Version 0.3.9
2021-09-17 12:55:56 +03:00
b686afba98 Update play function 2021-09-17 12:52:37 +03:00
f08eeb435c Update play function 2021-09-17 12:47:00 +03:00
7a8c10c6d4 Update nowplaying command 2021-09-17 12:46:46 +03:00
b38dfa039d Update messages 2021-09-17 12:46:35 +03:00
b07f0d4942 Update Dependencies 2021-09-17 12:44:55 +03:00
788216c373 Update Radio class 2021-09-16 19:43:40 +03:00
ead52decf2 Update voiceStateUpdate event 2021-09-16 19:43:19 +03:00
7757788f99 Merge pull request #70 from warengroup/dependabot/npm_and_yarn/develop/prettier-2.4.1
Bump prettier from 2.4.0 to 2.4.1
2021-09-16 13:29:58 +03:00
ddff397fe4 Bump prettier from 2.4.0 to 2.4.1
Bumps [prettier](https://github.com/prettier/prettier) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.4.0...2.4.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-16 08:03:10 +00:00
8fc441c1b3 Update play command 2021-09-16 05:41:59 +03:00
0ee3ca5e08 Update ready event 2021-09-16 05:35:40 +03:00
214dff29d5 Update Streamer class 2021-09-16 05:35:26 +03:00
cc3b2a50cf Update Statistics class 2021-09-16 05:35:12 +03:00
ee08232128 Update Stations class 2021-09-16 05:35:02 +03:00
f9d5be189e Update Radio class 2021-09-16 05:34:52 +03:00
a8513ce514 Update listStations function 2021-09-16 05:17:47 +03:00
9ecdbc2bee Update check function 2021-09-16 05:17:33 +03:00
5ee30b1782 Update ready event 2021-09-16 05:17:18 +03:00
4bf74f15a2 Revert c7ddc6e 2021-09-16 05:16:41 +03:00
ccb386e3b3 Update Stations class 2021-09-16 05:13:22 +03:00
dbedb83104 Fix typo in Radio class 2021-09-16 05:13:07 +03:00
b34120e688 Update listStations function 2021-09-16 04:53:48 +03:00
90c7c667e4 Update check function 2021-09-16 04:53:31 +03:00
062a163a11 Update voiceStateUpdate event 2021-09-16 04:53:15 +03:00
1f4c3a08d0 Update SIGINT event 2021-09-16 04:52:56 +03:00
acc7ab1727 Update ready event 2021-09-16 04:52:41 +03:00
c7ddc6ec5b Update multiple commands 2021-09-16 04:52:30 +03:00
6d22dda0ae Update Client.ts 2021-09-16 04:51:36 +03:00
bfba8304e4 Update Streamer class 2021-09-16 04:51:23 +03:00
7d38170ba6 Removed calculateGlobal function in Datastore class 2021-09-16 04:50:44 +03:00
348b540c06 Remove few functions 2021-09-16 04:48:58 +03:00
330c33b3d7 Add Statistics class 2021-09-16 04:46:54 +03:00
dfa9548b59 Add Stations class 2021-09-16 04:46:42 +03:00
b351bbebed Add Radio class 2021-09-16 04:46:30 +03:00
469374f25e Update Streamer class 2021-09-16 03:34:31 +03:00
72c1609503 Update statusField order in status.js 2021-09-16 03:19:25 +03:00
8d5291cbb0 Moved commands map to commands.js 2021-09-16 03:17:50 +03:00
ebf1d0759e Update commands.js 2021-09-16 02:52:40 +03:00
c829f70418 Add devMode to config 2021-09-16 02:52:24 +03:00
341bddd4cd Update .env_example 2021-09-16 02:51:07 +03:00
460a5415e5 Update Dependencies 2021-09-16 02:36:06 +03:00
a4d984f19c Update Datastore class 2021-09-16 02:27:33 +03:00
09ae458ff1 Update play function 2021-09-16 02:26:11 +03:00
00f6ee71e0 Update interactionCreate event 2021-09-16 02:17:14 +03:00
126d5e9ba2 Update play command 2021-09-16 02:07:05 +03:00
d64b0ac0cb Change default streamerMode to manual 2021-09-16 01:21:33 +03:00
bfb27e7359 Update play command 2021-09-16 01:13:17 +03:00
48445afdd5 Update Streamer event 2021-09-16 01:11:31 +03:00
4854e622b3 Update maintenance command 2021-09-15 17:26:04 +03:00
9d9c8a6a07 Update Streamer class 2021-09-15 17:25:55 +03:00
7040300b3e Update Streamer class 2021-09-14 18:02:11 +03:00
24478b6320 Update saveRadios function 2021-09-14 17:13:37 +03:00
a43a788e15 Update play command 2021-09-14 17:13:17 +03:00
2892913caa Update maintenance command 2021-09-14 17:12:47 +03:00
930d481fcf Update Streamer class 2021-09-14 17:12:30 +03:00
81a9d7be7c Update Datastore class 2021-09-14 17:12:18 +03:00
45e5019b28 Merge branch 'develop' of https://github.com/warengroup/eximiabots-radiox into develop 2021-09-14 14:52:29 +03:00
b76b7a107c Update maintenance command 2021-09-14 14:52:04 +03:00
87295d10c1 Merge pull request #67 from warengroup/dependabot/npm_and_yarn/develop/typescript-eslint/eslint-plugin-4.31.1
Bump @typescript-eslint/eslint-plugin from 4.31.0 to 4.31.1
2021-09-14 11:43:44 +03:00
d03b8cdb1d Bump @typescript-eslint/eslint-plugin from 4.31.0 to 4.31.1
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.31.0 to 4.31.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.31.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-14 08:42:36 +00:00
fd8c1ec31b Merge pull request #66 from warengroup/dependabot/npm_and_yarn/develop/typescript-eslint/parser-4.31.1
Bump @typescript-eslint/parser from 4.31.0 to 4.31.1
2021-09-14 11:41:57 +03:00
720d356d1f Bump @typescript-eslint/parser from 4.31.0 to 4.31.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.31.0 to 4.31.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.31.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-14 08:03:00 +00:00
4b0efe7491 Update maintenance command 2021-09-12 17:49:21 +03:00
a20e7a1c8e Update ready.js 2021-09-12 17:49:07 +03:00
88fdad4ab9 Update maintenance command 2021-09-12 17:39:38 +03:00
3ed49f88ab Update Streamer class 2021-09-12 17:39:23 +03:00
752bd07c5d client.config.maintenance to client.config.maintenanceMode 2021-09-12 17:38:52 +03:00
b08de94c64 Update functions 2021-09-12 17:37:43 +03:00
892c5f9902 Update Streamer class 2021-09-12 17:09:32 +03:00
3029a8a653 Hide owner in now playing when station name is same in play command 2021-09-12 17:08:31 +03:00
86510a8871 Hide owner in now playing when station name is same in nowplaying command 2021-09-12 17:08:20 +03:00
e85b864170 Add streamerMode setting to config 2021-09-12 17:07:41 +03:00
727f8f5177 Update Dependencies 2021-09-12 16:48:11 +03:00
ad9a2f8f19 Update restoreRadios function 2021-09-11 23:58:39 +03:00
803bc20fb7 Update voiceStateUpdate event 2021-09-11 23:58:24 +03:00
7d479b4c5f Update Streamer class 2021-09-11 23:19:49 +03:00
ffa9c8abb0 Update Streamer class 2021-09-11 23:12:39 +03:00
49475212a7 Update Streamer class 2021-09-11 23:03:20 +03:00
824d4042c1 Update maintenance command 2021-09-11 23:02:37 +03:00
0c76c137b9 Update ready.js 2021-09-11 23:02:12 +03:00
accff3fa60 Update Streamer class 2021-09-11 22:35:06 +03:00
1cfa62802f Update play command 2021-09-11 18:27:21 +03:00
9019741146 Update stop command 2021-09-11 18:27:12 +03:00
095b6ad775 Update Streamer class 2021-09-11 18:27:01 +03:00
a043cde46e Update logger function 2021-09-11 18:03:27 +03:00
bfec178de7 Update Streamer class 2021-09-11 18:01:53 +03:00
12f3948e40 Update SIGINT event 2021-09-11 17:35:20 +03:00
0bc26f8895 Update Streamer class 2021-09-11 17:34:50 +03:00
b66a60ebe9 Formatting Streamer class 2021-09-11 17:17:42 +03:00
b4a24de8cd Update play command 2021-09-11 17:16:11 +03:00
9517ba1fa9 Update play function 2021-09-11 17:16:03 +03:00
73d330d1e2 Update stop command 2021-09-11 17:15:27 +03:00
13ae6c2716 Update next command 2021-09-11 17:15:04 +03:00
645ea3e197 Update prev command 2021-09-11 17:14:55 +03:00
fcf6f15be9 Update ready event 2021-09-11 17:14:43 +03:00
3d066435b4 Update SIGINT event 2021-09-11 17:14:21 +03:00
26eda76b23 Update saveRadios function 2021-09-11 17:14:02 +03:00
05905e6e6d Update restoreRadios function 2021-09-11 17:13:47 +03:00
1533ae46a4 Update voiceStateUpdate event 2021-09-11 17:12:53 +03:00
2b72f87256 Update Client.ts 2021-09-11 17:11:10 +03:00
8bf79c2744 Create Streamer class 2021-09-11 17:10:50 +03:00
45923319a6 Create Radio class 2021-09-11 17:10:37 +03:00
d8daacf80e Updated Dependencies 2021-09-11 15:12:29 +03:00
24eaf3a7e2 Update ready.js 2021-09-10 23:41:48 +03:00
57f63c3838 Move Datastore class to src/client/classes folder 2021-09-10 23:25:48 +03:00
b9e1945719 Update Dependencies 2021-09-10 23:23:29 +03:00
0b8fb4977c Update maintenance command 2021-09-10 03:17:22 +03:00
a5eec44b8e Fix maintenance command 2021-09-10 03:13:40 +03:00
e2ebe6a36e Bumb version 2021-09-10 02:33:56 +03:00
5132e40d2c Merge pull request #57 from warengroup/develop
Version 0.3.8
2021-09-10 02:09:50 +03:00
1d6361871c Update Client.ts 2021-09-10 01:54:43 +03:00
3978f19b2e Fix typo in uncaughtException event 2021-09-10 01:54:30 +03:00
26cdef50b2 Update Client.ts 2021-09-10 01:44:21 +03:00
fee833d231 Update warning event 2021-09-10 01:43:53 +03:00
6541287dec Update uncaughtException event 2021-09-10 01:43:21 +03:00
44d81b6fd7 Add warning event 2021-09-10 01:21:42 +03:00
200f16eac0 Disable Node warnings in package.json 2021-09-10 01:21:14 +03:00
8c9fe03629 Updated Dependencies 2021-09-10 00:24:30 +03:00
24071eb5df Update Client.ts 2021-09-09 18:55:42 +03:00
3b5c241872 Update ready.js 2021-09-09 18:55:33 +03:00
44a708548f Update maintenance command 2021-09-09 18:55:18 +03:00
5c1a8f0ef1 Add maintenance mode in config.js 2021-09-09 18:54:51 +03:00
526bb7736a Update list command 2021-09-09 18:54:23 +03:00
22c0544d09 Add maintenance mode check in play command 2021-09-09 18:53:46 +03:00
9c3748ad7c Add maintenance mode to check function 2021-09-09 18:53:24 +03:00
3807ae89a0 Add maintenance message in messages.js 2021-09-09 18:52:50 +03:00
9e2be295c3 Update stop command 2021-09-09 18:52:25 +03:00
fb257d1c30 Add CONTRIBUTING.md to labeler config 2021-09-09 18:51:42 +03:00
17a075cd29 Add CONTRIBUTING.md 2021-09-09 18:51:25 +03:00
93b5663ebe Added SECURITY.md to be labeled with documentation in labeler config 2021-09-09 17:57:15 +03:00
8399fd5bb1 Added security policy in SECURITY.md 2021-09-09 17:56:51 +03:00
364b5d9b3c Merge pull request #35 from warengroup/fix-33
Node-Fetch Update
2021-09-09 13:05:02 +03:00
e08c20aa3d Merge branch 'develop' into fix-33 2021-09-09 13:03:46 +03:00
65bebb7b13 Bumb version 2021-09-09 12:56:34 +03:00
13814afebc Formatting changes 2021-09-09 12:44:50 +03:00
b44bc679e5 Added VSCode settings 2021-09-09 12:43:12 +03:00
c83b90aa20 Removed .vscode folder in .gitignore 2021-09-09 12:42:10 +03:00
1bb8d8d801 Updated SIGINT event 2021-09-09 12:05:52 +03:00
0b1cb03305 Added exit event in Client.ts 2021-09-09 12:05:39 +03:00
90a93d35f7 Removed comments in maintenance.js 2021-09-09 12:05:15 +03:00
24716dd497 Updated Dependencies 2021-09-09 11:26:37 +03:00
259b58aa1a Merge pull request #59 from warengroup/dependabot/npm_and_yarn/develop/types/node-16.9.0
Bump @types/node from 16.7.13 to 16.9.0
2021-09-09 11:24:16 +03:00
52ec0845a7 Merge pull request #60 from warengroup/dependabot/npm_and_yarn/develop/discord-api-types-0.23.1
Bump discord-api-types from 0.23.0 to 0.23.1
2021-09-09 11:24:06 +03:00
ddbe950a19 Bump discord-api-types from 0.23.0 to 0.23.1
Bumps [discord-api-types](https://github.com/discordjs/discord-api-types) from 0.23.0 to 0.23.1.
- [Release notes](https://github.com/discordjs/discord-api-types/releases)
- [Changelog](https://github.com/discordjs/discord-api-types/blob/main/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord-api-types/compare/0.23.0...0.23.1)

---
updated-dependencies:
- dependency-name: discord-api-types
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-09 08:02:59 +00:00
46790b12ff Bump @types/node from 16.7.13 to 16.9.0
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.7.13 to 16.9.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-09 08:02:40 +00:00
488d0a6d12 Merge pull request #58 from warengroup/dependabot/npm_and_yarn/develop/discord-api-types-0.23.0
Bump discord-api-types from 0.22.0 to 0.23.0
2021-09-08 15:51:45 +03:00
7699871779 Bump discord-api-types from 0.22.0 to 0.23.0
Bumps [discord-api-types](https://github.com/discordjs/discord-api-types) from 0.22.0 to 0.23.0.
- [Release notes](https://github.com/discordjs/discord-api-types/releases)
- [Changelog](https://github.com/discordjs/discord-api-types/blob/main/CHANGELOG.md)
- [Commits](https://github.com/discordjs/discord-api-types/compare/0.22.0...0.23.0)

---
updated-dependencies:
- dependency-name: discord-api-types
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-08 08:02:48 +00:00
ac323a5410 Temporary solution 2021-09-08 01:39:35 +03:00
9408d0d66b Bumb version 2021-09-07 15:49:13 +03:00
5cd3912ff5 Merge branch 'master' into fix-33 2021-09-07 15:47:24 +03:00
34abb66086 Merge branch 'master' into fix-33 2021-09-06 22:49:37 +03:00
c5d04aed3c Merge branch 'master' into fix-33 2021-09-06 05:46:49 +03:00
f5ef44b12a Merge branch 'master' into fix-33 2021-09-05 06:32:46 +03:00
55905e3841 Merge branch 'master' into fix-33 2021-09-04 14:04:24 +03:00
190852bc16 Bumb version 2021-09-04 13:46:10 +03:00
73857c9fc5 Bumb Version 2021-09-03 05:31:02 +03:00
853661ff52 Merge branch 'master' into fix-33 2021-09-03 05:27:59 +03:00
41fb87fab6 Merge branch 'master' into fix-33 2021-09-03 01:57:31 +03:00
65bd82054a Merge branch 'develop' into fix-33 2021-09-01 18:01:56 +03:00
40879c85bb Example solutions but dont work due to typescript 2021-09-01 17:47:12 +03:00
0858f9e49e Updated invite link 2021-09-01 13:56:54 +03:00
a1aa96fc2f Added radio.message?.delete in voiceStateUpdate 2021-09-01 12:51:17 +03:00
6ed91fe43b Updated Dependencies 2021-09-01 12:41:46 +03:00
59 changed files with 1185 additions and 750 deletions

View File

@ -4,4 +4,4 @@
datastore
Dockerfile
LICENSE
README.md
README.md

View File

@ -1,2 +1,5 @@
DISCORD_TOKEN=
RADIOX_STATIONSLISTURL=https://gitea.cwinfo.org/cwchristerw/radio/raw/branch/master/playlist.json
RADIOX_STATIONSLISTURL=https://gitea.cwinfo.org/cwchristerw/radio/raw/branch/master/playlist.json
DEV_MODE=false
DEBUG_MODE=false
STREAMER_MODE=manual

View File

@ -16,4 +16,4 @@ updates:
interval: "daily"
target-branch: "develop"
labels:
- "dependencies"
- "dependencies"

4
.github/labeler.yml vendored
View File

@ -3,5 +3,7 @@ dependencies:
documentation:
- README.md
- SECURITY.md
- CONTRIBUTING.md
- LICENSE
- .env_example
- .env_example

View File

@ -16,4 +16,4 @@ jobs:
with:
install: true
- name: Build
run: docker build . # will run buildx
run: docker build . # will run buildx

View File

@ -14,4 +14,4 @@ jobs:
- uses: actions/labeler@v3
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
sync-labels: true

3
.gitignore vendored
View File

@ -1,6 +1,5 @@
datastore/
node_modules/
npm-debug.log
.vscode/
.env
build/
build/

6
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,6 @@
{
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"editor.renderFinalNewline": false
}

27
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,27 @@
# Contributing
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
If you haven't already, come find us in [Discord](https://waren.io/r/eximiabots-discord). We want you working on things you're excited about.
Here are some important resources:
* [Discord](https://waren.io/r/eximiabots-discord) Join our Discord guild.
## Coding
### Pull Requests
* Open a new PR from your fork's new branch into develop branch.
* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
* Try to fix all merge conflicts.
### Coding conventions
* We indent using four spaces (soft tabs)
* We ALWAYS put spaces after list items and method parameters (`[1, 2, 3]`, not `[1,2,3]`), around operators (`x += 1`, not `x+=1`), and around hash arrows.
* This is open source software. Consider the people who will read your code, and make it look nice for them. It's sort of like driving a car: Perhaps you love doing donuts when you're alone, but with passengers the goal is to make the ride as smooth as possible.
## Testing
We have currently automated testing in Github Workflows, you can suggest new Github Workflows to us by making PR.
Every release is manually tested by [cwchristerw](https://github.com/cwchristerw) or [MatteZ02](https://github.com/MatteZ02).

View File

@ -14,4 +14,4 @@ RUN npm install
RUN npm run build
CMD [ "npm", "start" ]
CMD [ "npm", "start" ]

17
SECURITY.md Normal file
View File

@ -0,0 +1,17 @@
# Security Policy
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| 0.3.x | :white_check_mark: |
| 0.2.x | :x: |
| 0.1.x | :x: |
## Reporting a Vulnerability
Use this section to tell people how to report a vulnerability.
Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.

464
package-lock.json generated
View File

@ -1,42 +1,42 @@
{
"name": "eximiabots-radiox",
"version": "0.3.7",
"version": "0.3.11",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "eximiabots-radiox",
"version": "0.3.7",
"version": "0.3.11",
"license": "MIT",
"dependencies": {
"@discordjs/builders": "^0.6.0",
"@discordjs/opus": "^0.6.0",
"@discordjs/rest": "^0.1.1-canary.0",
"@discordjs/voice": "^0.6.0",
"discord-api-types": "^0.22.0",
"discord-api-types": "^0.23.1",
"discord.js": "^13.1.0",
"dotenv": "^10.0.0",
"libsodium-wrappers": "^0.7.9",
"node-fetch": "^2.6.2",
"node-fetch": "^3.0.0",
"path": "^0.12.7"
},
"devDependencies": {
"@types/node": "^16.7.13",
"@types/node": "^16.9.1",
"@types/ws": "^7.4.7",
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"@typescript-eslint/eslint-plugin": "^4.31.1",
"@typescript-eslint/parser": "^4.31.1",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"nodemon": "^2.0.12",
"prettier": "^2.3.2",
"prettier": "^2.4.1",
"rimraf": "^3.0.2",
"ts-node": "^10.2.1",
"tsc-watch": "^4.5.0",
"typescript": "^4.4.2"
},
"engines": {
"node": ">=16.8.0",
"node": ">=16.9.1",
"npm": ">=7.0.0"
}
},
@ -180,6 +180,14 @@
"npm": ">=7.0.0"
}
},
"node_modules/@discordjs/builders/node_modules/discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
"engines": {
"node": ">=12"
}
},
"node_modules/@discordjs/collection": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
@ -220,6 +228,14 @@
"node-pre-gyp": "bin/node-pre-gyp"
}
},
"node_modules/@discordjs/node-pre-gyp/node_modules/node-fetch": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==",
"engines": {
"node": "4.x || >=6.0.0"
}
},
"node_modules/@discordjs/opus": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.6.0.tgz",
@ -251,6 +267,22 @@
"node": ">=16.0.0"
}
},
"node_modules/@discordjs/rest/node_modules/discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
"engines": {
"node": ">=12"
}
},
"node_modules/@discordjs/rest/node_modules/node-fetch": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==",
"engines": {
"node": "4.x || >=6.0.0"
}
},
"node_modules/@discordjs/voice": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.6.0.tgz",
@ -281,6 +313,14 @@
"node": ">=12.0.0"
}
},
"node_modules/@discordjs/voice/node_modules/discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
"engines": {
"node": ">=12"
}
},
"node_modules/@discordjs/voice/node_modules/node-addon-api": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
@ -407,9 +447,9 @@
}
},
"node_modules/@sindresorhus/is": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.1.tgz",
"integrity": "sha512-Qm9hBEBu18wt1PO2flE7LPb30BHMQt1eQgbV76YntdNk73XZGpn3izvGTYxbGgzXKgbCjiia0uxTd3aTNQrY/g==",
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz",
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==",
"engines": {
"node": ">=10"
},
@ -460,9 +500,9 @@
"dev": true
},
"node_modules/@types/node": {
"version": "16.7.13",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.13.tgz",
"integrity": "sha512-pLUPDn+YG3FYEt/pHI74HmnJOWzeR+tOIQzUx93pi9M7D8OE7PSLr97HboXwk5F+JS+TLtWuzCOW97AHjmOXXA=="
"version": "16.9.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.2.tgz",
"integrity": "sha512-ZHty/hKoOLZvSz6BtP1g7tc7nUeJhoCf3flLjh8ZEv1vFKBWHXcnMbJMyN/pftSljNyy0kNW/UqI3DccnBnZ8w=="
},
"node_modules/@types/ws": {
"version": "7.4.7",
@ -473,13 +513,13 @@
}
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.0.tgz",
"integrity": "sha512-iPKZTZNavAlOhfF4gymiSuUkgLne/nh5Oz2/mdiUmuZVD42m9PapnCnzjxuDsnpnbH3wT5s2D8bw6S39TC6GNw==",
"version": "4.31.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.1.tgz",
"integrity": "sha512-UDqhWmd5i0TvPLmbK5xY3UZB0zEGseF+DHPghZ37Sb83Qd3p8ujhvAtkU4OF46Ka5Pm5kWvFIx0cCTBFKo0alA==",
"dev": true,
"dependencies": {
"@typescript-eslint/experimental-utils": "4.31.0",
"@typescript-eslint/scope-manager": "4.31.0",
"@typescript-eslint/experimental-utils": "4.31.1",
"@typescript-eslint/scope-manager": "4.31.1",
"debug": "^4.3.1",
"functional-red-black-tree": "^1.0.1",
"regexpp": "^3.1.0",
@ -504,15 +544,15 @@
}
},
"node_modules/@typescript-eslint/experimental-utils": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.0.tgz",
"integrity": "sha512-Hld+EQiKLMppgKKkdUsLeVIeEOrwKc2G983NmznY/r5/ZtZCDvIOXnXtwqJIgYz/ymsy7n7RGvMyrzf1WaSQrw==",
"version": "4.31.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.1.tgz",
"integrity": "sha512-NtoPsqmcSsWty0mcL5nTZXMf7Ei0Xr2MT8jWjXMVgRK0/1qeQ2jZzLFUh4QtyJ4+/lPUyMw5cSfeeME+Zrtp9Q==",
"dev": true,
"dependencies": {
"@types/json-schema": "^7.0.7",
"@typescript-eslint/scope-manager": "4.31.0",
"@typescript-eslint/types": "4.31.0",
"@typescript-eslint/typescript-estree": "4.31.0",
"@typescript-eslint/scope-manager": "4.31.1",
"@typescript-eslint/types": "4.31.1",
"@typescript-eslint/typescript-estree": "4.31.1",
"eslint-scope": "^5.1.1",
"eslint-utils": "^3.0.0"
},
@ -528,14 +568,14 @@
}
},
"node_modules/@typescript-eslint/parser": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.0.tgz",
"integrity": "sha512-oWbzvPh5amMuTmKaf1wp0ySxPt2ZXHnFQBN2Szu1O//7LmOvgaKTCIDNLK2NvzpmVd5A2M/1j/rujBqO37hj3w==",
"version": "4.31.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.1.tgz",
"integrity": "sha512-dnVZDB6FhpIby6yVbHkwTKkn2ypjVIfAR9nh+kYsA/ZL0JlTsd22BiDjouotisY3Irmd3OW1qlk9EI5R8GrvRQ==",
"dev": true,
"dependencies": {
"@typescript-eslint/scope-manager": "4.31.0",
"@typescript-eslint/types": "4.31.0",
"@typescript-eslint/typescript-estree": "4.31.0",
"@typescript-eslint/scope-manager": "4.31.1",
"@typescript-eslint/types": "4.31.1",
"@typescript-eslint/typescript-estree": "4.31.1",
"debug": "^4.3.1"
},
"engines": {
@ -555,13 +595,13 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.0.tgz",
"integrity": "sha512-LJ+xtl34W76JMRLjbaQorhR0hfRAlp3Lscdiz9NeI/8i+q0hdBZ7BsiYieLoYWqy+AnRigaD3hUwPFugSzdocg==",
"version": "4.31.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.1.tgz",
"integrity": "sha512-N1Uhn6SqNtU2XpFSkD4oA+F0PfKdWHyr4bTX0xTj8NRx1314gBDRL1LUuZd5+L3oP+wo6hCbZpaa1in6SwMcVQ==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "4.31.0",
"@typescript-eslint/visitor-keys": "4.31.0"
"@typescript-eslint/types": "4.31.1",
"@typescript-eslint/visitor-keys": "4.31.1"
},
"engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
@ -572,9 +612,9 @@
}
},
"node_modules/@typescript-eslint/types": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.0.tgz",
"integrity": "sha512-9XR5q9mk7DCXgXLS7REIVs+BaAswfdHhx91XqlJklmqWpTALGjygWVIb/UnLh4NWhfwhR5wNe1yTyCInxVhLqQ==",
"version": "4.31.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.1.tgz",
"integrity": "sha512-kixltt51ZJGKENNW88IY5MYqTBA8FR0Md8QdGbJD2pKZ+D5IvxjTYDNtJPDxFBiXmka2aJsITdB1BtO1fsgmsQ==",
"dev": true,
"engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
@ -585,13 +625,13 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.0.tgz",
"integrity": "sha512-QHl2014t3ptg+xpmOSSPn5hm4mY8D4s97ftzyk9BZ8RxYQ3j73XcwuijnJ9cMa6DO4aLXeo8XS3z1omT9LA/Eg==",
"version": "4.31.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.1.tgz",
"integrity": "sha512-EGHkbsUvjFrvRnusk6yFGqrqMBTue5E5ROnS5puj3laGQPasVUgwhrxfcgkdHNFECHAewpvELE1Gjv0XO3mdWg==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "4.31.0",
"@typescript-eslint/visitor-keys": "4.31.0",
"@typescript-eslint/types": "4.31.1",
"@typescript-eslint/visitor-keys": "4.31.1",
"debug": "^4.3.1",
"globby": "^11.0.3",
"is-glob": "^4.0.1",
@ -612,12 +652,12 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.0.tgz",
"integrity": "sha512-HUcRp2a9I+P21+O21yu3ezv3GEPGjyGiXoEUQwZXjR8UxRApGeLyWH4ZIIUSalE28aG4YsV6GjtaAVB3QKOu0w==",
"version": "4.31.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.1.tgz",
"integrity": "sha512-PCncP8hEqKw6SOJY+3St4LVtoZpPPn+Zlpm7KW5xnviMhdqcsBty4Lsg4J/VECpJjw1CkROaZhH4B8M1OfnXTQ==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "4.31.0",
"@typescript-eslint/types": "4.31.1",
"eslint-visitor-keys": "^2.0.0"
},
"engines": {
@ -755,9 +795,9 @@
}
},
"node_modules/ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
"engines": {
"node": ">=8"
@ -1190,6 +1230,14 @@
"node": ">=8"
}
},
"node_modules/data-uri-to-buffer": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz",
"integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==",
"engines": {
"node": ">= 6"
}
},
"node_modules/debug": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
@ -1285,9 +1333,9 @@
}
},
"node_modules/discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
"version": "0.23.1",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ==",
"engines": {
"node": ">=12"
}
@ -1327,6 +1375,22 @@
"npm": ">=7.0.0"
}
},
"node_modules/discord.js/node_modules/discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
"engines": {
"node": ">=12"
}
},
"node_modules/discord.js/node_modules/node-fetch": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==",
"engines": {
"node": "4.x || >=6.0.0"
}
},
"node_modules/doctrine": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
@ -1735,14 +1799,35 @@
"dev": true
},
"node_modules/fastq": {
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.12.0.tgz",
"integrity": "sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg==",
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz",
"integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==",
"dev": true,
"dependencies": {
"reusify": "^1.0.4"
}
},
"node_modules/fetch-blob": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.2.tgz",
"integrity": "sha512-hunJbvy/6OLjCD0uuhLdp0mMPzP/yd2ssd1t2FCJsaA7wkWhpbp9xfuNVpv7Ll4jFhzp6T4LAupSiV9uOeg0VQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
},
{
"type": "paypal",
"url": "https://paypal.me/jimmywarting"
}
],
"dependencies": {
"web-streams-polyfill": "^3.0.3"
},
"engines": {
"node": "^12.20 || >= 14.13"
}
},
"node_modules/file-entry-cache": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
@ -2479,9 +2564,9 @@
"dev": true
},
"node_modules/minipass": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz",
"integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==",
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz",
"integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==",
"dependencies": {
"yallist": "^4.0.0"
},
@ -2535,11 +2620,19 @@
"dev": true
},
"node_modules/node-fetch": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0.tgz",
"integrity": "sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==",
"dependencies": {
"data-uri-to-buffer": "^3.0.1",
"fetch-blob": "^3.1.2"
},
"engines": {
"node": "4.x || >=6.0.0"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/node-fetch"
}
},
"node_modules/nodemon": {
@ -2836,9 +2929,9 @@
}
},
"node_modules/prettier": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz",
"integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==",
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz",
"integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
@ -3188,9 +3281,9 @@
}
},
"node_modules/signal-exit": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA=="
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.4.tgz",
"integrity": "sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q=="
},
"node_modules/slash": {
"version": "3.0.0",
@ -3356,9 +3449,9 @@
}
},
"node_modules/table/node_modules/ajv": {
"version": "8.6.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.2.tgz",
"integrity": "sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w==",
"version": "8.6.3",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz",
"integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==",
"dev": true,
"dependencies": {
"fast-deep-equal": "^3.1.1",
@ -3642,9 +3735,9 @@
}
},
"node_modules/typescript": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz",
"integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz",
"integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
@ -3783,6 +3876,14 @@
"node": ">=0.10.0"
}
},
"node_modules/web-streams-polyfill": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz",
"integrity": "sha512-Czi3fG883e96T4DLEPRvufrF2ydhOOW1+1a6c3gNjH2aIh50DNFBdfwh2AKoOf1rXvpvavAoA11Qdq9+BKjE0Q==",
"engines": {
"node": ">= 8"
}
},
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
@ -3874,9 +3975,9 @@
}
},
"node_modules/ws": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.4.tgz",
"integrity": "sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg==",
"version": "7.5.5",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz",
"integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==",
"engines": {
"node": ">=8.3.0"
},
@ -4027,6 +4128,13 @@
"ow": "^0.27.0",
"ts-mixer": "^6.0.0",
"tslib": "^2.3.1"
},
"dependencies": {
"discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
}
}
},
"@discordjs/collection": {
@ -4058,6 +4166,13 @@
"rimraf": "^3.0.2",
"semver": "^7.3.5",
"tar": "^6.1.8"
},
"dependencies": {
"node-fetch": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA=="
}
}
},
"@discordjs/opus": {
@ -4082,6 +4197,18 @@
"form-data": "^4.0.0",
"node-fetch": "^2.6.1",
"tslib": "^2.3.0"
},
"dependencies": {
"discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
},
"node-fetch": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA=="
}
}
},
"@discordjs/voice": {
@ -4107,6 +4234,11 @@
"node-addon-api": "^3.2.1"
}
},
"discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
},
"node-addon-api": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
@ -4193,9 +4325,9 @@
"integrity": "sha512-gPSOQKmEWeuif2ftmW7gyToCnOoqpDqTSNrxX7HsoMwGNLtrT9p5DHcQolkBg5CEK3ooDFy5DNEFKUshQU7vyQ=="
},
"@sindresorhus/is": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.1.tgz",
"integrity": "sha512-Qm9hBEBu18wt1PO2flE7LPb30BHMQt1eQgbV76YntdNk73XZGpn3izvGTYxbGgzXKgbCjiia0uxTd3aTNQrY/g=="
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz",
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw=="
},
"@szmarczak/http-timer": {
"version": "1.1.2",
@ -4237,9 +4369,9 @@
"dev": true
},
"@types/node": {
"version": "16.7.13",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.13.tgz",
"integrity": "sha512-pLUPDn+YG3FYEt/pHI74HmnJOWzeR+tOIQzUx93pi9M7D8OE7PSLr97HboXwk5F+JS+TLtWuzCOW97AHjmOXXA=="
"version": "16.9.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.2.tgz",
"integrity": "sha512-ZHty/hKoOLZvSz6BtP1g7tc7nUeJhoCf3flLjh8ZEv1vFKBWHXcnMbJMyN/pftSljNyy0kNW/UqI3DccnBnZ8w=="
},
"@types/ws": {
"version": "7.4.7",
@ -4250,13 +4382,13 @@
}
},
"@typescript-eslint/eslint-plugin": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.0.tgz",
"integrity": "sha512-iPKZTZNavAlOhfF4gymiSuUkgLne/nh5Oz2/mdiUmuZVD42m9PapnCnzjxuDsnpnbH3wT5s2D8bw6S39TC6GNw==",
"version": "4.31.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.1.tgz",
"integrity": "sha512-UDqhWmd5i0TvPLmbK5xY3UZB0zEGseF+DHPghZ37Sb83Qd3p8ujhvAtkU4OF46Ka5Pm5kWvFIx0cCTBFKo0alA==",
"dev": true,
"requires": {
"@typescript-eslint/experimental-utils": "4.31.0",
"@typescript-eslint/scope-manager": "4.31.0",
"@typescript-eslint/experimental-utils": "4.31.1",
"@typescript-eslint/scope-manager": "4.31.1",
"debug": "^4.3.1",
"functional-red-black-tree": "^1.0.1",
"regexpp": "^3.1.0",
@ -4265,55 +4397,55 @@
}
},
"@typescript-eslint/experimental-utils": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.0.tgz",
"integrity": "sha512-Hld+EQiKLMppgKKkdUsLeVIeEOrwKc2G983NmznY/r5/ZtZCDvIOXnXtwqJIgYz/ymsy7n7RGvMyrzf1WaSQrw==",
"version": "4.31.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.1.tgz",
"integrity": "sha512-NtoPsqmcSsWty0mcL5nTZXMf7Ei0Xr2MT8jWjXMVgRK0/1qeQ2jZzLFUh4QtyJ4+/lPUyMw5cSfeeME+Zrtp9Q==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.7",
"@typescript-eslint/scope-manager": "4.31.0",
"@typescript-eslint/types": "4.31.0",
"@typescript-eslint/typescript-estree": "4.31.0",
"@typescript-eslint/scope-manager": "4.31.1",
"@typescript-eslint/types": "4.31.1",
"@typescript-eslint/typescript-estree": "4.31.1",
"eslint-scope": "^5.1.1",
"eslint-utils": "^3.0.0"
}
},
"@typescript-eslint/parser": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.0.tgz",
"integrity": "sha512-oWbzvPh5amMuTmKaf1wp0ySxPt2ZXHnFQBN2Szu1O//7LmOvgaKTCIDNLK2NvzpmVd5A2M/1j/rujBqO37hj3w==",
"version": "4.31.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.1.tgz",
"integrity": "sha512-dnVZDB6FhpIby6yVbHkwTKkn2ypjVIfAR9nh+kYsA/ZL0JlTsd22BiDjouotisY3Irmd3OW1qlk9EI5R8GrvRQ==",
"dev": true,
"requires": {
"@typescript-eslint/scope-manager": "4.31.0",
"@typescript-eslint/types": "4.31.0",
"@typescript-eslint/typescript-estree": "4.31.0",
"@typescript-eslint/scope-manager": "4.31.1",
"@typescript-eslint/types": "4.31.1",
"@typescript-eslint/typescript-estree": "4.31.1",
"debug": "^4.3.1"
}
},
"@typescript-eslint/scope-manager": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.0.tgz",
"integrity": "sha512-LJ+xtl34W76JMRLjbaQorhR0hfRAlp3Lscdiz9NeI/8i+q0hdBZ7BsiYieLoYWqy+AnRigaD3hUwPFugSzdocg==",
"version": "4.31.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.1.tgz",
"integrity": "sha512-N1Uhn6SqNtU2XpFSkD4oA+F0PfKdWHyr4bTX0xTj8NRx1314gBDRL1LUuZd5+L3oP+wo6hCbZpaa1in6SwMcVQ==",
"dev": true,
"requires": {
"@typescript-eslint/types": "4.31.0",
"@typescript-eslint/visitor-keys": "4.31.0"
"@typescript-eslint/types": "4.31.1",
"@typescript-eslint/visitor-keys": "4.31.1"
}
},
"@typescript-eslint/types": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.0.tgz",
"integrity": "sha512-9XR5q9mk7DCXgXLS7REIVs+BaAswfdHhx91XqlJklmqWpTALGjygWVIb/UnLh4NWhfwhR5wNe1yTyCInxVhLqQ==",
"version": "4.31.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.1.tgz",
"integrity": "sha512-kixltt51ZJGKENNW88IY5MYqTBA8FR0Md8QdGbJD2pKZ+D5IvxjTYDNtJPDxFBiXmka2aJsITdB1BtO1fsgmsQ==",
"dev": true
},
"@typescript-eslint/typescript-estree": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.0.tgz",
"integrity": "sha512-QHl2014t3ptg+xpmOSSPn5hm4mY8D4s97ftzyk9BZ8RxYQ3j73XcwuijnJ9cMa6DO4aLXeo8XS3z1omT9LA/Eg==",
"version": "4.31.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.1.tgz",
"integrity": "sha512-EGHkbsUvjFrvRnusk6yFGqrqMBTue5E5ROnS5puj3laGQPasVUgwhrxfcgkdHNFECHAewpvELE1Gjv0XO3mdWg==",
"dev": true,
"requires": {
"@typescript-eslint/types": "4.31.0",
"@typescript-eslint/visitor-keys": "4.31.0",
"@typescript-eslint/types": "4.31.1",
"@typescript-eslint/visitor-keys": "4.31.1",
"debug": "^4.3.1",
"globby": "^11.0.3",
"is-glob": "^4.0.1",
@ -4322,12 +4454,12 @@
}
},
"@typescript-eslint/visitor-keys": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.0.tgz",
"integrity": "sha512-HUcRp2a9I+P21+O21yu3ezv3GEPGjyGiXoEUQwZXjR8UxRApGeLyWH4ZIIUSalE28aG4YsV6GjtaAVB3QKOu0w==",
"version": "4.31.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.1.tgz",
"integrity": "sha512-PCncP8hEqKw6SOJY+3St4LVtoZpPPn+Zlpm7KW5xnviMhdqcsBty4Lsg4J/VECpJjw1CkROaZhH4B8M1OfnXTQ==",
"dev": true,
"requires": {
"@typescript-eslint/types": "4.31.0",
"@typescript-eslint/types": "4.31.1",
"eslint-visitor-keys": "^2.0.0"
}
},
@ -4427,9 +4559,9 @@
"dev": true
},
"ansi-regex": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true
},
"ansi-styles": {
@ -4764,6 +4896,11 @@
"integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==",
"dev": true
},
"data-uri-to-buffer": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz",
"integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og=="
},
"debug": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
@ -4830,9 +4967,9 @@
}
},
"discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
"version": "0.23.1",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ=="
},
"discord.js": {
"version": "13.1.0",
@ -4860,6 +4997,16 @@
"ts-mixer": "^6.0.0",
"tslib": "^2.3.0"
}
},
"discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
},
"node-fetch": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA=="
}
}
},
@ -5170,14 +5317,22 @@
"dev": true
},
"fastq": {
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.12.0.tgz",
"integrity": "sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg==",
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz",
"integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==",
"dev": true,
"requires": {
"reusify": "^1.0.4"
}
},
"fetch-blob": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.2.tgz",
"integrity": "sha512-hunJbvy/6OLjCD0uuhLdp0mMPzP/yd2ssd1t2FCJsaA7wkWhpbp9xfuNVpv7Ll4jFhzp6T4LAupSiV9uOeg0VQ==",
"requires": {
"web-streams-polyfill": "^3.0.3"
}
},
"file-entry-cache": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
@ -5753,9 +5908,9 @@
"dev": true
},
"minipass": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz",
"integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==",
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz",
"integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==",
"requires": {
"yallist": "^4.0.0"
}
@ -5797,9 +5952,13 @@
"dev": true
},
"node-fetch": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA=="
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0.tgz",
"integrity": "sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==",
"requires": {
"data-uri-to-buffer": "^3.0.1",
"fetch-blob": "^3.1.2"
}
},
"nodemon": {
"version": "2.0.12",
@ -6018,9 +6177,9 @@
"dev": true
},
"prettier": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz",
"integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==",
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz",
"integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==",
"dev": true
},
"prettier-linter-helpers": {
@ -6247,9 +6406,9 @@
"dev": true
},
"signal-exit": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
"integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA=="
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.4.tgz",
"integrity": "sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q=="
},
"slash": {
"version": "3.0.0",
@ -6377,9 +6536,9 @@
},
"dependencies": {
"ajv": {
"version": "8.6.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.2.tgz",
"integrity": "sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w==",
"version": "8.6.3",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz",
"integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==",
"dev": true,
"requires": {
"fast-deep-equal": "^3.1.1",
@ -6583,9 +6742,9 @@
}
},
"typescript": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz",
"integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==",
"version": "4.4.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz",
"integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==",
"dev": true
},
"undefsafe": {
@ -6705,6 +6864,11 @@
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY="
},
"web-streams-polyfill": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz",
"integrity": "sha512-Czi3fG883e96T4DLEPRvufrF2ydhOOW1+1a6c3gNjH2aIh50DNFBdfwh2AKoOf1rXvpvavAoA11Qdq9+BKjE0Q=="
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
@ -6780,9 +6944,9 @@
}
},
"ws": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.4.tgz",
"integrity": "sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg==",
"version": "7.5.5",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz",
"integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==",
"requires": {}
},
"xdg-basedir": {

View File

@ -1,12 +1,12 @@
{
"name": "eximiabots-radiox",
"version": "0.3.7",
"version": "0.3.11",
"description": "Internet Radio to your Discord guild",
"main": "index.js",
"scripts": {
"build": "rimraf ./build && tsc",
"start": "node build/index.js",
"start:dev": "npm run build && node build/index.js"
"start": "node --no-warnings build/index.js",
"start:dev": "npm run build && node --no-warnings build/index.js"
},
"repository": {
"type": "git",
@ -22,30 +22,30 @@
"@discordjs/opus": "^0.6.0",
"@discordjs/rest": "^0.1.1-canary.0",
"@discordjs/voice": "^0.6.0",
"discord-api-types": "^0.22.0",
"discord-api-types": "^0.23.1",
"discord.js": "^13.1.0",
"dotenv": "^10.0.0",
"libsodium-wrappers": "^0.7.9",
"node-fetch": "^2.6.2",
"node-fetch": "^3.0.0",
"path": "^0.12.7"
},
"devDependencies": {
"@types/node": "^16.7.13",
"@types/node": "^16.9.1",
"@types/ws": "^7.4.7",
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"@typescript-eslint/eslint-plugin": "^4.31.1",
"@typescript-eslint/parser": "^4.31.1",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"nodemon": "^2.0.12",
"prettier": "^2.3.2",
"prettier": "^2.4.1",
"rimraf": "^3.0.2",
"ts-node": "^10.2.1",
"tsc-watch": "^4.5.0",
"typescript": "^4.4.2"
},
"engines": {
"node": ">=16.8.0",
"node": ">=16.9.1",
"npm": ">=7.0.0"
}
}
}

View File

@ -1,6 +1,10 @@
import Discord, { Client, Collection } from "discord.js";
import Datastore from "./client/classes/Datastore.js";
import Radio from "./client/classes/Radio.js";
import Stations from "./client/classes/Stations.js";
import Streamer from "./client/classes/Streamer.js";
import Statistics from "./client/classes/Statistics.js";
import fs from "fs";
import Datastore from "./client/datastore.js";
import { command, radio } from "./client/utils/typings.js";
import config from "./config.js";
import messages from "./client/messages.js";
@ -17,33 +21,34 @@ GatewayIntents.add(
class RadioClient extends Client {
readonly commands: Collection<string, command>;
readonly radio: Map<string, radio>;
public funcs: any;
readonly config = config;
readonly messages = messages;
public datastore: Datastore | null;
public stations: Stations | null;
public streamer: Streamer | null;
public statistics: Statistics | null;
public radio: Radio | null;
constructor() {
super({
intents: GatewayIntents
});
this.commands = new Collection();
this.radio = new Map();
this.datastore = null;
this.stations = null;
this.streamer = null;
this.statistics = null;
this.radio = null;
this.funcs = {};
this.funcs.check = require("./client/funcs/check.js");
this.funcs.checkFetchStatus = require("./client/funcs/checkFetchStatus.js");
this.funcs.isDev = require("./client/funcs/isDev.js");
this.funcs.logger = require("./client/funcs/logger.js");
this.funcs.msToTime = require("./client/funcs/msToTime.js");
this.funcs.statisticsUpdate = require("./client/funcs/statisticsUpdate.js");
this.funcs.saveState = require("./client/funcs/saveState.js");
this.funcs.loadState = require("./client/funcs/loadState.js");
this.funcs.searchStation = require("./client/funcs/searchStation.js");
this.funcs.play = require("./client/funcs/play.js");
this.funcs.listStations = require("./client/funcs/listStations.js");
this.funcs.restoreRadios = require("./client/funcs/restoreRadios.js");
this.funcs.saveRadios = require("./client/funcs/saveRadios.js");
console.log('RadioX ' + this.config.version);
console.log('Internet Radio to your Discord guild');
@ -52,11 +57,8 @@ class RadioClient extends Client {
this.funcs.logger("Bot", "Starting");
const commandFiles = fs.readdirSync(path.join("./src/client/commands")).filter(f => f.endsWith(".js"));
for (const file of commandFiles) {
const command = require(`./client/commands/${file}`);
this.commands.set(command.name, command);
}
this.funcs.logger("Maintenance Mode", "Enabled");
this.config.maintenanceMode = true;
this.on("ready", () => {
require(`${events}ready`).execute(this);
@ -73,11 +75,17 @@ class RadioClient extends Client {
this.on("interactionCreate", interaction => {
require(`${events}interactionCreate`).execute(this, interaction);
});
this.on("voiceStateUpdate", (oldState, newState) => {
require(`${events}voiceStateUpdate`).execute(this, oldState, newState);
});
this.on("error", error => {
this.funcs.logger("Discord Client / Error");
console.error(error);
console.log('');
});
process.on('SIGINT', () => {
require(`${events}SIGINT`).execute(this);
});
@ -89,13 +97,21 @@ class RadioClient extends Client {
process.on('uncaughtException', (error) => {
require(`${events}uncaughtException`).execute(this, error);
});
this.on("error", error => {
console.error(error);
process.on('exit', () => {
this.funcs.logger("Bot", "Stopping");
});
this.login(this.config.token).catch(err => console.log("Failed to login: " + err));
process.on('warning', (warning) => {
require(`${events}warning`).execute(this, warning);
});
this.login(this.config.token).catch((err) => {
this.funcs.logger("Discord Client / Error");
console.log(err);
console.log('');
});
}
}
export default RadioClient
export default RadioClient

View File

@ -0,0 +1,106 @@
const fs = require('fs');
const path = require('path');
module.exports = class {
constructor() {
this.map = new Map();
this.loadData();
}
loadData() {
const dir = path.join(path.dirname(__dirname), '../../datastore');
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
//console.log("");
const dataFiles = fs.readdirSync(path.join(path.dirname(__dirname), '../../datastore')).filter(f => f.endsWith('.json'));
for (const file of dataFiles) {
try {
const json = require(`../../../datastore/${file}`);
this.map.set(json.guild.id, json);
//console.log('[LOADED] ' + file + " (" + json.guild.id + ")");
//console.log(JSON.stringify(json, null, 4));
} catch (error) {
//console.log('[ERROR] Loading ' + file + ' failed');
}
}
//console.log("");
}
checkEntry(id){
this.loadEntry(id);
if(!this.map.has(id)){
this.createEntry(id);
//this.showEntry(this.getEntry(id));
} else {
//this.showEntry(this.getEntry(id));
}
}
createEntry(id){
let newData = {};
newData.guild = {};
newData.guild.id = id;
newData.statistics = {};
newData.state = {};
this.map.set(id, newData);
this.saveEntry(id, newData);
}
loadEntry(id){
try {
const json = require(`../../../datastore/` + id + '.json');
this.map.set(id, json);
} catch (error) {
}
}
getEntry(id){
return this.map.get(id);
}
updateEntry(guild, newData) {
newData.guild.name = guild.name;
let date = new Date();
newData.updated = date.toISOString().substring(0, 10)
this.map.set(guild.id, newData);
this.saveEntry(guild.id, newData);
//this.showEntry(this.getEntry(guild.id));
}
showEntry(data){
console.log(data);
}
createTestFile () {
let newData = {
"guild": {
"id": "test",
"name": "Test"
},
"statistics": {
"test": {
"time": 0,
"used": 0
}
},
"state": {
}
}
this.updateEntry(newData.guild, newData);
}
saveEntry(file, data) {
data = JSON.stringify(data, null, 4);
fs.writeFile(path.join(path.dirname(__dirname), '../../datastore') + "/" + file + ".json", data, 'utf8', function(err) {
if (err) {
//console.log(err);
}
});
}
};

View File

@ -0,0 +1,76 @@
const {
getVoiceConnection,
joinVoiceChannel
} = require("@discordjs/voice");
module.exports = class Radio extends Map {
constructor() {
super();
}
save(client) {
let currentRadios = this.keys();
let radio = currentRadios.next();
while (!radio.done) {
let currentRadio = this.get(radio.value);
if (currentRadio) {
currentRadio.guild = client.datastore.getEntry(radio.value).guild;
client.statistics.update(client, currentRadio.guild, currentRadio);
client.funcs.saveState(client, currentRadio.guild, currentRadio);
currentRadio.connection?.destroy();
currentRadio.message?.delete();
this.delete(radio.value);
}
radio = currentRadios.next();
}
}
restore(client, guilds) {
if(!client.stations) return;
guilds.forEach(async guild => {
let state = client.funcs.loadState(client, guild);
if(!state) return;
if(!state.station || !state.channels.voice || !state.channels.text) return;
let voiceChannel = client.channels.cache.get(state.channels.voice);
if(!voiceChannel) return;
if(voiceChannel.members.filter(member => !member.user.bot).size === 0) return;
const sstation = await client.stations.search(state.station.name);
let station = sstation;
const construct = {
textChannel: client.channels.cache.get(state.channels.text),
voiceChannel: client.channels.cache.get(state.channels.voice),
connection: null,
message: null,
station: station
};
this.set(guild.id, construct);
try {
const connection =
getVoiceConnection(guild.id) ??
joinVoiceChannel({
channelId: voiceChannel.id,
guildId: voiceChannel.guild.id,
adapterCreator: voiceChannel.guild.voiceAdapterCreator
});
construct.connection = connection;
let date = new Date();
construct.startTime = date.getTime();
client.datastore.checkEntry(guild.id);
client.funcs.play(client, null, guild, station);
} catch (error) {
console.log(error);
}
});
}
};

View File

@ -0,0 +1,111 @@
const _importDynamic = new Function('modulePath', 'return import(modulePath)');
const fetch = (...args) => _importDynamic('node-fetch').then(({default: fetch}) => fetch(...args));
module.exports = class Stations extends Array {
constructor() {
super();
this.logger = require("../funcs/logger.js");
}
async fetch(options){
try {
this.logger('Stations', 'Started fetching list ' + options.url);
let list = await fetch(options.url)
.then(this.checkFetchStatus)
.then(response => response.json());
if(list){
this.length = 0;
list.forEach(station => {
this.push(station);
});
if(options.show){
this.logger('Stations');
list.forEach(station => {
console.log("- " + station.name);
});
console.log("\n");
}
}
this.logger('Stations', 'Successfully fetched list');
} catch (error) {
this.logger('Stations', 'Fetching list failed');
console.error(error + "\n");
this.fetch(options);
}
}
checkFetchStatus(response) {
if (response.ok) { // res.status >= 200 && res.status < 300
return response;
} else {
throw new Error(response.status + " " + response.statusText);
}
}
search(key) {
if (this === null) return false;
let foundStations = [];
if (!key) return false;
if (key == "radio") return false;
this
.filter(
x => x.name.toUpperCase().includes(key.toUpperCase()) || x === key
)
.forEach(x =>
foundStations.push({ station: x, name: x.name, probability: 100 })
);
if (key.startsWith("radio ")) key = key.slice(6);
const probabilityIncrement = 100 / key.split(" ").length / 2;
for (let i = 0; i < key.split(" ").length; i++) {
this
.filter(
x => x.name.toUpperCase().includes(key.split(" ")[i].toUpperCase()) || x === key
)
.forEach(x =>
foundStations.push({ station: x, name: x.name, probability: probabilityIncrement })
);
}
if (foundStations.length === 0) return false;
for (let i = 0; i < foundStations.length; i++) {
for (let j = 0; j < foundStations.length; j++) {
if (foundStations[i] === foundStations[j] && i !== j) foundStations.splice(i, 1);
}
}
for (let i = 0; i < foundStations.length; i++) {
if (foundStations[i].name.length > key.length) {
foundStations[i].probability -=
(foundStations[i].name.split(" ").length - key.split(" ").length) *
(probabilityIncrement * 0.5);
} else if (foundStations[i].name.length === key.length) {
foundStations[i].probability += probabilityIncrement * 0.9;
}
for (let j = 0; j < key.split(" ").length; j++) {
if (!foundStations[i].name.toUpperCase().includes(key.toUpperCase().split(" ")[j])) {
foundStations[i].probability -= probabilityIncrement * 0.5;
}
}
}
let highestProbabilityStation;
for (let i = 0; i < foundStations.length; i++) {
if (
!highestProbabilityStation ||
highestProbabilityStation.probability < foundStations[i].probability
)
highestProbabilityStation = foundStations[i];
if (
highestProbabilityStation &&
highestProbabilityStation.probability === foundStations[i].probability
) {
highestProbabilityStation = foundStations[i].station;
}
}
return highestProbabilityStation;
}
};

View File

@ -0,0 +1,70 @@
module.exports = class {
constructor() {
this.map = new Map();
}
update(client, guild, radio) {
client.datastore.checkEntry(guild.id);
radio.datastore = client.datastore.getEntry(guild.id);
if(!radio.datastore.statistics[radio.station.name]){
radio.datastore.statistics[radio.station.name] = {};
radio.datastore.statistics[radio.station.name].time = 0;
radio.datastore.statistics[radio.station.name].used = 0;
client.datastore.updateEntry(guild, radio.datastore);
}
let date = new Date();
radio.currentTime = date.getTime();
radio.playTime = parseInt(radio.currentTime)-parseInt(radio.startTime);
radio.datastore.statistics[radio.station.name].time = parseInt(radio.datastore.statistics[radio.station.name].time)+parseInt(radio.playTime);
radio.datastore.statistics[radio.station.name].used = parseInt(radio.datastore.statistics[radio.station.name].used)+1;
client.datastore.updateEntry(guild, radio.datastore);
this.calculateGlobal(client);
}
calculateGlobal(client){
if(!client.stations) return;
if(!client.datastore.map) return;
let guilds = client.datastore.map.keys();
let stations = client.stations;
let statistics = {};
if(!client.stations) return;
let calculation = guilds.next();
while (!calculation.done) {
let currentGuild = client.datastore.getEntry(calculation.value);
if(calculation.value != 'global'){
if(stations){
Object.keys(stations).forEach(function(station) {
if(currentGuild.statistics[stations[station].name] && currentGuild.statistics[stations[station].name].time && parseInt(currentGuild.statistics[stations[station].name].time) != 0 && currentGuild.statistics[stations[station].name].used && parseInt(currentGuild.statistics[stations[station].name].used) != 0){
if(!statistics[stations[station].name]){
statistics[stations[station].name] = {};
statistics[stations[station].name].time = 0;
statistics[stations[station].name].used = 0;
}
statistics[stations[station].name].time = parseInt(statistics[stations[station].name].time)+parseInt(currentGuild.statistics[stations[station].name].time);
statistics[stations[station].name].used = parseInt(statistics[stations[station].name].used)+parseInt(currentGuild.statistics[stations[station].name].used);
}
});
}
}
calculation = guilds.next();
}
let newData = {};
newData.guild = {};
newData.guild.id = "global";
newData.guild.name = "global";
newData.statistics = statistics;
client.datastore.updateEntry(newData.guild, newData);
}
};

View File

@ -0,0 +1,126 @@
const {
createAudioPlayer,
createAudioResource,
AudioPlayerStatus,
NoSubscriberBehavior
} = require("@discordjs/voice");
module.exports = class {
constructor() {
this.map = new Map();
this.mode = null;
this.logger = require("../funcs/logger.js");
}
init(client){
if(!client.config.streamerMode) return;
switch(client.config.streamerMode){
case "manual":
this.mode = "manual";
break;
case "auto":
this.mode = "auto";
break;
default:
this.mode = "manual";
}
if(this.mode == "auto"){
if(!client.stations) return;
client.stations.forEach(station => {
this.play(station);
});
}
}
refresh(client){
this.init(client);
let streamers = this.map.keys();
streamers.forEach(streamer => {
if(client.stations.findIndex(station => station.name == streamer) == -1){
this.stop(streamer);
}
});
}
play(station) {
let audioPlayer = this.map.get(station.name);
if(!audioPlayer) {
audioPlayer = createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Play,
maxMissedFrames: Math.round(5000 / 20),
},
});
this.map.set(station.name, audioPlayer);
}
const url = station.stream[station.stream.default];
const resource = createAudioResource(url);
audioPlayer.play(resource);
resource.playStream
.on("readable", () => {
this.logger('Streamer', station.name + " / " + "Readable");
this.map.set(station.name, audioPlayer);
})
.on("finish", () => {
this.logger('Streamer', station.name + " / " + "Finished");
this.play(station);
})
.on("error", error => {
this.logger('Streamer', station.name + " / " + "Error");
this.play(station);
});
audioPlayer
.on('playing', () => {
this.logger('Streamer', station.name + " / " + "Playing");
})
.on('idle', () => {
this.logger('Streamer', station.name + " / " + "Idle");
})
.on('paused', () => {
this.logger('Streamer', station.name + " / " + "Paused");
this.play(station);
})
.on('buffering', () => {
this.logger('Streamer', station.name + " / " + "Buffering");
})
.on('autopaused', () => {
this.logger('Streamer', station.name + " / " + "AutoPaused");
this.play(station);
})
.on('error', error => {
this.logger('Streamer', station.name + " / " + "Error" + "\n" + error);
this.play(station);
});
return audioPlayer;
}
stop(station){
let audioPlayer = this.map.get(station.name);
if(audioPlayer){
this.logger('Streamer', station.name + " / " + "Stop");
audioPlayer.stop();
}
this.map.delete(station.name);
}
listen(station) {
let audioPlayer = this.map.get(station.name);
if(!audioPlayer){
audioPlayer = this.play(station);
}
return audioPlayer;
}
leave(client) {
if(!client.stations) return;
client.stations.forEach(station => {
this.stop(station);
});
}
};

View File

@ -1,21 +1,23 @@
const { SlashCommandBuilder } = require('@discordjs/builders');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { token, version } = require('../config.js');
const fs = require('fs');
const path = require ('path');
module.exports = {
async execute(client) {
const commands = [];
const commandFiles = fs.readdirSync(path.join("./src/client/commands")).filter(f => f.endsWith(".js"));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
command.data = new SlashCommandBuilder()
.setName(command.name)
.setDescription(command.description);
command.data = command.data.toJSON();
if(command.options) {
command.options.forEach(function(option) {
@ -28,13 +30,13 @@ module.exports = {
commands.push(command.data);
}
const rest = new REST({ version: '9' }).setToken(token);
const rest = new REST({ version: '9' }).setToken(client.config.token);
(async () => {
try {
client.funcs.logger('Slash Commands', 'Started refreshing application (/) commands.');
if(version.includes("-dev")){
if(client.config.devMode){
await rest.put(
Routes.applicationCommands(client.user.id),
{ body: [] },
@ -67,4 +69,4 @@ module.exports = {
}
})();
}
}
}

View File

@ -23,4 +23,4 @@ module.exports = {
ephemeral: true
});
}
};
};

View File

@ -26,7 +26,7 @@ module.exports = {
.setDescription(message.helpDescription)
.setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png')
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
interaction.reply({
embeds: [embed],
ephemeral: true

View File

@ -19,4 +19,4 @@ module.exports = {
ephemeral: true
});
}
};
};

View File

@ -6,6 +6,7 @@ module.exports = {
category: 'radio',
execute(interaction, client) {
let message = {};
if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return interaction.reply({
@ -13,10 +14,10 @@ module.exports = {
ephemeral: true
});
}
const radio = client.radio.get(interaction.guild.id);
if(radio){
if(radio && !client.config.maintenanceMode){
client.funcs.listStations(client, interaction);
} else {
let stations = `${client.stations.map(s => `**#** ${s.name}`).join('\n')}`
@ -39,4 +40,4 @@ module.exports = {
});
}
}
};
};

View File

@ -1,13 +1,12 @@
import Discord from "discord.js";
import fetch from "node-fetch";
import Streamer from "../classes/Streamer.js";
const _importDynamic = new Function('modulePath', 'return import(modulePath)');
const fetch = (...args) => _importDynamic('node-fetch').then(({default: fetch}) => fetch(...args));
module.exports = {
name: 'maintenance',
description: 'Bot Maintenance',
category: 'info',
options: [
{ type: "NUMBER", name: "action", description: "Select action", required: false}
],
async execute(interaction, client) {
let message = {};
@ -58,9 +57,21 @@ module.exports = {
label: "Disable Maintenance Mode",
description: "",
value: "9"
},
{
emoji: "💤",
label: "Streamer Mode Manual",
description: "",
value: "10"
},
{
emoji: "📡",
label: "Streamer Mode Auto",
description: "",
value: "11"
}
);
const menu = new Discord.MessageActionRow()
.addComponents(
new Discord.MessageSelectMenu()
@ -84,94 +95,112 @@ module.exports = {
.setColor(client.config.embedColor)
.setDescription(options.find(option => option.value == action).label)
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
interaction.reply({
embeds: [embed],
ephemeral: true
});
let guilds = await client.guilds.fetch();
switch(action){
case "0":
client.config.maintenanceMode = true;
process.emit('SIGINT');
break;
case "4":
client.config.maintenanceMode = true;
client.user.setStatus('idle');
client.funcs.saveRadios(client);
client.radio.save(client);
client.user.setStatus('online');
client.config.maintenanceMode = false;
break;
case "5":
client.config.maintenanceMode = true;
client.user.setStatus('idle');
let guilds = await client.guilds.fetch();
client.funcs.restoreRadios(client, guilds);
client.radio.restore(client, guilds);
client.user.setStatus('online');
client.config.maintenanceMode = false;
break;
case "6":
client.config.maintenanceMode = true;
client.user.setStatus('idle');
require(`../commands.js`).execute(client);
client.user.setStatus('online');
client.config.maintenanceMode = false;
break;
case "7":
try {
client.funcs.logger('Stations', 'Started fetching list ' + client.config.stationslistUrl);
client.stations = await fetch(client.config.stationslistUrl)
.then(client.funcs.checkFetchStatus)
.then(response => response.json());
client.funcs.logger('Stations', 'Successfully fetched list');
client.stations.fetch({
url: client.config.stationslistUrl
});
client.streamer.refresh(client);
} catch (error) {
client.funcs.logger('Stations', 'Fetching list failed');
}
break;
case "8":
client.user.setStatus('dnd');
client.funcs.logger("Maintenance Mode", "Enabled");
client.config.maintenanceMode = true;
break;
case "9":
client.user.setStatus('online');
client.funcs.logger("Maintenance Mode", "Disabled");
client.config.maintenanceMode = false;
break;
case "10":
client.config.streamerMode = "manual";
client.config.maintenanceMode = true;
client.user.setStatus('idle');
client.radio.save(client);
setInterval(() => {
if(client.radio.size == 0 && client.config.streamerMode == "manual" && client.config.maintenanceMode){
client.streamer.leave(client);
client.streamer = new Streamer();
client.streamer.init(client);
client.radio.restore(client, guilds);
client.user.setStatus('online');
client.config.maintenanceMode = false;
}
if(!client.config.maintenanceMode){
clearInterval();
}
}, 500);
break;
case "11":
client.config.streamerMode = "auto";
client.config.maintenanceMode = true;
client.user.setStatus('idle');
client.radio.save(client);
setInterval(() => {
if(client.radio.size == 0 && client.config.streamerMode == "auto" && client.config.maintenanceMode){
client.streamer.leave(client);
client.streamer = new Streamer();
client.streamer.init(client);
client.radio.restore(client, guilds);
client.user.setStatus('online');
client.config.maintenanceMode = false;
}
if(!client.config.maintenanceMode){
clearInterval();
}
}, 500);
break;
default:
}
/*
if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
}
let currentRadios = client.radio.keys();
let radio = currentRadios.next();
let stoppedRadios = "";
client.user.setStatus('dnd');
while (!radio.done) {
let currentRadio = client.radio.get(radio.value);
currentRadio.guild = client.datastore.getEntry(radio.value).guild;
if(currentRadio){
client.funcs.statisticsUpdate(client, currentRadio.guild, currentRadio);
currentRadio.connection?.destroy();
currentRadio.audioPlayer?.stop();
currentRadio.message?.delete();
client.radio.delete(radio.value);
stoppedRadios += "-" + radio.value + ": " + currentRadio.guild.name + "\n";
}
radio = currentRadios.next();
}
const embed = new Discord.MessageEmbed()
.setTitle(client.messages.maintenanceTitle)
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["maintenance"].replace(/[^0-9]+/g, ''))
.setColor(client.config.embedColor)
.setDescription("Stopped all radios" + "\n" + stoppedRadios)
.setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png')
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
interaction.reply({
embeds: [embed],
ephemeral: true
});*/
}
};
};

View File

@ -5,7 +5,7 @@ module.exports = {
async execute(interaction, client, command) {
if (client.funcs.check(client, interaction, command)) {
const radio = client.radio.get(interaction.guild.id);
let index = client.stations.findIndex(station => station.name == radio.station.name) + 1;
if(index == client.stations.length) index = 0;
@ -16,24 +16,20 @@ module.exports = {
ephemeral: true
});
let url = station.stream[station.stream.default];
client.statistics.update(client, interaction.guild, radio);
client.funcs.statisticsUpdate(client, interaction.guild, radio);
radio.audioPlayer.stop();
let date = new Date();
radio.station = station;
radio.textChannel = interaction.channel;
radio.startTime = date.getTime();
if(interaction.isCommand()) {
client.funcs.play(interaction, interaction.guild, client, url);
client.funcs.play(client, interaction, interaction.guild, station);
}
if(interaction.isButton()) {
interaction.deferUpdate();
client.funcs.play(null, interaction.guild, client, url);
client.funcs.play(client, null, interaction.guild, station);
}
}
}
}
}

View File

@ -15,7 +15,7 @@ module.exports = {
const completed = (radio.playTime);
message.nowplayingDescription = client.messages.nowplayingDescription.replace("%radio.station.name%", radio.station.name);
message.nowplayingDescription = message.nowplayingDescription.replace("%radio.station.owner%", radio.station.owner);
message.nowplayingDescription = message.nowplayingDescription.replace("%radio.station.owner%" + "\n", radio.station.name != radio.station.owner ? radio.station.owner + "\n" : "");
message.nowplayingDescription = message.nowplayingDescription.replace("%client.funcs.msToTime(completed)%", client.funcs.msToTime(completed));
const embed = new Discord.MessageEmbed()
@ -25,11 +25,11 @@ module.exports = {
.setDescription(message.nowplayingDescription)
.setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png')
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
interaction.reply({
embeds: [embed],
ephemeral: true
});
}
}
};
};

View File

@ -1,5 +1,4 @@
const {
createAudioPlayer,
getVoiceConnection,
joinVoiceChannel
} = require("@discordjs/voice");
@ -14,6 +13,14 @@ module.exports = {
category: "radio",
async execute(interaction, client) {
let message = {};
if(client.config.maintenanceMode){
return interaction.reply({
content: client.messageEmojis["error"] + client.messages.maintenance,
ephemeral: true
});
}
if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return interaction.reply({
@ -70,7 +77,6 @@ module.exports = {
ephemeral: true
});
} else {
url = client.stations[number].stream[client.stations[number].stream.default];
station = client.stations[number];
}
} else {
@ -78,24 +84,22 @@ module.exports = {
content: client.messageEmojis["error"] + client.messages.tooShortSearch,
ephemeral: true
});
const sstation = await client.funcs.searchStation(query, client);
const sstation = await client.stations.search(query, client);
if (!sstation) return interaction.reply({
content: client.messageEmojis["error"] + client.messages.noSearchResults,
ephemeral: true
});
url = sstation.stream[sstation.stream.default];
station = sstation;
}
if (radio) {
client.funcs.statisticsUpdate(client, interaction.guild, radio);
radio.audioPlayer.stop();
client.statistics.update(client, interaction.guild, radio);
let date = new Date();
radio.station = station;
radio.textChannel = interaction.channel;
radio.startTime = date.getTime();
client.funcs.play(interaction, interaction.guild, client, url);
client.funcs.play(client, interaction, interaction.guild, station);
return;
}
@ -105,7 +109,6 @@ module.exports = {
voiceChannel: voiceChannel,
connection: null,
message: null,
audioPlayer: createAudioPlayer(),
station: station
};
client.radio.set(interaction.guild.id, construct);
@ -121,17 +124,8 @@ module.exports = {
construct.connection = connection;
let date = new Date();
construct.startTime = date.getTime();
client.funcs.play(interaction, interaction.guild, client, url);
client.datastore.checkEntry(interaction.guild.id);
construct.currentGuild = client.datastore.getEntry(interaction.guild.id);
if (!construct.currentGuild.statistics[construct.station.name]) {
construct.currentGuild.statistics[construct.station.name] = {};
construct.currentGuild.statistics[construct.station.name].time = 0;
construct.currentGuild.statistics[construct.station.name].used = 0;
client.datastore.updateEntry(interaction.guild, construct.currentGuild);
}
client.funcs.play(client, interaction, interaction.guild, station);
} catch (error) {
console.log(error);
client.radio.delete(interaction.guild.id);
@ -141,4 +135,4 @@ module.exports = {
});
}
}
};
};

View File

@ -16,24 +16,21 @@ module.exports = {
ephemeral: true
});
let url = station.stream[station.stream.default];
client.statistics.update(client, interaction.guild, radio);
client.funcs.statisticsUpdate(client, interaction.guild, radio);
radio.audioPlayer.stop();
let date = new Date();
radio.station = station;
radio.textChannel = interaction.channel;
radio.startTime = date.getTime();
if(interaction.isCommand()) {
client.funcs.play(interaction, interaction.guild, client, url);
client.funcs.play(client, interaction, interaction.guild, station);
}
if(interaction.isButton()) {
interaction.deferUpdate();
client.funcs.play(null, interaction.guild, client, url);
client.funcs.play(client, null, interaction.guild, station);
}
}
}
}
}

View File

@ -11,7 +11,7 @@ module.exports = {
let currentGuild = client.datastore.getEntry(interaction.guild.id);
let global = client.datastore.getEntry("global");
let statistics = "";
if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return interaction.reply({
@ -35,7 +35,7 @@ module.exports = {
}
});
}
const embed = new Discord.MessageEmbed()
.setTitle(client.messages.statisticsTitle)
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["statistics"].replace(/[^0-9]+/g, ''))
@ -49,4 +49,4 @@ module.exports = {
ephemeral: true
});
}
};
};

View File

@ -14,11 +14,11 @@ module.exports = {
.setTitle(message.statusTitle)
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
.setColor(client.config.embedColor)
.addField(client.messages.statusField1, Date.now() - interaction.createdTimestamp + "ms", true)
.addField(client.messages.statusField2, client.ws.ping + "ms", true)
.addField(client.messages.statusField3, uptime, true)
.addField(client.messages.statusField4, client.config.version, true)
.addField(client.messages.statusField5, client.config.hostedBy, true)
.addField(client.messages.statusField1, uptime, false)
.addField(client.messages.statusField2, client.config.version, false)
.addField(client.messages.statusField3, Date.now() - interaction.createdTimestamp + "ms", false)
.addField(client.messages.statusField4, client.ws.ping + "ms", false)
.addField(client.messages.statusField5, client.config.hostedBy, false)
.setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png')
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
@ -28,4 +28,4 @@ module.exports = {
});
}
};
};

View File

@ -5,12 +5,11 @@ module.exports = {
description: 'Stop radio',
category: 'radio',
async execute(interaction, client, command) {
const radio = client.radio.get(interaction.guild.id);
if (client.funcs.check(client, interaction, command)) {
client.funcs.statisticsUpdate(client, interaction.guild, radio);
const radio = client.radio.get(interaction.guild.id);
client.statistics.update(client, interaction.guild, radio);
radio.connection?.destroy();
radio.audioPlayer?.stop();
client.funcs.logger('Radio', 'Stream stopped' + " / " + interaction.guild.id);
client.funcs.logger('Radio', interaction.guild.id + " / " + 'Stop');
const embed = new Discord.MessageEmbed()
.setTitle(client.user.username)
@ -23,7 +22,11 @@ module.exports = {
if(!radio.message){
radio.message = radio.textChannel.send({ embeds: [embed], components: [] });
} else {
radio.message.edit({ embeds: [embed], components: [] });
if(radio.textChannel.id == radio.message.channel.id){
radio.message.edit({ embeds: [embed], components: [] });
} else {
radio.message?.delete();
}
}
setTimeout(async function() {
@ -38,4 +41,4 @@ module.exports = {
});
}
}
};
};

View File

@ -1,136 +0,0 @@
const fs = require('fs');
const path = require('path');
module.exports = class {
constructor() {
this.map = new Map();
this.loadData();
}
loadData() {
const dir = path.join(path.dirname(__dirname), '../datastore');
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
//console.log("");
const dataFiles = fs.readdirSync(path.join(path.dirname(__dirname), '../datastore')).filter(f => f.endsWith('.json'));
for (const file of dataFiles) {
try {
const json = require(`../../datastore/${file}`);
this.map.set(json.guild.id, json);
//console.log('[LOADED] ' + file + " (" + json.guild.id + ")");
//console.log(JSON.stringify(json, null, 4));
} catch (error) {
//console.log('[ERROR] Loading ' + file + ' failed');
}
}
//console.log("");
}
calculateGlobal(client){
let guilds = this.map.keys();
let stations = client.stations;
var statistics = {};
if(!client.stations) return;
let calculation = guilds.next();
while (!calculation.done) {
let currentGuild = this.getEntry(calculation.value);
if(calculation.value != 'global'){
if(stations){
Object.keys(stations).forEach(function(station) {
if(currentGuild.statistics[stations[station].name] && currentGuild.statistics[stations[station].name].time && parseInt(currentGuild.statistics[stations[station].name].time) != 0 && currentGuild.statistics[stations[station].name].used && parseInt(currentGuild.statistics[stations[station].name].used) != 0){
if(!statistics[stations[station].name]){
statistics[stations[station].name] = {};
statistics[stations[station].name].time = 0;
statistics[stations[station].name].used = 0;
}
statistics[stations[station].name].time = parseInt(statistics[stations[station].name].time)+parseInt(currentGuild.statistics[stations[station].name].time);
statistics[stations[station].name].used = parseInt(statistics[stations[station].name].used)+parseInt(currentGuild.statistics[stations[station].name].used);
}
});
}
}
calculation = guilds.next();
}
let newData = {};
newData.guild = {};
newData.guild.id = "global";
newData.guild.name = "global";
newData.statistics = statistics;
this.updateEntry(newData.guild, newData);
}
checkEntry(id){
if(!this.map.has(id)){
this.createEntry(id);
//this.showEntry(this.getEntry(id));
} else {
//this.showEntry(this.getEntry(id));
}
}
createEntry(id){
let newData = {};
newData.guild = {};
newData.guild.id = id;
newData.statistics = {};
newData.state = {};
this.map.set(id, newData);
this.saveEntry(id, newData);
}
getEntry(id){
return this.map.get(id);
}
updateEntry(guild, newData) {
newData.guild.name = guild.name;
let date = new Date();
newData.updated = date.toISOString().substring(0, 10)
this.map.set(guild.id, newData);
this.saveEntry(guild.id, newData);
//this.showEntry(this.getEntry(guild.id));
}
showEntry(data){
console.log(data);
}
createTestFile () {
let newData = {
"guild": {
"id": "test",
"name": "Test"
},
"statistics": {
"test": {
"time": 0,
"used": 0
}
},
"state": {
}
}
this.updateEntry(newData.guild, newData);
}
saveEntry(file, data) {
data = JSON.stringify(data, null, 4);
fs.writeFile(path.join(path.dirname(__dirname), '../datastore') + "/" + file + ".json", data, 'utf8', function(err) {
if (err) {
//console.log(err);
}
});
}
};

View File

@ -39,4 +39,4 @@ module.exports = {
}
}
}
}
}

View File

@ -3,16 +3,13 @@ module.exports = {
execute(client) {
client.user.setStatus('dnd');
console.log("\n");
client.funcs.logger("Bot", "Closing");
console.log("\n");
client.streamer.leave(client);
client.radio.save(client);
client.funcs.saveRadios(client);
setInterval(() => {
if(client.radio.size == 0){
process.exit();
}
}, 500);
}
}
}

View File

@ -3,4 +3,4 @@ module.exports = {
execute(client) {
process.emit('SIGINT');
}
}
}

View File

@ -4,9 +4,9 @@ module.exports = {
const permissions = interaction.channel.permissionsFor(interaction.client.user);
if (!permissions.has('VIEW_CHANNEL')) return;
if (!permissions.has('EMBED_LINKS')) return interaction.reply({
content: client.messages.noPermsEmbed,
content: client.messageEmojis["error"] + client.messages.noPermsEmbed,
ephemeral: true
});
@ -14,12 +14,12 @@ module.exports = {
const commandName = interaction.commandName;
const command = client.commands.get(commandName);
if (!command) return;
try {
command.execute(interaction, client);
} catch (error) {
interaction.reply({
content: client.messages.runningCommandFailed,
content: client.messageEmojis["error"] + client.messages.runningCommandFailed,
ephemeral: true
});
console.error(error);
@ -33,7 +33,7 @@ module.exports = {
command.execute(interaction, client, command);
} catch (error) {
interaction.reply({
content: client.messages.runningCommandFailed,
content: client.messageEmojis["error"] + client.messages.runningCommandFailed,
ephemeral: true
});
console.error(error);

View File

@ -16,7 +16,7 @@ module.exports = {
} else {
return;
}
const args = message.content.slice(prefix.length).split(' ');
if (!message.content.startsWith(prefix)) return;
if (!args[0]) return;
@ -30,7 +30,7 @@ module.exports = {
let newMessage = {};
newMessage.messageCommandsDeprecatedTitle = client.messages.messageCommandsDeprecatedTitle.replace("%client.user.username%", client.user.username);
const embed = new Discord.MessageEmbed()
.setTitle(newMessage.messageCommandsDeprecatedTitle)
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
@ -55,4 +55,4 @@ module.exports = {
console.error(error);
}
}
}
}

View File

@ -7,4 +7,4 @@ module.exports = {
if(msg.id != radio.message.id) return;
radio.message = null;
}
}
}

View File

@ -1,5 +1,8 @@
import Datastore from "../datastore.js";
import fetch from "node-fetch";
import Datastore from "../classes/Datastore.js";
import Radio from "../classes/Radio.js";
import Stations from "../classes/Stations.js";
import Streamer from "../classes/Streamer.js";
import Statistics from "../classes/Statistics.js";
module.exports = {
name: 'ready',
@ -21,7 +24,7 @@ module.exports = {
/*DEVELOPERS*/
client.funcs.logger('Developers');
client.developers = "";
let user = "";
for (let i = 0; i < client.config.devId.length; i++) {
@ -36,42 +39,27 @@ module.exports = {
console.log("\n");
/*STATIONS*/
try {
client.funcs.logger('Stations', 'Started fetching list ' + client.config.stationslistUrl);
client.stations = await fetch(client.config.stationslistUrl)
.then(client.funcs.checkFetchStatus)
.then(response => response.json());
client.stations = new Stations();
client.funcs.logger('Stations');
client.stations.forEach(station => {
console.log("- " + station.name);
});
console.log("\n");
await client.stations.fetch({
url: client.config.stationslistUrl,
show: true
});
client.funcs.logger('Stations', 'Successfully fetched list');
} catch (error) {
client.funcs.logger('Stations', 'Fetching list failed');
console.error(error + "\n");
}
setInterval(async () => {
try {
client.funcs.logger('Stations', 'Started fetching list ' + client.config.stationslistUrl);
client.stations = await fetch(client.config.stationslistUrl)
.then(client.funcs.checkFetchStatus)
.then(response => response.json());
client.funcs.logger('Stations', 'Successfully fetched list');
} catch (error) {
client.funcs.logger('Stations', 'Fetching list failed');
//console.error(error);
}
await client.stations.fetch({
url: client.config.stationslistUrl,
show: false
});
}, 3600000);
client.streamer = new Streamer();
client.streamer.init(client);
if(!client.stations) {
client.user.setStatus('dnd');
}
/*GUILDS*/
client.funcs.logger('Guilds', 'Started fetching list');
@ -83,9 +71,10 @@ module.exports = {
console.log("\n");
client.funcs.logger('Guilds', 'Successfully fetched list');
/*STATISTICS*/
client.datastore.calculateGlobal(client);
client.statistics = new Statistics();
client.statistics.calculateGlobal(client);
/*EMOJIS*/
require(`../emojis.js`).execute(client);
@ -93,10 +82,21 @@ module.exports = {
/*COMMANDS*/
require(`../commands.js`).execute(client);
/*RADIO*/
client.radio = new Radio();
setTimeout(function () {
/*RESTORE RADIOS*/
client.funcs.restoreRadios(client, guilds);
client.radio.restore(client, guilds);
}, 5000);
setTimeout(function () {
if(client.stations) {
/*MAINTENANCE MODE*/
client.funcs.logger("Maintenance Mode", "Disabled");
client.config.maintenanceMode = false;
}
}, 10000);
}
}
}

View File

@ -1,7 +1,10 @@
module.exports = {
name: 'uncaughtException',
execute(client, error) {
client.funcs.logger("Error");
console.log(error.stack);
console.log('');
process.emit('SIGINT');
}
}
}

View File

@ -14,11 +14,10 @@ module.exports = {
if (newState.member.id === client.user.id && oldState.member.id === client.user.id) {
if (newState.channel === null) {
client.funcs.statisticsUpdate(client, newState.guild, radio);
client.statistics.update(client, newState.guild, radio);
radio.connection?.destroy();
radio.audioPlayer?.stop();
radio.message?.delete();
client.funcs.logger('Radio', 'Stream stopped' + " / " + newState.guild.id);
client.funcs.logger('Radio', newState.guild.id + " / " + 'Stop');
return client.radio.delete(newState.guild.id);
}
@ -37,11 +36,10 @@ module.exports = {
1000
);
} catch (error) {
client.funcs.statisticsUpdate(client, newState.guild, radio);
client.statistics.update(client, newState.guild, radio);
radio.connection?.destroy();
radio.audioPlayer?.stop();
radio.message?.delete();
client.funcs.logger('Radio', 'Stream stopped' + " / " + newState.guild.id);
client.funcs.logger('Radio', newState.guild.id + " / " + 'Stop');
client.radio.delete(oldState.guild.id);
}
return;
@ -53,18 +51,17 @@ module.exports = {
//radio.connection = await newState.channel.join();
}
}
if ((oldState.channel.members.size === 1 && oldState.channel === radio.voiceChannel) || change) {
if ((oldState.channel.members.filter(member => !member.user.bot).size === 0 && oldState.channel === radio.voiceChannel) || change) {
setTimeout(() => {
if (!radio || !radio.connection || !radio.connection === null) return;
if (radio.voiceChannel.members.size === 1) {
client.funcs.statisticsUpdate(client, newState.guild, radio);
if (radio.voiceChannel.members.filter(member => !member.user.bot).size === 0) {
client.statistics.update(client, newState.guild, radio);
radio.connection?.destroy();
radio.audioPlayer?.stop();
radio.message?.delete();
client.funcs.logger('Radio', 'Stream stopped' + " / " + newState.guild.id);
client.funcs.logger('Radio', newState.guild.id + " / " + 'Stop');
client.radio.delete(newState.guild.id);
}
}, 60000);
}, 5000);
}
},
};

View File

@ -0,0 +1,12 @@
module.exports = {
name: 'warning',
execute(client, warning) {
if(warning.name == "ExperimentalWarning" && warning.message.startsWith("stream/web")) return;
client.funcs.logger("Warning");
console.warn(warning.name);
console.warn(warning.message);
console.warn(warning.stack);
console.log('');
}
}

View File

@ -1,7 +1,14 @@
module.exports = function (client, interaction, command) {
module.exports = function check(client, interaction, command) {
let message = {};
const radio = client.radio.get(interaction.guild.id);
const permissions = interaction.channel.permissionsFor(interaction.user);
if(client.config.maintenanceMode){
interaction.reply({
content: client.messageEmojis["error"] + client.messages.maintenance,
ephemeral: true
});
return false;
}
if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
interaction.reply({

View File

@ -1,7 +0,0 @@
module.exports = function (response) {
if (response.ok) { // res.status >= 200 && res.status < 300
return response;
} else {
throw new Error(response.status + " " + response.statusText);
}
}

View File

@ -1,4 +1,4 @@
module.exports = function (devList, authorID){
module.exports = function isDev(devList, authorID){
let response = false;
Object.keys(devList).forEach(function(oneDev) {
let devID = devList[oneDev];
@ -7,4 +7,4 @@ module.exports = function (devList, authorID){
}
});
return response;
}
}

View File

@ -1,6 +1,6 @@
import Discord from "discord.js";
module.exports = function (client, interaction){
module.exports = function listStations(client, interaction){
let stations = new Array();
let options = new Array();
@ -30,4 +30,4 @@ module.exports = function (client, interaction){
components: [menu],
ephemeral: true
});
}
}

View File

@ -4,7 +4,9 @@ module.exports = function loadState(client, guild){
let state;
state = data.state;
if(!state) return;
data.state = {};
client.datastore.updateEntry(guild, data);
return state;
}
}

View File

@ -1,5 +1,5 @@
module.exports = function (area, text){
module.exports = function logger(area, text){
let date = new Date();
console.log('[' + area + '] ' + date.toISOString());
if(text) console.log(text + '\n');
}
}

View File

@ -9,4 +9,4 @@ module.exports = function msToTime(duration) {
: +hours > 0
? `${+hours < 10 ? `0${hours}` : hours}:${+minutes < 10 ? `0${minutes}` : minutes}:${+seconds < 10 ? `0${seconds}` : seconds}`
: `${+minutes < 10 ? `0${minutes}` : minutes}:${+seconds < 10 ? `0${seconds}` : seconds}`;
}
}

View File

@ -1,42 +1,15 @@
import Discord from "discord.js";
const {
createAudioResource
} = require("@discordjs/voice");
module.exports = async function play(interaction, guild, client, url) {
module.exports = async function play(client, interaction, guild, station) {
let message = {};
const radio = client.radio.get(guild.id);
const resource = createAudioResource(url);
radio.connection.subscribe(radio.audioPlayer);
radio.audioPlayer.play(resource);
resource.playStream
.on("readable", () => {
client.funcs.logger('Radio', 'Stream started' + " / " + guild.id + " / " + radio.station.name);
})
.on("finish", () => {
client.funcs.logger('Radio', 'Stream finished' + " / " + guild.id);
client.funcs.statisticsUpdate(client, guild, radio);
radio.connection?.destroy();
radio.audioPlayer?.stop();
client.radio.delete(guild.id);
return;
})
.on("error", error => {
client.funcs.logger('Radio', 'Stream errored');
console.error(error);
radio.connection?.destroy();
radio.audioPlayer?.stop();
client.radio.delete(guild.id);
return interaction.reply({
content: client.messages.errorPlaying,
ephemeral: true
});
});
const audioPlayer = client.streamer.listen(station);
radio.connection.subscribe(audioPlayer);
client.funcs.logger('Radio', guild.id + " / " + "Play" + " / " + radio.station.name);
message.nowplayingDescription = client.messages.nowplayingDescription.replace("%radio.station.name%", radio.station.name);
message.nowplayingDescription = message.nowplayingDescription.replace("%radio.station.owner%", radio.station.owner);
message.nowplayingDescription = message.nowplayingDescription.replace("%radio.station.owner%", radio.station.name != radio.station.owner ? radio.station.owner + "\n" : "");
message.nowplayingDescription = message.nowplayingDescription.replace("%client.funcs.msToTime(completed)%", "");
message.nowplayingDescription = message.nowplayingDescription.replace("Owner: ", "");
message.nowplayingDescription = message.nowplayingDescription.replace("**", "");
message.nowplayingDescription = message.nowplayingDescription.replace("**", "");
@ -47,7 +20,7 @@ module.exports = async function play(interaction, guild, client, url) {
.addField(client.messages.nowplayingTitle, message.nowplayingDescription, true)
.setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png')
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
const buttons = new Discord.MessageActionRow()
.addComponents(
new Discord.MessageButton()
@ -83,14 +56,19 @@ module.exports = async function play(interaction, guild, client, url) {
if(!radio.message){
radio.message = await radio.textChannel.send({ embeds: [embed], components: [buttons] });
} else {
radio.message.edit({ embeds: [embed], components: [buttons] });
if(radio.textChannel.id == radio.message.channel.id){
radio.message.edit({ embeds: [embed], components: [buttons] });
} else {
radio.message?.delete();
radio.message = await radio.textChannel.send({ embeds: [embed], components: [buttons] });
}
}
message.play = client.messages.play.replace("%radio.station.name%", radio.station.name);
interaction?.reply({
content: client.messageEmojis["play"] + message.play,
ephemeral: true
});
}
}

View File

@ -1,62 +0,0 @@
import Discord from "discord.js";
const {
createAudioPlayer,
getVoiceConnection,
joinVoiceChannel
} = require("@discordjs/voice");
module.exports = async function restoreRadios(client, guilds) {
if(!client.stations) return;
guilds.forEach(async guild => {
let state = client.funcs.loadState(client, guild);
if(!state) return;
if(!state.station || !state.channels.voice || !state.channels.text) return;
let voiceChannel = client.channels.cache.get(state.channels.voice);
if(!voiceChannel) return;
if(voiceChannel.members.size === 0) return;
const sstation = await client.funcs.searchStation(state.station.name, client);
let url = sstation.stream[sstation.stream.default];
let station = sstation;
const construct = {
textChannel: client.channels.cache.get(state.channels.text),
voiceChannel: client.channels.cache.get(state.channels.voice),
connection: null,
message: null,
audioPlayer: createAudioPlayer(),
station: station
};
client.radio.set(guild.id, construct);
try {
const connection =
getVoiceConnection(guild.id) ??
joinVoiceChannel({
channelId: voiceChannel.id,
guildId: voiceChannel.guild.id,
adapterCreator: voiceChannel.guild.voiceAdapterCreator
});
construct.connection = connection;
let date = new Date();
construct.startTime = date.getTime();
client.funcs.play(null, guild, client, url, Discord);
client.datastore.checkEntry(guild.id);
construct.datastore = client.datastore.getEntry(guild.id);
if (!construct.datastore.statistics[construct.station.name]) {
construct.datastore.statistics[construct.station.name] = {};
construct.datastore.statistics[construct.station.name].time = 0;
construct.datastore.statistics[construct.station.name].used = 0;
client.datastore.updateEntry(guild, construct.datastore);
}
} catch (error) {
console.log(error);
}
});
}

View File

@ -1,20 +0,0 @@
module.exports = function saveRadios(client) {
let currentRadios = client.radio.keys();
let radio = currentRadios.next();
while (!radio.done) {
let currentRadio = client.radio.get(radio.value);
currentRadio.guild = client.datastore.getEntry(radio.value).guild;
if (currentRadio) {
client.funcs.statisticsUpdate(client, currentRadio.guild, currentRadio);
client.funcs.saveState(client, currentRadio.guild, currentRadio);
currentRadio.connection?.destroy();
currentRadio.audioPlayer?.stop();
currentRadio.message?.delete();
client.radio.delete(radio.value);
}
radio = currentRadios.next();
}
}

View File

@ -1,6 +1,6 @@
module.exports = function saveState(client, guild, radio){
client.datastore.checkEntry(guild.id);
let date = new Date();
let data = client.datastore.getEntry(guild.id);
@ -15,4 +15,4 @@ module.exports = function saveState(client, guild, radio){
data.state.station.owner = radio.station.owner;
client.datastore.updateEntry(guild, data);
}
}

View File

@ -1,62 +0,0 @@
module.exports = function searchStation(key, client) {
if (client.stations === null) return false;
let foundStations = [];
if (!key) return false;
if (key == "radio") return false;
client.stations
.filter(
x => x.name.toUpperCase().includes(key.toUpperCase()) || x === key
)
.forEach(x =>
foundStations.push({ station: x, name: x.name, probability: 100 })
);
if (key.startsWith("radio ")) key = key.slice(6);
const probabilityIncrement = 100 / key.split(" ").length / 2;
for (let i = 0; i < key.split(" ").length; i++) {
client.stations
.filter(
x => x.name.toUpperCase().includes(key.split(" ")[i].toUpperCase()) || x === key
)
.forEach(x =>
foundStations.push({ station: x, name: x.name, probability: probabilityIncrement })
);
}
if (foundStations.length === 0) return false;
for (let i = 0; i < foundStations.length; i++) {
for (let j = 0; j < foundStations.length; j++) {
if (foundStations[i] === foundStations[j] && i !== j) foundStations.splice(i, 1);
}
}
for (let i = 0; i < foundStations.length; i++) {
if (foundStations[i].name.length > key.length) {
foundStations[i].probability -=
(foundStations[i].name.split(" ").length - key.split(" ").length) *
(probabilityIncrement * 0.5);
} else if (foundStations[i].name.length === key.length) {
foundStations[i].probability += probabilityIncrement * 0.9;
}
for (let j = 0; j < key.split(" ").length; j++) {
if (!foundStations[i].name.toUpperCase().includes(key.toUpperCase().split(" ")[j])) {
foundStations[i].probability -= probabilityIncrement * 0.5;
}
}
}
let highestProbabilityStation;
for (let i = 0; i < foundStations.length; i++) {
if (
!highestProbabilityStation ||
highestProbabilityStation.probability < foundStations[i].probability
)
highestProbabilityStation = foundStations[i];
if (
highestProbabilityStation &&
highestProbabilityStation.probability === foundStations[i].probability
) {
highestProbabilityStation = foundStations[i].station;
}
}
return highestProbabilityStation;
}

View File

@ -1,22 +0,0 @@
module.exports = function statisticsUpdate(client, guild, radio) {
client.datastore.checkEntry(guild.id);
radio.datastore = client.datastore.getEntry(guild.id);
if(!radio.datastore.statistics[radio.station.name]){
radio.datastore.statistics[radio.station.name] = {};
radio.datastore.statistics[radio.station.name].time = 0;
radio.datastore.statistics[radio.station.name].used = 0;
client.datastore.updateEntry(guild, radio.datastore);
}
let date = new Date();
radio.currentTime = date.getTime();
radio.playTime = parseInt(radio.currentTime)-parseInt(radio.startTime);
radio.datastore.statistics[radio.station.name].time = parseInt(radio.datastore.statistics[radio.station.name].time)+parseInt(radio.playTime);
radio.datastore.statistics[radio.station.name].used = parseInt(radio.datastore.statistics[radio.station.name].used)+1;
client.datastore.updateEntry(guild, radio.datastore);
client.datastore.calculateGlobal(client);
}

View File

@ -11,7 +11,7 @@ module.exports = {
inviteTitle: "Invite %client.user.username% to your Discord server!",
listTitle: "Radio Stations",
nowplayingTitle: "Now Playing",
nowplayingDescription: "**%radio.station.name%**" + "\n" + "Owner: %radio.station.owner%" + "\n" + "%client.funcs.msToTime(completed)%",
nowplayingDescription: "**%radio.station.name%**" + "\n" + "%radio.station.owner%" + "\n" + "%client.funcs.msToTime(completed)%",
noVoiceChannel: "You need to be in a voice channel to play radio!",
noQuery: "You need to use a number or search for a supported station!",
noPermsConnect: "I cannot connect to your voice channel.",
@ -29,12 +29,13 @@ module.exports = {
sendedMaintenanceMessage: "This bot is going to be under maintenance!",
footerText: "EximiaBots by Warén Group",
statusTitle: "%client.user.username% Status",
statusField1: "Bot Latency",
statusField2: "API Latency",
statusField3: "Uptime",
statusField4: "Version",
statusField5: "Hosted by",
statusField1: ":clock1: Bot Uptime",
statusField2: ":floppy_disk: Bot Version",
statusField3: ":heartbeat: WebSocket Ping",
statusField4: ":hourglass: Latency",
statusField5: ":globe_with_meridians: Hosted by",
errorStationURL: "Station can't be URL",
messageCommandsDeprecatedTitle: "%client.user.username%",
messageCommandsDeprecatedDescription: "We recommend you to reauthorize our bot by clicking the invite link down below, because Discord is planning to remove message content from verified bots [Read More](https://support-dev.discord.com/hc/en-us/articles/4404772028055)" + "\n\n" + "**Invite Bot**" + "\n" + "https://wgi.fi/radiox_invite" + "\n\n" + "This bot now supports slash commands, you should start using them instead. Type / into the message box and select the bot you wish to use. Remember to be careful as there are a few bugs here and there on Discord." + "\n\n" + "We will remove this deprecation message in March of 2022 when RadioX 1.0.0 is released."
};
messageCommandsDeprecatedDescription: "We recommend you to reauthorize our bot by clicking the invite link down below, because Discord is planning to remove message content from verified bots [Read More](https://support-dev.discord.com/hc/en-us/articles/4404772028055)" + "\n\n" + "**Invite Bot**" + "\n" + "https://wgi.fi/radiox_invite" + "\n\n" + "This bot now supports slash commands, you should start using them instead. Type / into the message box and select the bot you wish to use. Remember to be careful as there are a few bugs here and there on Discord." + "\n\n" + "We will remove this deprecation message in March of 2022 when RadioX 1.0.0 is released.",
maintenance: "Shhhh... We are now sleeping and dreaming about new features to implement. Will be back soon."
};

View File

@ -1,3 +1,3 @@
export interface command { }
export interface radio {}
export interface radio {}

View File

@ -20,7 +20,9 @@ module.exports = {
hostedBy: "[Warén Group](https://waren.io)",
//Settings
version: process.env.RADIOX_VERSION || process.env.npm_package_version,
debug: process.env.DEBUG_MODE || false
}
version: process.env.DEV_MODE ? process.env.npm_package_version + "-dev" : process.env.npm_package_version,
debug: process.env.DEBUG_MODE || false,
devMode: process.env.DEV_MODE || false,
maintenanceMode: false,
streamerMode: process.env.STREAMER_MODE || "manual"
}