mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-01 14:23:41 +00:00
Compare commits
164 Commits
Author | SHA1 | Date | |
---|---|---|---|
5132e40d2c | |||
1d6361871c | |||
3978f19b2e | |||
26cdef50b2 | |||
fee833d231 | |||
6541287dec | |||
44d81b6fd7 | |||
200f16eac0 | |||
8c9fe03629 | |||
24071eb5df | |||
3b5c241872 | |||
44a708548f | |||
5c1a8f0ef1 | |||
526bb7736a | |||
22c0544d09 | |||
9c3748ad7c | |||
3807ae89a0 | |||
9e2be295c3 | |||
fb257d1c30 | |||
17a075cd29 | |||
93b5663ebe | |||
8399fd5bb1 | |||
364b5d9b3c | |||
e08c20aa3d | |||
65bebb7b13 | |||
13814afebc | |||
b44bc679e5 | |||
c83b90aa20 | |||
1bb8d8d801 | |||
0b1cb03305 | |||
90a93d35f7 | |||
24716dd497 | |||
259b58aa1a | |||
52ec0845a7 | |||
ddbe950a19 | |||
46790b12ff | |||
488d0a6d12 | |||
7699871779 | |||
ac323a5410 | |||
9408d0d66b | |||
5cd3912ff5 | |||
33e674f7c7 | |||
d0c10018f3 | |||
523c94aafb | |||
ac42502883 | |||
704596c371 | |||
4de241ecab | |||
f70818c9f3 | |||
6ad412000d | |||
2804f942b7 | |||
561b365e44 | |||
9475c68682 | |||
34abb66086 | |||
890df2c27c | |||
cb1d2ca6b9 | |||
f31ad5ceca | |||
8b5933749d | |||
ab950352fa | |||
984e8aab76 | |||
cc8b44db9b | |||
1371a83e90 | |||
33e4a416a9 | |||
5bf4bd9a1c | |||
4edfe6848c | |||
884233a938 | |||
3ac284e237 | |||
d1fe9177af | |||
8316723a6a | |||
f9ce2bfaf9 | |||
a9857cb34b | |||
894a1d82f5 | |||
fa4f5e1e09 | |||
12c8b8558f | |||
bb8a36ad5c | |||
ebeeadd5c3 | |||
6e0b2f5092 | |||
2286815485 | |||
2e402de6bf | |||
45d68ff4ab | |||
370701a4b9 | |||
956f1f7b6d | |||
115a2e7589 | |||
f9d195788c | |||
c673ae27f6 | |||
c5d04aed3c | |||
e39a24de2a | |||
aa715aaafa | |||
9303dd1c19 | |||
9a5075f27e | |||
60ef1cd138 | |||
235a02ca60 | |||
05852b99d4 | |||
01730cd08b | |||
6335a4617f | |||
552d3c81f9 | |||
2d9b0ce732 | |||
3b0f8068c1 | |||
c142fc61b4 | |||
dcfde4131f | |||
a1cb21d98e | |||
4c731c1942 | |||
d2a6d70cf6 | |||
f5ef44b12a | |||
a86cf0c769 | |||
7a0a3e0d50 | |||
479c0ee13d | |||
b280981e1c | |||
933140502d | |||
dfada15b00 | |||
8fdcdd0116 | |||
11573a5113 | |||
7e3a83743d | |||
38af503626 | |||
534bc74936 | |||
ea2be5d5fb | |||
38a8571ddc | |||
2d41c7a76b | |||
16bc2aab52 | |||
17132cd51a | |||
ec6ea7e839 | |||
c81dbddab1 | |||
e0226c5cfe | |||
3f12bafee0 | |||
3fc28a79cb | |||
72d0054d25 | |||
25356be323 | |||
e8d90f8a3c | |||
c724ae502f | |||
a3efdbf3cb | |||
2857b6886f | |||
1e24e89568 | |||
3609e6af10 | |||
d5fefcdbbc | |||
8860952c07 | |||
55905e3841 | |||
d27cdf6ee5 | |||
0d4c46cfd4 | |||
190852bc16 | |||
9ef6b3f36f | |||
1a5caf244f | |||
73857c9fc5 | |||
853661ff52 | |||
9040b84050 | |||
1518ff7809 | |||
ba5b142bbe | |||
4ccace9450 | |||
711e6d48fb | |||
83cfec4678 | |||
90f47825b6 | |||
b0270e651e | |||
238a67c267 | |||
2e5f0a781a | |||
d9e57a47e9 | |||
13a085b9de | |||
fddc57d90e | |||
9d9ae80dbe | |||
314c744527 | |||
555b4d14f0 | |||
41fb87fab6 | |||
65bd82054a | |||
40879c85bb | |||
0858f9e49e | |||
a1aa96fc2f | |||
6ed91fe43b |
@ -4,4 +4,4 @@
|
|||||||
datastore
|
datastore
|
||||||
Dockerfile
|
Dockerfile
|
||||||
LICENSE
|
LICENSE
|
||||||
README.md
|
README.md
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
DISCORD_TOKEN=
|
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
|
||||||
|
19
.github/dependabot.yml
vendored
Normal file
19
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
# GitHub Actions
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
target-branch: "develop"
|
||||||
|
labels:
|
||||||
|
- "dependencies"
|
||||||
|
|
||||||
|
# npm
|
||||||
|
- package-ecosystem: "npm"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
||||||
|
target-branch: "develop"
|
||||||
|
labels:
|
||||||
|
- "dependencies"
|
9
.github/labeler.yml
vendored
Normal file
9
.github/labeler.yml
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
dependencies:
|
||||||
|
- package-lock.json
|
||||||
|
|
||||||
|
documentation:
|
||||||
|
- README.md
|
||||||
|
- SECURITY.md
|
||||||
|
- CONTRIBUTING.md
|
||||||
|
- LICENSE
|
||||||
|
- .env_example
|
71
.github/workflows/codeql-analyze.yml
vendored
Normal file
71
.github/workflows/codeql-analyze.yml
vendored
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
# For most projects, this workflow file will not need changing; you simply need
|
||||||
|
# to commit it to your repository.
|
||||||
|
#
|
||||||
|
# You may wish to alter this file to override the set of languages analyzed,
|
||||||
|
# or to provide custom queries or build logic.
|
||||||
|
#
|
||||||
|
# ******** NOTE ********
|
||||||
|
# We have attempted to detect the languages in your repository. Please check
|
||||||
|
# the `language` matrix defined below to confirm you have the correct set of
|
||||||
|
# supported CodeQL languages.
|
||||||
|
#
|
||||||
|
name: "CodeQL Analyze"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master, stable ]
|
||||||
|
pull_request:
|
||||||
|
# The branches below must be a subset of the branches above
|
||||||
|
branches: [ master ]
|
||||||
|
schedule:
|
||||||
|
- cron: '24 20 * * 6'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: CodeQL Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [ 'javascript' ]
|
||||||
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||||
|
# Learn more:
|
||||||
|
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v1
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
|
# By default, queries listed here will override any specified in a config file.
|
||||||
|
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||||
|
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||||
|
|
||||||
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v1
|
||||||
|
|
||||||
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
|
# 📚 https://git.io/JvXDl
|
||||||
|
|
||||||
|
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||||
|
# and modify them (or add more) to build your code if your project
|
||||||
|
# uses a compiled language
|
||||||
|
|
||||||
|
#- run: |
|
||||||
|
# make bootstrap
|
||||||
|
# make release
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v1
|
4
.github/workflows/docker-build.yml
vendored
4
.github/workflows/docker-build.yml
vendored
@ -11,9 +11,9 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1.5.1
|
uses: docker/setup-buildx-action@v1.6.0
|
||||||
id: buildx
|
id: buildx
|
||||||
with:
|
with:
|
||||||
install: true
|
install: true
|
||||||
- name: Build
|
- name: Build
|
||||||
run: docker build . # will run buildx
|
run: docker build . # will run buildx
|
||||||
|
17
.github/workflows/labeler.yml
vendored
Normal file
17
.github/workflows/labeler.yml
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
name: Labeler
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
label:
|
||||||
|
name: Labeler
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.actor != 'dependabot[bot]' }}
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/labeler@v3
|
||||||
|
with:
|
||||||
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
sync-labels: true
|
2
.github/workflows/typescript-build.yml
vendored
2
.github/workflows/typescript-build.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: install node v16
|
- name: install node v16
|
||||||
uses: actions/setup-node@v2.3.1
|
uses: actions/setup-node@v2.4.0
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
- name: npm install
|
- name: npm install
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,6 +1,5 @@
|
|||||||
datastore/
|
datastore/
|
||||||
node_modules/
|
node_modules/
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
.vscode/
|
|
||||||
.env
|
.env
|
||||||
build/
|
build/
|
||||||
|
6
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"files.trimTrailingWhitespace": true,
|
||||||
|
"files.insertFinalNewline": true,
|
||||||
|
"files.trimFinalNewlines": true,
|
||||||
|
"editor.renderFinalNewline": false
|
||||||
|
}
|
27
CONTRIBUTING.md
Normal file
27
CONTRIBUTING.md
Normal 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).
|
@ -14,4 +14,4 @@ RUN npm install
|
|||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
CMD [ "npm", "start" ]
|
CMD [ "npm", "start" ]
|
||||||
|
@ -5,7 +5,7 @@ Internet Radio to your Discord guild
|
|||||||
This bot is using Gitea repo to get radio stations from [playlist.json](https://gitea.cwinfo.org/cwchristerw/radio/raw/branch/master/playlist.json) file. List is currently maintained by Christer Warén. You can use alternative list with same format when using RADIOX_STATIONSLISTURL environment variable.
|
This bot is using Gitea repo to get radio stations from [playlist.json](https://gitea.cwinfo.org/cwchristerw/radio/raw/branch/master/playlist.json) file. List is currently maintained by Christer Warén. You can use alternative list with same format when using RADIOX_STATIONSLISTURL environment variable.
|
||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
1. `docker build -t warengroup/eximiabots-radiox .`
|
1. `docker build -t warengroup/eximiabots-radiox . --pull`
|
||||||
2. `docker run --name radiox-dev -d --net host -e DISCORD_TOKEN= -v "$PWD/datastore":/usr/src/app/datastore/ warengroup/eximiabots-radiox`
|
2. `docker run --name radiox-dev -d --net host -e DISCORD_TOKEN= -v "$PWD/datastore":/usr/src/app/datastore/ warengroup/eximiabots-radiox`
|
||||||
|
|
||||||
## Join our Discord Server
|
## Join our Discord Server
|
||||||
|
17
SECURITY.md
Normal file
17
SECURITY.md
Normal 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.
|
556
package-lock.json
generated
556
package-lock.json
generated
@ -1,30 +1,30 @@
|
|||||||
{
|
{
|
||||||
"name": "eximiabots-radiox",
|
"name": "eximiabots-radiox",
|
||||||
"version": "0.3.1",
|
"version": "0.3.8",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "eximiabots-radiox",
|
"name": "eximiabots-radiox",
|
||||||
"version": "0.3.1",
|
"version": "0.3.8",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discordjs/builders": "^0.6.0",
|
"@discordjs/builders": "^0.6.0",
|
||||||
"@discordjs/opus": "^0.6.0",
|
"@discordjs/opus": "^0.6.0",
|
||||||
"@discordjs/rest": "^0.1.1-canary.0",
|
"@discordjs/rest": "^0.1.1-canary.0",
|
||||||
"@discordjs/voice": "^0.6.0",
|
"@discordjs/voice": "^0.6.0",
|
||||||
"discord-api-types": "^0.22.0",
|
"discord-api-types": "^0.23.1",
|
||||||
"discord.js": "^13.1.0",
|
"discord.js": "^13.1.0",
|
||||||
"dotenv": "^10.0.0",
|
"dotenv": "^10.0.0",
|
||||||
"libsodium-wrappers": "^0.7.9",
|
"libsodium-wrappers": "^0.7.9",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^3.0.0",
|
||||||
"path": "^0.12.7"
|
"path": "^0.12.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^16.7.8",
|
"@types/node": "^16.9.0",
|
||||||
"@types/ws": "^7.4.7",
|
"@types/ws": "^7.4.7",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.29.3",
|
"@typescript-eslint/eslint-plugin": "^4.31.0",
|
||||||
"@typescript-eslint/parser": "^4.29.3",
|
"@typescript-eslint/parser": "^4.31.0",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
@ -36,7 +36,7 @@
|
|||||||
"typescript": "^4.4.2"
|
"typescript": "^4.4.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.6.0",
|
"node": ">=16.8.0",
|
||||||
"npm": ">=7.0.0"
|
"npm": ">=7.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -180,6 +180,14 @@
|
|||||||
"npm": ">=7.0.0"
|
"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": {
|
"node_modules/@discordjs/collection": {
|
||||||
"version": "0.2.1",
|
"version": "0.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
|
||||||
@ -220,6 +228,14 @@
|
|||||||
"node-pre-gyp": "bin/node-pre-gyp"
|
"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": {
|
"node_modules/@discordjs/opus": {
|
||||||
"version": "0.6.0",
|
"version": "0.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.6.0.tgz",
|
||||||
@ -251,6 +267,22 @@
|
|||||||
"node": ">=16.0.0"
|
"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": {
|
"node_modules/@discordjs/voice": {
|
||||||
"version": "0.6.0",
|
"version": "0.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.6.0.tgz",
|
||||||
@ -281,6 +313,14 @@
|
|||||||
"node": ">=12.0.0"
|
"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": {
|
"node_modules/@discordjs/voice/node_modules/node-addon-api": {
|
||||||
"version": "3.2.1",
|
"version": "3.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
|
||||||
@ -460,9 +500,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "16.7.10",
|
"version": "16.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.10.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz",
|
||||||
"integrity": "sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA=="
|
"integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g=="
|
||||||
},
|
},
|
||||||
"node_modules/@types/ws": {
|
"node_modules/@types/ws": {
|
||||||
"version": "7.4.7",
|
"version": "7.4.7",
|
||||||
@ -473,13 +513,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||||
"version": "4.30.0",
|
"version": "4.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.0.tgz",
|
||||||
"integrity": "sha512-NgAnqk55RQ/SD+tZFD9aPwNSeHmDHHe5rtUyhIq0ZeCWZEvo4DK9rYz7v9HDuQZFvn320Ot+AikaCKMFKLlD0g==",
|
"integrity": "sha512-iPKZTZNavAlOhfF4gymiSuUkgLne/nh5Oz2/mdiUmuZVD42m9PapnCnzjxuDsnpnbH3wT5s2D8bw6S39TC6GNw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/experimental-utils": "4.30.0",
|
"@typescript-eslint/experimental-utils": "4.31.0",
|
||||||
"@typescript-eslint/scope-manager": "4.30.0",
|
"@typescript-eslint/scope-manager": "4.31.0",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"functional-red-black-tree": "^1.0.1",
|
"functional-red-black-tree": "^1.0.1",
|
||||||
"regexpp": "^3.1.0",
|
"regexpp": "^3.1.0",
|
||||||
@ -504,15 +544,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/experimental-utils": {
|
"node_modules/@typescript-eslint/experimental-utils": {
|
||||||
"version": "4.30.0",
|
"version": "4.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.0.tgz",
|
||||||
"integrity": "sha512-K8RNIX9GnBsv5v4TjtwkKtqMSzYpjqAQg/oSphtxf3xxdt6T0owqnpojztjjTcatSteH3hLj3t/kklKx87NPqw==",
|
"integrity": "sha512-Hld+EQiKLMppgKKkdUsLeVIeEOrwKc2G983NmznY/r5/ZtZCDvIOXnXtwqJIgYz/ymsy7n7RGvMyrzf1WaSQrw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/json-schema": "^7.0.7",
|
"@types/json-schema": "^7.0.7",
|
||||||
"@typescript-eslint/scope-manager": "4.30.0",
|
"@typescript-eslint/scope-manager": "4.31.0",
|
||||||
"@typescript-eslint/types": "4.30.0",
|
"@typescript-eslint/types": "4.31.0",
|
||||||
"@typescript-eslint/typescript-estree": "4.30.0",
|
"@typescript-eslint/typescript-estree": "4.31.0",
|
||||||
"eslint-scope": "^5.1.1",
|
"eslint-scope": "^5.1.1",
|
||||||
"eslint-utils": "^3.0.0"
|
"eslint-utils": "^3.0.0"
|
||||||
},
|
},
|
||||||
@ -528,14 +568,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/parser": {
|
"node_modules/@typescript-eslint/parser": {
|
||||||
"version": "4.30.0",
|
"version": "4.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.0.tgz",
|
||||||
"integrity": "sha512-HJ0XuluSZSxeboLU7Q2VQ6eLlCwXPBOGnA7CqgBnz2Db3JRQYyBDJgQnop6TZ+rsbSx5gEdWhw4rE4mDa1FnZg==",
|
"integrity": "sha512-oWbzvPh5amMuTmKaf1wp0ySxPt2ZXHnFQBN2Szu1O//7LmOvgaKTCIDNLK2NvzpmVd5A2M/1j/rujBqO37hj3w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/scope-manager": "4.30.0",
|
"@typescript-eslint/scope-manager": "4.31.0",
|
||||||
"@typescript-eslint/types": "4.30.0",
|
"@typescript-eslint/types": "4.31.0",
|
||||||
"@typescript-eslint/typescript-estree": "4.30.0",
|
"@typescript-eslint/typescript-estree": "4.31.0",
|
||||||
"debug": "^4.3.1"
|
"debug": "^4.3.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@ -555,13 +595,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/scope-manager": {
|
"node_modules/@typescript-eslint/scope-manager": {
|
||||||
"version": "4.30.0",
|
"version": "4.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.0.tgz",
|
||||||
"integrity": "sha512-VJ/jAXovxNh7rIXCQbYhkyV2Y3Ac/0cVHP/FruTJSAUUm4Oacmn/nkN5zfWmWFEanN4ggP0vJSHOeajtHq3f8A==",
|
"integrity": "sha512-LJ+xtl34W76JMRLjbaQorhR0hfRAlp3Lscdiz9NeI/8i+q0hdBZ7BsiYieLoYWqy+AnRigaD3hUwPFugSzdocg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "4.30.0",
|
"@typescript-eslint/types": "4.31.0",
|
||||||
"@typescript-eslint/visitor-keys": "4.30.0"
|
"@typescript-eslint/visitor-keys": "4.31.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
|
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
|
||||||
@ -572,9 +612,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/types": {
|
"node_modules/@typescript-eslint/types": {
|
||||||
"version": "4.30.0",
|
"version": "4.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.0.tgz",
|
||||||
"integrity": "sha512-YKldqbNU9K4WpTNwBqtAerQKLLW/X2A/j4yw92e3ZJYLx+BpKLeheyzoPfzIXHfM8BXfoleTdiYwpsvVPvHrDw==",
|
"integrity": "sha512-9XR5q9mk7DCXgXLS7REIVs+BaAswfdHhx91XqlJklmqWpTALGjygWVIb/UnLh4NWhfwhR5wNe1yTyCInxVhLqQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
|
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
|
||||||
@ -585,13 +625,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/typescript-estree": {
|
"node_modules/@typescript-eslint/typescript-estree": {
|
||||||
"version": "4.30.0",
|
"version": "4.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.0.tgz",
|
||||||
"integrity": "sha512-6WN7UFYvykr/U0Qgy4kz48iGPWILvYL34xXJxvDQeiRE018B7POspNRVtAZscWntEPZpFCx4hcz/XBT+erenfg==",
|
"integrity": "sha512-QHl2014t3ptg+xpmOSSPn5hm4mY8D4s97ftzyk9BZ8RxYQ3j73XcwuijnJ9cMa6DO4aLXeo8XS3z1omT9LA/Eg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "4.30.0",
|
"@typescript-eslint/types": "4.31.0",
|
||||||
"@typescript-eslint/visitor-keys": "4.30.0",
|
"@typescript-eslint/visitor-keys": "4.31.0",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"globby": "^11.0.3",
|
"globby": "^11.0.3",
|
||||||
"is-glob": "^4.0.1",
|
"is-glob": "^4.0.1",
|
||||||
@ -612,12 +652,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/visitor-keys": {
|
"node_modules/@typescript-eslint/visitor-keys": {
|
||||||
"version": "4.30.0",
|
"version": "4.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.0.tgz",
|
||||||
"integrity": "sha512-pNaaxDt/Ol/+JZwzP7MqWc8PJQTUhZwoee/PVlQ+iYoYhagccvoHnC9e4l+C/krQYYkENxznhVSDwClIbZVxRw==",
|
"integrity": "sha512-HUcRp2a9I+P21+O21yu3ezv3GEPGjyGiXoEUQwZXjR8UxRApGeLyWH4ZIIUSalE28aG4YsV6GjtaAVB3QKOu0w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "4.30.0",
|
"@typescript-eslint/types": "4.31.0",
|
||||||
"eslint-visitor-keys": "^2.0.0"
|
"eslint-visitor-keys": "^2.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@ -666,9 +706,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/acorn-walk": {
|
"node_modules/acorn-walk": {
|
||||||
"version": "8.1.1",
|
"version": "8.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
||||||
"integrity": "sha512-FbJdceMlPHEAWJOILDk1fXD8lnTlEIWFkqtfk+MvmL5q/qlHfN7GEHcsFZWt/Tea9jRNPWUZG4G976nqAAmU9w==",
|
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
@ -797,12 +837,15 @@
|
|||||||
"integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ=="
|
"integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ=="
|
||||||
},
|
},
|
||||||
"node_modules/are-we-there-yet": {
|
"node_modules/are-we-there-yet": {
|
||||||
"version": "1.1.5",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz",
|
||||||
"integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
|
"integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"delegates": "^1.0.0",
|
"delegates": "^1.0.0",
|
||||||
"readable-stream": "^2.0.6"
|
"readable-stream": "^3.6.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/arg": {
|
"node_modules/arg": {
|
||||||
@ -1158,11 +1201,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
||||||
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
|
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
|
||||||
},
|
},
|
||||||
"node_modules/core-util-is": {
|
|
||||||
"version": "1.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
|
|
||||||
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
|
|
||||||
},
|
|
||||||
"node_modules/create-require": {
|
"node_modules/create-require": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||||
@ -1192,6 +1230,14 @@
|
|||||||
"node": ">=8"
|
"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": {
|
"node_modules/debug": {
|
||||||
"version": "4.3.2",
|
"version": "4.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
|
||||||
@ -1230,9 +1276,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/deep-is": {
|
"node_modules/deep-is": {
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
|
||||||
"integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
|
"integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/defer-to-connect": {
|
"node_modules/defer-to-connect": {
|
||||||
@ -1287,9 +1333,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/discord-api-types": {
|
"node_modules/discord-api-types": {
|
||||||
"version": "0.22.0",
|
"version": "0.23.1",
|
||||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
|
||||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
|
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
@ -1329,6 +1375,22 @@
|
|||||||
"npm": ">=7.0.0"
|
"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": {
|
"node_modules/doctrine": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
|
||||||
@ -1745,6 +1807,27 @@
|
|||||||
"reusify": "^1.0.4"
|
"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": {
|
"node_modules/file-entry-cache": {
|
||||||
"version": "6.0.1",
|
"version": "6.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
||||||
@ -2246,11 +2329,6 @@
|
|||||||
"integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==",
|
"integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/isarray": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
|
||||||
},
|
|
||||||
"node_modules/isexe": {
|
"node_modules/isexe": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
@ -2542,11 +2620,19 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/node-fetch": {
|
"node_modules/node-fetch": {
|
||||||
"version": "2.6.1",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0.tgz",
|
||||||
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
|
"integrity": "sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==",
|
||||||
|
"dependencies": {
|
||||||
|
"data-uri-to-buffer": "^3.0.1",
|
||||||
|
"fetch-blob": "^3.1.2"
|
||||||
|
},
|
||||||
"engines": {
|
"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": {
|
"node_modules/nodemon": {
|
||||||
@ -2650,11 +2736,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/npmlog": {
|
"node_modules/npmlog": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz",
|
||||||
"integrity": "sha512-ftpIiLjerL2tUg3dCqN8pOSoB90gqZlzv/gaZoxHaKjeLClrfJIEQ1Pdxi6qSzflz916Bljdy8dTWQ4J7hAFSQ==",
|
"integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"are-we-there-yet": "^1.1.5",
|
"are-we-there-yet": "^2.0.0",
|
||||||
"console-control-strings": "^1.1.0",
|
"console-control-strings": "^1.1.0",
|
||||||
"gauge": "^3.0.0",
|
"gauge": "^3.0.0",
|
||||||
"set-blocking": "^2.0.0"
|
"set-blocking": "^2.0.0"
|
||||||
@ -2843,9 +2929,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/prettier": {
|
"node_modules/prettier": {
|
||||||
"version": "2.3.2",
|
"version": "2.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.0.tgz",
|
||||||
"integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==",
|
"integrity": "sha512-DsEPLY1dE5HF3BxCRBmD4uYZ+5DCbvatnolqTqcxEgKVZnL2kUfyu7b8pPQ5+hTBkdhU9SLUmK0/pHb07RE4WQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"prettier": "bin-prettier.js"
|
"prettier": "bin-prettier.js"
|
||||||
@ -2874,11 +2960,6 @@
|
|||||||
"node": ">= 0.6.0"
|
"node": ">= 0.6.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/process-nextick-args": {
|
|
||||||
"version": "2.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
|
||||||
},
|
|
||||||
"node_modules/progress": {
|
"node_modules/progress": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
||||||
@ -2985,17 +3066,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/readable-stream": {
|
"node_modules/readable-stream": {
|
||||||
"version": "2.3.7",
|
"version": "3.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
|
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||||
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
|
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-util-is": "~1.0.0",
|
"inherits": "^2.0.3",
|
||||||
"inherits": "~2.0.3",
|
"string_decoder": "^1.1.1",
|
||||||
"isarray": "~1.0.0",
|
"util-deprecate": "^1.0.1"
|
||||||
"process-nextick-args": "~2.0.0",
|
},
|
||||||
"safe-buffer": "~5.1.1",
|
"engines": {
|
||||||
"string_decoder": "~1.1.1",
|
"node": ">= 6"
|
||||||
"util-deprecate": "~1.0.1"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/readdirp": {
|
"node_modules/readdirp": {
|
||||||
@ -3121,9 +3201,23 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/safe-buffer": {
|
"node_modules/safe-buffer": {
|
||||||
"version": "5.1.2",
|
"version": "5.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/feross"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "patreon",
|
||||||
|
"url": "https://www.patreon.com/feross"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "consulting",
|
||||||
|
"url": "https://feross.org/support"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"node_modules/semver": {
|
"node_modules/semver": {
|
||||||
"version": "7.3.5",
|
"version": "7.3.5",
|
||||||
@ -3254,11 +3348,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/string_decoder": {
|
"node_modules/string_decoder": {
|
||||||
"version": "1.1.1",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"safe-buffer": "~5.1.0"
|
"safe-buffer": "~5.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/string-argv": {
|
"node_modules/string-argv": {
|
||||||
@ -3548,9 +3642,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ts-node/node_modules/acorn": {
|
"node_modules/ts-node/node_modules/acorn": {
|
||||||
"version": "8.4.1",
|
"version": "8.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz",
|
||||||
"integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==",
|
"integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"acorn": "bin/acorn"
|
"acorn": "bin/acorn"
|
||||||
@ -3782,6 +3876,14 @@
|
|||||||
"node": ">=0.10.0"
|
"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": {
|
"node_modules/which": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
@ -3873,9 +3975,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ws": {
|
"node_modules/ws": {
|
||||||
"version": "7.5.4",
|
"version": "7.5.5",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.4.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz",
|
||||||
"integrity": "sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg==",
|
"integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.3.0"
|
"node": ">=8.3.0"
|
||||||
},
|
},
|
||||||
@ -4026,6 +4128,13 @@
|
|||||||
"ow": "^0.27.0",
|
"ow": "^0.27.0",
|
||||||
"ts-mixer": "^6.0.0",
|
"ts-mixer": "^6.0.0",
|
||||||
"tslib": "^2.3.1"
|
"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": {
|
"@discordjs/collection": {
|
||||||
@ -4057,6 +4166,13 @@
|
|||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"semver": "^7.3.5",
|
"semver": "^7.3.5",
|
||||||
"tar": "^6.1.8"
|
"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": {
|
"@discordjs/opus": {
|
||||||
@ -4081,6 +4197,18 @@
|
|||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"tslib": "^2.3.0"
|
"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": {
|
"@discordjs/voice": {
|
||||||
@ -4106,6 +4234,11 @@
|
|||||||
"node-addon-api": "^3.2.1"
|
"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": {
|
"node-addon-api": {
|
||||||
"version": "3.2.1",
|
"version": "3.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
|
||||||
@ -4236,9 +4369,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "16.7.10",
|
"version": "16.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.10.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz",
|
||||||
"integrity": "sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA=="
|
"integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g=="
|
||||||
},
|
},
|
||||||
"@types/ws": {
|
"@types/ws": {
|
||||||
"version": "7.4.7",
|
"version": "7.4.7",
|
||||||
@ -4249,13 +4382,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@typescript-eslint/eslint-plugin": {
|
"@typescript-eslint/eslint-plugin": {
|
||||||
"version": "4.30.0",
|
"version": "4.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.0.tgz",
|
||||||
"integrity": "sha512-NgAnqk55RQ/SD+tZFD9aPwNSeHmDHHe5rtUyhIq0ZeCWZEvo4DK9rYz7v9HDuQZFvn320Ot+AikaCKMFKLlD0g==",
|
"integrity": "sha512-iPKZTZNavAlOhfF4gymiSuUkgLne/nh5Oz2/mdiUmuZVD42m9PapnCnzjxuDsnpnbH3wT5s2D8bw6S39TC6GNw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@typescript-eslint/experimental-utils": "4.30.0",
|
"@typescript-eslint/experimental-utils": "4.31.0",
|
||||||
"@typescript-eslint/scope-manager": "4.30.0",
|
"@typescript-eslint/scope-manager": "4.31.0",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"functional-red-black-tree": "^1.0.1",
|
"functional-red-black-tree": "^1.0.1",
|
||||||
"regexpp": "^3.1.0",
|
"regexpp": "^3.1.0",
|
||||||
@ -4264,55 +4397,55 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@typescript-eslint/experimental-utils": {
|
"@typescript-eslint/experimental-utils": {
|
||||||
"version": "4.30.0",
|
"version": "4.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.0.tgz",
|
||||||
"integrity": "sha512-K8RNIX9GnBsv5v4TjtwkKtqMSzYpjqAQg/oSphtxf3xxdt6T0owqnpojztjjTcatSteH3hLj3t/kklKx87NPqw==",
|
"integrity": "sha512-Hld+EQiKLMppgKKkdUsLeVIeEOrwKc2G983NmznY/r5/ZtZCDvIOXnXtwqJIgYz/ymsy7n7RGvMyrzf1WaSQrw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/json-schema": "^7.0.7",
|
"@types/json-schema": "^7.0.7",
|
||||||
"@typescript-eslint/scope-manager": "4.30.0",
|
"@typescript-eslint/scope-manager": "4.31.0",
|
||||||
"@typescript-eslint/types": "4.30.0",
|
"@typescript-eslint/types": "4.31.0",
|
||||||
"@typescript-eslint/typescript-estree": "4.30.0",
|
"@typescript-eslint/typescript-estree": "4.31.0",
|
||||||
"eslint-scope": "^5.1.1",
|
"eslint-scope": "^5.1.1",
|
||||||
"eslint-utils": "^3.0.0"
|
"eslint-utils": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@typescript-eslint/parser": {
|
"@typescript-eslint/parser": {
|
||||||
"version": "4.30.0",
|
"version": "4.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.0.tgz",
|
||||||
"integrity": "sha512-HJ0XuluSZSxeboLU7Q2VQ6eLlCwXPBOGnA7CqgBnz2Db3JRQYyBDJgQnop6TZ+rsbSx5gEdWhw4rE4mDa1FnZg==",
|
"integrity": "sha512-oWbzvPh5amMuTmKaf1wp0ySxPt2ZXHnFQBN2Szu1O//7LmOvgaKTCIDNLK2NvzpmVd5A2M/1j/rujBqO37hj3w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@typescript-eslint/scope-manager": "4.30.0",
|
"@typescript-eslint/scope-manager": "4.31.0",
|
||||||
"@typescript-eslint/types": "4.30.0",
|
"@typescript-eslint/types": "4.31.0",
|
||||||
"@typescript-eslint/typescript-estree": "4.30.0",
|
"@typescript-eslint/typescript-estree": "4.31.0",
|
||||||
"debug": "^4.3.1"
|
"debug": "^4.3.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@typescript-eslint/scope-manager": {
|
"@typescript-eslint/scope-manager": {
|
||||||
"version": "4.30.0",
|
"version": "4.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.0.tgz",
|
||||||
"integrity": "sha512-VJ/jAXovxNh7rIXCQbYhkyV2Y3Ac/0cVHP/FruTJSAUUm4Oacmn/nkN5zfWmWFEanN4ggP0vJSHOeajtHq3f8A==",
|
"integrity": "sha512-LJ+xtl34W76JMRLjbaQorhR0hfRAlp3Lscdiz9NeI/8i+q0hdBZ7BsiYieLoYWqy+AnRigaD3hUwPFugSzdocg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@typescript-eslint/types": "4.30.0",
|
"@typescript-eslint/types": "4.31.0",
|
||||||
"@typescript-eslint/visitor-keys": "4.30.0"
|
"@typescript-eslint/visitor-keys": "4.31.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@typescript-eslint/types": {
|
"@typescript-eslint/types": {
|
||||||
"version": "4.30.0",
|
"version": "4.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.0.tgz",
|
||||||
"integrity": "sha512-YKldqbNU9K4WpTNwBqtAerQKLLW/X2A/j4yw92e3ZJYLx+BpKLeheyzoPfzIXHfM8BXfoleTdiYwpsvVPvHrDw==",
|
"integrity": "sha512-9XR5q9mk7DCXgXLS7REIVs+BaAswfdHhx91XqlJklmqWpTALGjygWVIb/UnLh4NWhfwhR5wNe1yTyCInxVhLqQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@typescript-eslint/typescript-estree": {
|
"@typescript-eslint/typescript-estree": {
|
||||||
"version": "4.30.0",
|
"version": "4.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.0.tgz",
|
||||||
"integrity": "sha512-6WN7UFYvykr/U0Qgy4kz48iGPWILvYL34xXJxvDQeiRE018B7POspNRVtAZscWntEPZpFCx4hcz/XBT+erenfg==",
|
"integrity": "sha512-QHl2014t3ptg+xpmOSSPn5hm4mY8D4s97ftzyk9BZ8RxYQ3j73XcwuijnJ9cMa6DO4aLXeo8XS3z1omT9LA/Eg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@typescript-eslint/types": "4.30.0",
|
"@typescript-eslint/types": "4.31.0",
|
||||||
"@typescript-eslint/visitor-keys": "4.30.0",
|
"@typescript-eslint/visitor-keys": "4.31.0",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"globby": "^11.0.3",
|
"globby": "^11.0.3",
|
||||||
"is-glob": "^4.0.1",
|
"is-glob": "^4.0.1",
|
||||||
@ -4321,12 +4454,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@typescript-eslint/visitor-keys": {
|
"@typescript-eslint/visitor-keys": {
|
||||||
"version": "4.30.0",
|
"version": "4.31.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.0.tgz",
|
||||||
"integrity": "sha512-pNaaxDt/Ol/+JZwzP7MqWc8PJQTUhZwoee/PVlQ+iYoYhagccvoHnC9e4l+C/krQYYkENxznhVSDwClIbZVxRw==",
|
"integrity": "sha512-HUcRp2a9I+P21+O21yu3ezv3GEPGjyGiXoEUQwZXjR8UxRApGeLyWH4ZIIUSalE28aG4YsV6GjtaAVB3QKOu0w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@typescript-eslint/types": "4.30.0",
|
"@typescript-eslint/types": "4.31.0",
|
||||||
"eslint-visitor-keys": "^2.0.0"
|
"eslint-visitor-keys": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4357,9 +4490,9 @@
|
|||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"acorn-walk": {
|
"acorn-walk": {
|
||||||
"version": "8.1.1",
|
"version": "8.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
||||||
"integrity": "sha512-FbJdceMlPHEAWJOILDk1fXD8lnTlEIWFkqtfk+MvmL5q/qlHfN7GEHcsFZWt/Tea9jRNPWUZG4G976nqAAmU9w==",
|
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"agent-base": {
|
"agent-base": {
|
||||||
@ -4456,12 +4589,12 @@
|
|||||||
"integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ=="
|
"integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ=="
|
||||||
},
|
},
|
||||||
"are-we-there-yet": {
|
"are-we-there-yet": {
|
||||||
"version": "1.1.5",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz",
|
||||||
"integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
|
"integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"delegates": "^1.0.0",
|
"delegates": "^1.0.0",
|
||||||
"readable-stream": "^2.0.6"
|
"readable-stream": "^3.6.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"arg": {
|
"arg": {
|
||||||
@ -4740,11 +4873,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
||||||
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
|
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
|
||||||
},
|
},
|
||||||
"core-util-is": {
|
|
||||||
"version": "1.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
|
|
||||||
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
|
|
||||||
},
|
|
||||||
"create-require": {
|
"create-require": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
|
||||||
@ -4768,6 +4896,11 @@
|
|||||||
"integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==",
|
"integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==",
|
||||||
"dev": true
|
"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": {
|
"debug": {
|
||||||
"version": "4.3.2",
|
"version": "4.3.2",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
|
||||||
@ -4792,9 +4925,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"deep-is": {
|
"deep-is": {
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
|
||||||
"integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
|
"integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"defer-to-connect": {
|
"defer-to-connect": {
|
||||||
@ -4834,9 +4967,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"discord-api-types": {
|
"discord-api-types": {
|
||||||
"version": "0.22.0",
|
"version": "0.23.1",
|
||||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
|
||||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
|
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ=="
|
||||||
},
|
},
|
||||||
"discord.js": {
|
"discord.js": {
|
||||||
"version": "13.1.0",
|
"version": "13.1.0",
|
||||||
@ -4864,6 +4997,16 @@
|
|||||||
"ts-mixer": "^6.0.0",
|
"ts-mixer": "^6.0.0",
|
||||||
"tslib": "^2.3.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=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -5182,6 +5325,14 @@
|
|||||||
"reusify": "^1.0.4"
|
"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": {
|
"file-entry-cache": {
|
||||||
"version": "6.0.1",
|
"version": "6.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
||||||
@ -5562,11 +5713,6 @@
|
|||||||
"integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==",
|
"integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"isarray": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
|
||||||
},
|
|
||||||
"isexe": {
|
"isexe": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
@ -5806,9 +5952,13 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node-fetch": {
|
"node-fetch": {
|
||||||
"version": "2.6.1",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0.tgz",
|
||||||
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
|
"integrity": "sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==",
|
||||||
|
"requires": {
|
||||||
|
"data-uri-to-buffer": "^3.0.1",
|
||||||
|
"fetch-blob": "^3.1.2"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"nodemon": {
|
"nodemon": {
|
||||||
"version": "2.0.12",
|
"version": "2.0.12",
|
||||||
@ -5881,11 +6031,11 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"npmlog": {
|
"npmlog": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz",
|
||||||
"integrity": "sha512-ftpIiLjerL2tUg3dCqN8pOSoB90gqZlzv/gaZoxHaKjeLClrfJIEQ1Pdxi6qSzflz916Bljdy8dTWQ4J7hAFSQ==",
|
"integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"are-we-there-yet": "^1.1.5",
|
"are-we-there-yet": "^2.0.0",
|
||||||
"console-control-strings": "^1.1.0",
|
"console-control-strings": "^1.1.0",
|
||||||
"gauge": "^3.0.0",
|
"gauge": "^3.0.0",
|
||||||
"set-blocking": "^2.0.0"
|
"set-blocking": "^2.0.0"
|
||||||
@ -6027,9 +6177,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"version": "2.3.2",
|
"version": "2.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.0.tgz",
|
||||||
"integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==",
|
"integrity": "sha512-DsEPLY1dE5HF3BxCRBmD4uYZ+5DCbvatnolqTqcxEgKVZnL2kUfyu7b8pPQ5+hTBkdhU9SLUmK0/pHb07RE4WQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"prettier-linter-helpers": {
|
"prettier-linter-helpers": {
|
||||||
@ -6046,11 +6196,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
|
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
|
||||||
"integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI="
|
"integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI="
|
||||||
},
|
},
|
||||||
"process-nextick-args": {
|
|
||||||
"version": "2.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
|
||||||
},
|
|
||||||
"progress": {
|
"progress": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
||||||
@ -6124,17 +6269,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"readable-stream": {
|
"readable-stream": {
|
||||||
"version": "2.3.7",
|
"version": "3.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
|
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||||
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
|
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"core-util-is": "~1.0.0",
|
"inherits": "^2.0.3",
|
||||||
"inherits": "~2.0.3",
|
"string_decoder": "^1.1.1",
|
||||||
"isarray": "~1.0.0",
|
"util-deprecate": "^1.0.1"
|
||||||
"process-nextick-args": "~2.0.0",
|
|
||||||
"safe-buffer": "~5.1.1",
|
|
||||||
"string_decoder": "~1.1.1",
|
|
||||||
"util-deprecate": "~1.0.1"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"readdirp": {
|
"readdirp": {
|
||||||
@ -6215,9 +6356,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"safe-buffer": {
|
"safe-buffer": {
|
||||||
"version": "5.1.2",
|
"version": "5.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
||||||
},
|
},
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "7.3.5",
|
"version": "7.3.5",
|
||||||
@ -6319,11 +6460,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"string_decoder": {
|
"string_decoder": {
|
||||||
"version": "1.1.1",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"safe-buffer": "~5.1.0"
|
"safe-buffer": "~5.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"string-argv": {
|
"string-argv": {
|
||||||
@ -6534,9 +6675,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"acorn": {
|
"acorn": {
|
||||||
"version": "8.4.1",
|
"version": "8.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz",
|
||||||
"integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==",
|
"integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==",
|
||||||
"dev": true
|
"dev": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6723,6 +6864,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
|
||||||
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY="
|
"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": {
|
"which": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
@ -6798,9 +6944,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ws": {
|
"ws": {
|
||||||
"version": "7.5.4",
|
"version": "7.5.5",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.4.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz",
|
||||||
"integrity": "sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg==",
|
"integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"xdg-basedir": {
|
"xdg-basedir": {
|
||||||
|
20
package.json
20
package.json
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "eximiabots-radiox",
|
"name": "eximiabots-radiox",
|
||||||
"version": "0.3.1",
|
"version": "0.3.8",
|
||||||
"description": "Internet Radio to your Discord guild",
|
"description": "Internet Radio to your Discord guild",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rimraf ./build && tsc",
|
"build": "rimraf ./build && tsc",
|
||||||
"start": "node build/index.js",
|
"start": "node --no-warnings build/index.js",
|
||||||
"start:dev": "npm run build && node build/index.js"
|
"start:dev": "npm run build && node --no-warnings build/index.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -22,18 +22,18 @@
|
|||||||
"@discordjs/opus": "^0.6.0",
|
"@discordjs/opus": "^0.6.0",
|
||||||
"@discordjs/rest": "^0.1.1-canary.0",
|
"@discordjs/rest": "^0.1.1-canary.0",
|
||||||
"@discordjs/voice": "^0.6.0",
|
"@discordjs/voice": "^0.6.0",
|
||||||
"discord-api-types": "^0.22.0",
|
"discord-api-types": "^0.23.1",
|
||||||
"discord.js": "^13.1.0",
|
"discord.js": "^13.1.0",
|
||||||
"dotenv": "^10.0.0",
|
"dotenv": "^10.0.0",
|
||||||
"libsodium-wrappers": "^0.7.9",
|
"libsodium-wrappers": "^0.7.9",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^3.0.0",
|
||||||
"path": "^0.12.7"
|
"path": "^0.12.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^16.7.8",
|
"@types/node": "^16.9.0",
|
||||||
"@types/ws": "^7.4.7",
|
"@types/ws": "^7.4.7",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.29.3",
|
"@typescript-eslint/eslint-plugin": "^4.31.0",
|
||||||
"@typescript-eslint/parser": "^4.29.3",
|
"@typescript-eslint/parser": "^4.31.0",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
@ -45,7 +45,7 @@
|
|||||||
"typescript": "^4.4.2"
|
"typescript": "^4.4.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.6.0",
|
"node": ">=16.8.0",
|
||||||
"npm": ">=7.0.0"
|
"npm": ">=7.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,11 @@ class RadioClient extends Client {
|
|||||||
this.funcs.statisticsUpdate = require("./client/funcs/statisticsUpdate.js");
|
this.funcs.statisticsUpdate = require("./client/funcs/statisticsUpdate.js");
|
||||||
this.funcs.saveState = require("./client/funcs/saveState.js");
|
this.funcs.saveState = require("./client/funcs/saveState.js");
|
||||||
this.funcs.loadState = require("./client/funcs/loadState.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('RadioX ' + this.config.version);
|
||||||
console.log('Internet Radio to your Discord guild');
|
console.log('Internet Radio to your Discord guild');
|
||||||
@ -47,6 +52,9 @@ class RadioClient extends Client {
|
|||||||
|
|
||||||
this.funcs.logger("Bot", "Starting");
|
this.funcs.logger("Bot", "Starting");
|
||||||
|
|
||||||
|
this.funcs.logger("Maintenance Mode", "Enabled");
|
||||||
|
this.config.maintenance = true;
|
||||||
|
|
||||||
const commandFiles = fs.readdirSync(path.join("./src/client/commands")).filter(f => f.endsWith(".js"));
|
const commandFiles = fs.readdirSync(path.join("./src/client/commands")).filter(f => f.endsWith(".js"));
|
||||||
for (const file of commandFiles) {
|
for (const file of commandFiles) {
|
||||||
const command = require(`./client/commands/${file}`);
|
const command = require(`./client/commands/${file}`);
|
||||||
@ -68,11 +76,17 @@ class RadioClient extends Client {
|
|||||||
this.on("interactionCreate", interaction => {
|
this.on("interactionCreate", interaction => {
|
||||||
require(`${events}interactionCreate`).execute(this, interaction);
|
require(`${events}interactionCreate`).execute(this, interaction);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on("voiceStateUpdate", (oldState, newState) => {
|
this.on("voiceStateUpdate", (oldState, newState) => {
|
||||||
require(`${events}voiceStateUpdate`).execute(this, 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', () => {
|
process.on('SIGINT', () => {
|
||||||
require(`${events}SIGINT`).execute(this);
|
require(`${events}SIGINT`).execute(this);
|
||||||
});
|
});
|
||||||
@ -80,13 +94,25 @@ class RadioClient extends Client {
|
|||||||
process.on('SIGTERM', () => {
|
process.on('SIGTERM', () => {
|
||||||
require(`${events}SIGTERM`).execute(this);
|
require(`${events}SIGTERM`).execute(this);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on("error", error => {
|
process.on('uncaughtException', (error) => {
|
||||||
console.error(error);
|
require(`${events}uncaughtException`).execute(this, error);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.login(this.config.token).catch(err => console.log("Failed to login: " + err));
|
process.on('exit', () => {
|
||||||
|
this.funcs.logger("Bot", "Stopping");
|
||||||
|
});
|
||||||
|
|
||||||
|
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
|
||||||
|
@ -15,11 +15,12 @@ module.exports = {
|
|||||||
command.data = new SlashCommandBuilder()
|
command.data = new SlashCommandBuilder()
|
||||||
.setName(command.name)
|
.setName(command.name)
|
||||||
.setDescription(command.description);
|
.setDescription(command.description);
|
||||||
|
|
||||||
command.data = command.data.toJSON();
|
command.data = command.data.toJSON();
|
||||||
if(command.options) {
|
if(command.options) {
|
||||||
command.options.forEach(function(option) {
|
command.options.forEach(function(option) {
|
||||||
if(option.type == "STRING") option.type = 3;
|
if(option.type == "STRING") option.type = 3;
|
||||||
|
if(option.type == "NUMBER") option.type = 10;
|
||||||
command.data.options.push(option);
|
command.data.options.push(option);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -44,16 +45,18 @@ module.exports = {
|
|||||||
try {
|
try {
|
||||||
await rest.put(
|
await rest.put(
|
||||||
Routes.applicationGuildCommands(client.user.id, guild.id),
|
Routes.applicationGuildCommands(client.user.id, guild.id),
|
||||||
{ body: commands },
|
{ body: commands }
|
||||||
);
|
);
|
||||||
|
client.funcs.logger('Slash Commands', 'Guild Applications – Successful' + "\n" + guild.id + " / " + guild.name);
|
||||||
} catch (DiscordAPIError) {
|
} catch (DiscordAPIError) {
|
||||||
|
client.funcs.logger('Slash Commands', 'Guild Applications – Failed' + "\n" + guild.id + " / " + guild.name);
|
||||||
|
if(DiscordAPIError.name != "DiscordAPIError[50001]") console.error(DiscordAPIError.message + "\n\n");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
await rest.put(
|
await rest.put(
|
||||||
Routes.applicationCommands(client.user.id),
|
Routes.applicationCommands(client.user.id),
|
||||||
{ body: commands },
|
{ body: commands }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,4 +67,4 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
|
import Discord from "discord.js";
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'bug',
|
name: 'bug',
|
||||||
alias: 'none',
|
|
||||||
usage: '',
|
|
||||||
description: 'Report a bug',
|
description: 'Report a bug',
|
||||||
permission: 'none',
|
|
||||||
category: 'info',
|
category: 'info',
|
||||||
async execute(interaction, client, Discord, command) {
|
async execute(interaction, client) {
|
||||||
let message = {};
|
let message = {};
|
||||||
|
|
||||||
message.bugTitle = client.messages.bugTitle.replace("%client.user.username%", client.user.username);
|
message.bugTitle = client.messages.bugTitle.replace("%client.user.username%", client.user.username);
|
||||||
message.bugDescription = message.bugDescription.replace("%client.config.supportGuild%", client.config.supportGuild);
|
message.bugDescription = client.messages.bugDescription.replace("%client.config.supportGuild%", client.config.supportGuild);
|
||||||
|
|
||||||
const embed = new Discord.MessageEmbed()
|
const embed = new Discord.MessageEmbed()
|
||||||
.setTitle(message.bugTitle)
|
.setTitle(message.bugTitle)
|
||||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
|
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
|
||||||
.setColor(client.config.embedColor)
|
.setColor(client.config.embedColor)
|
||||||
.setDescription(message.bugDescription)
|
.setDescription(message.bugDescription)
|
||||||
|
.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, ''));
|
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
||||||
|
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
@ -23,4 +23,4 @@ module.exports = {
|
|||||||
ephemeral: true
|
ephemeral: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
|
import Discord from "discord.js";
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'help',
|
name: 'help',
|
||||||
alias: 'h',
|
|
||||||
usage: '<command(opt)>',
|
|
||||||
description: 'Get help using bot',
|
description: 'Get help using bot',
|
||||||
permission: 'none',
|
|
||||||
category: 'info',
|
category: 'info',
|
||||||
execute(interaction, client, Discord, command) {
|
execute(interaction, client) {
|
||||||
let message = {};
|
let message = {};
|
||||||
|
|
||||||
const categories = [];
|
const categories = [];
|
||||||
@ -25,8 +24,9 @@ module.exports = {
|
|||||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
|
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
|
||||||
.setColor(client.config.embedColor)
|
.setColor(client.config.embedColor)
|
||||||
.setDescription(message.helpDescription)
|
.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, ''));
|
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
||||||
|
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
embeds: [embed],
|
embeds: [embed],
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
|
import Discord from "discord.js";
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'invite',
|
name: 'invite',
|
||||||
alias: 'i',
|
|
||||||
usage: '',
|
|
||||||
description: 'Invite Bot',
|
description: 'Invite Bot',
|
||||||
permission: 'none',
|
|
||||||
category: 'info',
|
category: 'info',
|
||||||
execute(interaction, client, Discord, command) {
|
execute(interaction, client) {
|
||||||
let message = {};
|
let message = {};
|
||||||
message.inviteTitle = client.messages.inviteTitle.replace("%client.user.username%", client.user.username);
|
message.inviteTitle = client.messages.inviteTitle.replace("%client.user.username%", client.user.username);
|
||||||
const embed = new Discord.MessageEmbed()
|
const embed = new Discord.MessageEmbed()
|
||||||
.setTitle(message.inviteTitle)
|
.setTitle(message.inviteTitle)
|
||||||
.setColor(client.config.embedColor)
|
.setColor(client.config.embedColor)
|
||||||
.setURL("https://discord.com/api/oauth2/authorize?client_id=" + client.user.id + "&permissions=2184465408&scope=applications.commands%20bot") //View Channels, Send Messages, Embed Links, Use External Emojis, Use Slash Commands, Connect, Speak, Use Voice Activity
|
.setURL("https://discord.com/api/oauth2/authorize?client_id=" + client.user.id + "&permissions=2184465408&scope=applications.commands%20bot") //View Channels, Send Messages, Embed Links, Use External Emojis, Use Slash Commands, Connect, Speak, Use Voice Activity
|
||||||
|
.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, ''));
|
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
||||||
|
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
@ -19,4 +19,4 @@ module.exports = {
|
|||||||
ephemeral: true
|
ephemeral: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,63 +1,24 @@
|
|||||||
|
import Discord from "discord.js";
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'list',
|
name: 'list',
|
||||||
alias: 'l',
|
|
||||||
usage: '',
|
|
||||||
description: 'List radio stations',
|
description: 'List radio stations',
|
||||||
permission: 'none',
|
|
||||||
category: 'radio',
|
category: 'radio',
|
||||||
execute(interaction, client, Discord, command) {
|
execute(interaction, client) {
|
||||||
let message = {};
|
let message = {};
|
||||||
|
|
||||||
if(!client.stations) {
|
if(!client.stations) {
|
||||||
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
||||||
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
|
return interaction.reply({
|
||||||
}
|
content: client.messageEmojis["error"] + message.errorToGetPlaylist,
|
||||||
|
|
||||||
const radio = client.radio.get(interaction.guild.id);
|
|
||||||
|
|
||||||
if(radio){
|
|
||||||
let menu = [];
|
|
||||||
|
|
||||||
let stations = new Array();
|
|
||||||
|
|
||||||
let options = new Array();
|
|
||||||
options[1] = new Array();
|
|
||||||
options[2] = new Array();
|
|
||||||
|
|
||||||
stations[1] = client.stations.slice(0,24).forEach(station => {
|
|
||||||
station = {
|
|
||||||
label: station.name,
|
|
||||||
description: station.owner,
|
|
||||||
value: station.name
|
|
||||||
};
|
|
||||||
options[1].push(station);
|
|
||||||
});
|
|
||||||
|
|
||||||
stations[2] = client.stations.slice(25).forEach(station => {
|
|
||||||
station = {
|
|
||||||
label: station.name,
|
|
||||||
description: station.owner,
|
|
||||||
value: station.name
|
|
||||||
};
|
|
||||||
options[2].push(station);
|
|
||||||
});
|
|
||||||
|
|
||||||
menu = new Discord.MessageActionRow()
|
|
||||||
.addComponents(
|
|
||||||
new Discord.MessageSelectMenu()
|
|
||||||
.setCustomId('play')
|
|
||||||
.setPlaceholder('Change station')
|
|
||||||
.addOptions(options[1])
|
|
||||||
.addOptions(options[2])
|
|
||||||
);
|
|
||||||
|
|
||||||
stations = null;
|
|
||||||
options = null;
|
|
||||||
|
|
||||||
interaction.reply({
|
|
||||||
content: '**Select station:**',
|
|
||||||
components: [menu],
|
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const radio = client.radio.get(interaction.guild.id);
|
||||||
|
|
||||||
|
if(radio && !client.config.maintenance){
|
||||||
|
client.funcs.listStations(client, interaction);
|
||||||
} else {
|
} else {
|
||||||
let stations = `${client.stations.map(s => `**#** ${s.name}`).join('\n')}`
|
let stations = `${client.stations.map(s => `**#** ${s.name}`).join('\n')}`
|
||||||
const hashs = stations.split('**#**').length;
|
const hashs = stations.split('**#**').length;
|
||||||
@ -70,6 +31,7 @@ module.exports = {
|
|||||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["list"].replace(/[^0-9]+/g, ''))
|
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["list"].replace(/[^0-9]+/g, ''))
|
||||||
.setColor(client.config.embedColor)
|
.setColor(client.config.embedColor)
|
||||||
.setDescription(stations)
|
.setDescription(stations)
|
||||||
|
.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, ''));
|
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
||||||
|
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
@ -78,4 +40,4 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,51 +1,141 @@
|
|||||||
|
import Discord from "discord.js";
|
||||||
|
const _importDynamic = new Function('modulePath', 'return import(modulePath)');
|
||||||
|
const fetch = (...args) => _importDynamic('node-fetch').then(({default: fetch}) => fetch(...args));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'maintenance',
|
name: 'maintenance',
|
||||||
alias: 'm',
|
|
||||||
usage: '',
|
|
||||||
description: 'Bot Maintenance',
|
description: 'Bot Maintenance',
|
||||||
permission: 'none',
|
|
||||||
category: 'info',
|
category: 'info',
|
||||||
execute(interaction, client, Discord, command) {
|
options: [
|
||||||
|
{ type: "NUMBER", name: "action", description: "Select action", required: false}
|
||||||
|
],
|
||||||
|
async execute(interaction, client) {
|
||||||
let message = {};
|
let message = {};
|
||||||
|
|
||||||
if(!client.funcs.isDev(client.config.devId, interaction.user.id)) return interaction.reply(client.messageEmojis["error"] + client.messages.notAllowed);
|
if(!client.funcs.isDev(client.config.devId, interaction.user.id)) return interaction.reply({
|
||||||
|
content: client.messageEmojis["error"] + client.messages.notAllowed,
|
||||||
if(!client.stations) {
|
ephemeral: true
|
||||||
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
});
|
||||||
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
|
let action = interaction.options?.getNumber("action") ?? interaction.values?.[0];
|
||||||
}
|
const options = new Array(
|
||||||
|
{
|
||||||
let currentRadios = client.radio.keys();
|
emoji: "🌀",
|
||||||
let radio = currentRadios.next();
|
label: "Restart Bot",
|
||||||
let stoppedRadios = "";
|
description: "",
|
||||||
|
value: "0"
|
||||||
client.user.setStatus('dnd');
|
},
|
||||||
|
{
|
||||||
while (!radio.done) {
|
emoji: "<:RadioXStop:688541155377414168>",
|
||||||
let currentRadio = client.radio.get(radio.value);
|
label: "Save Radios",
|
||||||
currentRadio.guild = client.datastore.getEntry(radio.value).guild;
|
description: "",
|
||||||
|
value: "4"
|
||||||
if(currentRadio){
|
},
|
||||||
client.funcs.statisticsUpdate(client, currentRadio.guild, currentRadio);
|
{
|
||||||
currentRadio.connection?.destroy();
|
emoji: "<:RadioXPlay:688541155712827458>",
|
||||||
currentRadio.audioPlayer?.stop();
|
label: "Restore Radios",
|
||||||
currentRadio.message?.delete();
|
description: "",
|
||||||
client.radio.delete(radio.value);
|
value: "5"
|
||||||
stoppedRadios += "-" + radio.value + ": " + currentRadio.guild.name + "\n";
|
},
|
||||||
|
{
|
||||||
|
emoji: "#️⃣",
|
||||||
|
label: "Reload Commands",
|
||||||
|
description: "",
|
||||||
|
value: "6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
emoji: "<:RadioXList:688541155519889482>",
|
||||||
|
label: "Reload Stations",
|
||||||
|
description: "",
|
||||||
|
value: "7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
emoji: "<:dnd:746069698139127831>",
|
||||||
|
label: "Enable Maintenance Mode",
|
||||||
|
description: "",
|
||||||
|
value: "8"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
emoji: "<:online:746069731836035098>",
|
||||||
|
label: "Disable Maintenance Mode",
|
||||||
|
description: "",
|
||||||
|
value: "9"
|
||||||
}
|
}
|
||||||
radio = currentRadios.next();
|
);
|
||||||
|
|
||||||
|
const menu = new Discord.MessageActionRow()
|
||||||
|
.addComponents(
|
||||||
|
new Discord.MessageSelectMenu()
|
||||||
|
.setCustomId('maintenance')
|
||||||
|
.setPlaceholder('Select action')
|
||||||
|
.addOptions(options)
|
||||||
|
);
|
||||||
|
|
||||||
|
if(!action){
|
||||||
|
return interaction.reply({
|
||||||
|
content: "**" + client.messages.maintenanceTitle + "**",
|
||||||
|
components: [menu],
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
client.funcs.logger('Maintenance', options.find(option => option.value == action).label);
|
||||||
|
|
||||||
const embed = new Discord.MessageEmbed()
|
const embed = new Discord.MessageEmbed()
|
||||||
.setTitle(client.messages.maintenanceTitle)
|
.setTitle(client.messages.maintenanceTitle)
|
||||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["maintenance"].replace(/[^0-9]+/g, ''))
|
.setColor(client.config.embedColor)
|
||||||
.setColor(client.config.embedColor)
|
.setDescription(options.find(option => option.value == action).label)
|
||||||
.setDescription("Stopped all radios" + "\n" + stoppedRadios)
|
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
||||||
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
|
||||||
|
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
embeds: [embed],
|
embeds: [embed],
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
switch(action){
|
||||||
|
case "0":
|
||||||
|
process.emit('SIGINT');
|
||||||
|
break;
|
||||||
|
case "4":
|
||||||
|
client.user.setStatus('idle');
|
||||||
|
client.funcs.saveRadios(client);
|
||||||
|
client.user.setStatus('online');
|
||||||
|
break;
|
||||||
|
case "5":
|
||||||
|
client.user.setStatus('idle');
|
||||||
|
let guilds = await client.guilds.fetch();
|
||||||
|
client.funcs.restoreRadios(client, guilds);
|
||||||
|
client.user.setStatus('online');
|
||||||
|
break;
|
||||||
|
case "6":
|
||||||
|
client.user.setStatus('idle');
|
||||||
|
require(`../commands.js`).execute(client);
|
||||||
|
client.user.setStatus('online');
|
||||||
|
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');
|
||||||
|
} catch (error) {
|
||||||
|
client.funcs.logger('Stations', 'Fetching list failed');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "8":
|
||||||
|
client.user.setStatus('dnd');
|
||||||
|
client.funcs.logger("Maintenance Mode", "Enabled");
|
||||||
|
client.config.maintenance = false;
|
||||||
|
break;
|
||||||
|
case "9":
|
||||||
|
client.user.setStatus('online');
|
||||||
|
client.funcs.logger("Maintenance Mode", "Disabled");
|
||||||
|
client.config.maintenance = false;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
39
src/client/commands/next.js
Normal file
39
src/client/commands/next.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
module.exports = {
|
||||||
|
name: 'next',
|
||||||
|
description: 'Next Station',
|
||||||
|
category: 'radio',
|
||||||
|
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;
|
||||||
|
|
||||||
|
let station = client.stations[index];
|
||||||
|
|
||||||
|
if(!station) return interaction.reply({
|
||||||
|
content: client.messageEmojis["error"] + client.messages.noSearchResults,
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
|
|
||||||
|
let url = station.stream[station.stream.default];
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
if(interaction.isButton()) {
|
||||||
|
interaction.deferUpdate();
|
||||||
|
client.funcs.play(null, interaction.guild, client, url);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,38 +1,35 @@
|
|||||||
|
import Discord from "discord.js";
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'nowplaying',
|
name: 'nowplaying',
|
||||||
alias: 'np',
|
|
||||||
usage: '',
|
|
||||||
description: 'Current Radio Station',
|
description: 'Current Radio Station',
|
||||||
permission: 'none',
|
|
||||||
category: 'radio',
|
category: 'radio',
|
||||||
async execute(interaction, client, Discord, command) {
|
async execute(interaction, client, command) {
|
||||||
let message = {};
|
if (client.funcs.check(client, interaction, command)) {
|
||||||
const radio = client.radio.get(interaction.guild.id);
|
let message = {};
|
||||||
if (!radio) return interaction.reply('There is nothing playing.');
|
const radio = client.radio.get(interaction.guild.id);
|
||||||
if(!client.stations) {
|
|
||||||
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
let date = new Date();
|
||||||
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
|
radio.currentTime = date.getTime();
|
||||||
|
radio.playTime = parseInt(radio.currentTime)-parseInt(radio.startTime);
|
||||||
|
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("%client.funcs.msToTime(completed)%", client.funcs.msToTime(completed));
|
||||||
|
|
||||||
|
const embed = new Discord.MessageEmbed()
|
||||||
|
.setTitle(client.messages.nowplayingTitle)
|
||||||
|
.setThumbnail((radio.station.logo || "https://cdn.discordapp.com/emojis/" + client.messageEmojis["play"].replace(/[^0-9]+/g, '')))
|
||||||
|
.setColor(client.config.embedColor)
|
||||||
|
.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
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let date = new Date();
|
|
||||||
radio.currentTime = date.getTime();
|
|
||||||
radio.playTime = parseInt(radio.currentTime)-parseInt(radio.startTime);
|
|
||||||
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("%client.funcs.msToTime(completed)%", client.funcs.msToTime(completed));
|
|
||||||
|
|
||||||
const embed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(client.messages.nowplayingTitle)
|
|
||||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["play"].replace(/[^0-9]+/g, ''))
|
|
||||||
.setColor(client.config.embedColor)
|
|
||||||
.setDescription(message.nowplayingDescription)
|
|
||||||
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
|
||||||
|
|
||||||
interaction.reply({
|
|
||||||
embeds: [embed],
|
|
||||||
ephemeral: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,104 +1,69 @@
|
|||||||
const {
|
const {
|
||||||
createAudioPlayer,
|
createAudioPlayer,
|
||||||
createAudioResource,
|
|
||||||
getVoiceConnection,
|
getVoiceConnection,
|
||||||
joinVoiceChannel
|
joinVoiceChannel
|
||||||
} = require("@discordjs/voice");
|
} = require("@discordjs/voice");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: "play",
|
name: "play",
|
||||||
alias: "p",
|
|
||||||
usage: "<song name>",
|
usage: "<song name>",
|
||||||
description: "Play radio",
|
description: "Play radio",
|
||||||
options: [
|
options: [
|
||||||
{ type: "STRING", name: "query", description: "Select station", required: false}
|
{ type: "STRING", name: "query", description: "Select station", required: false}
|
||||||
],
|
],
|
||||||
permission: "none",
|
|
||||||
category: "radio",
|
category: "radio",
|
||||||
async execute(interaction, client, Discord, command) {
|
async execute(interaction, client) {
|
||||||
let message = {};
|
let message = {};
|
||||||
let query = interaction.options?.getString("query") ?? interaction.values?.[0];
|
|
||||||
if(!query){
|
|
||||||
if(!client.stations) {
|
|
||||||
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
|
||||||
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
|
|
||||||
}
|
|
||||||
|
|
||||||
let stations = new Array();
|
if(client.config.maintenance){
|
||||||
|
interaction.reply({
|
||||||
let options = new Array();
|
content: client.messageEmojis["error"] + client.messages.maintenance,
|
||||||
options[1] = new Array();
|
|
||||||
options[2] = new Array();
|
|
||||||
|
|
||||||
stations[1] = client.stations.slice(0,24).forEach(station => {
|
|
||||||
station = {
|
|
||||||
label: station.name,
|
|
||||||
description: station.owner,
|
|
||||||
value: station.name
|
|
||||||
};
|
|
||||||
options[1].push(station);
|
|
||||||
});
|
|
||||||
|
|
||||||
stations[2] = client.stations.slice(25).forEach(station => {
|
|
||||||
station = {
|
|
||||||
label: station.name,
|
|
||||||
description: station.owner,
|
|
||||||
value: station.name
|
|
||||||
};
|
|
||||||
options[2].push(station);
|
|
||||||
});
|
|
||||||
|
|
||||||
const menu = new Discord.MessageActionRow()
|
|
||||||
.addComponents(
|
|
||||||
new Discord.MessageSelectMenu()
|
|
||||||
.setCustomId('play')
|
|
||||||
.setPlaceholder('Nothing selected')
|
|
||||||
.addOptions(options[1])
|
|
||||||
.addOptions(options[2])
|
|
||||||
);
|
|
||||||
|
|
||||||
stations = null;
|
|
||||||
options = null;
|
|
||||||
|
|
||||||
return interaction.reply({
|
|
||||||
content: '**Select station:**',
|
|
||||||
components: [menu],
|
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
});
|
});
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
let url = query ? query.replace(/<(.+)>/g, "$1") : "";
|
|
||||||
const radio = client.radio.get(interaction.guild.id);
|
if(!client.stations) {
|
||||||
const voiceChannel = interaction.member.voice.channel;
|
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
||||||
if (!radio) {
|
|
||||||
if (!interaction.member.voice.channel)
|
|
||||||
return interaction.reply({
|
|
||||||
content: client.messageEmojis["error"] + client.messages.noVoiceChannel,
|
|
||||||
ephemeral: true
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (voiceChannel !== radio.voiceChannel)
|
|
||||||
return interaction.reply({
|
|
||||||
content: client.messageEmojis["error"] + client.messages.wrongVoiceChannel,
|
|
||||||
ephemeral: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (!client.stations) {
|
|
||||||
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace(
|
|
||||||
"%client.config.supportGuild%",
|
|
||||||
client.config.supportGuild
|
|
||||||
);
|
|
||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
content: client.messageEmojis["error"] + message.errorToGetPlaylist,
|
content: client.messageEmojis["error"] + message.errorToGetPlaylist,
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!query) return interaction.reply(client.messages.noQuery);
|
|
||||||
|
let query = interaction.options?.getString("query") ?? interaction.values?.[0];
|
||||||
|
if(!query){
|
||||||
|
return client.funcs.listStations(client, interaction);
|
||||||
|
}
|
||||||
|
let url = query ? query.replace(/<(.+)>/g, "$1") : "";
|
||||||
|
const radio = client.radio.get(interaction.guild.id);
|
||||||
|
const voiceChannel = interaction.member.voice.channel;
|
||||||
|
if (!voiceChannel) return interaction.reply({
|
||||||
|
content: client.messageEmojis["error"] + client.messages.noVoiceChannel,
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
|
if (radio) {
|
||||||
|
if (voiceChannel !== radio.voiceChannel) return interaction.reply({
|
||||||
|
content: client.messageEmojis["error"] + client.messages.wrongVoiceChannel,
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!query) return interaction.reply({
|
||||||
|
content: client.messages.noQuery,
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
const permissions = voiceChannel.permissionsFor(interaction.client.user);
|
const permissions = voiceChannel.permissionsFor(interaction.client.user);
|
||||||
if (!permissions.has("CONNECT")) {
|
if (!permissions.has("CONNECT")) {
|
||||||
return interaction.reply(client.messageEmojis["error"] + client.messages.noPermsConnect);
|
return interaction.reply({
|
||||||
|
content: client.messageEmojis["error"] + client.messages.noPermsConnect,
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (!permissions.has("SPEAK")) {
|
if (!permissions.has("SPEAK")) {
|
||||||
return interaction.reply(client.messageEmojis["error"] + client.messages.noPermsSpeak);
|
return interaction.reply({
|
||||||
|
content: client.messageEmojis["error"] + client.messages.noPermsSpeak,
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
let station;
|
let station;
|
||||||
const number = parseInt(query - 1);
|
const number = parseInt(query - 1);
|
||||||
@ -118,17 +83,15 @@ module.exports = {
|
|||||||
station = client.stations[number];
|
station = client.stations[number];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (query.length < 3)
|
if (query.length < 3) return interaction.reply({
|
||||||
return interaction.reply({
|
content: client.messageEmojis["error"] + client.messages.tooShortSearch,
|
||||||
content: client.messageEmojis["error"] + client.messages.tooShortSearch,
|
ephemeral: true
|
||||||
ephemeral: true
|
});
|
||||||
});
|
const sstation = await client.funcs.searchStation(query, client);
|
||||||
const sstation = await searchStation(query, client);
|
if (!sstation) return interaction.reply({
|
||||||
if (!sstation)
|
content: client.messageEmojis["error"] + client.messages.noSearchResults,
|
||||||
return interaction.reply({
|
ephemeral: true
|
||||||
content: client.messageEmojis["error"] + client.messages.noSearchResults,
|
});
|
||||||
ephemeral: true
|
|
||||||
});
|
|
||||||
url = sstation.stream[sstation.stream.default];
|
url = sstation.stream[sstation.stream.default];
|
||||||
station = sstation;
|
station = sstation;
|
||||||
}
|
}
|
||||||
@ -136,12 +99,12 @@ module.exports = {
|
|||||||
if (radio) {
|
if (radio) {
|
||||||
client.funcs.statisticsUpdate(client, interaction.guild, radio);
|
client.funcs.statisticsUpdate(client, interaction.guild, radio);
|
||||||
radio.audioPlayer.stop();
|
radio.audioPlayer.stop();
|
||||||
|
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
radio.station = station;
|
radio.station = station;
|
||||||
radio.textChannel = interaction.channel;
|
radio.textChannel = interaction.channel;
|
||||||
radio.startTime = date.getTime();
|
radio.startTime = date.getTime();
|
||||||
play(interaction, interaction.guild, client, url, Discord);
|
client.funcs.play(interaction, interaction.guild, client, url);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -167,7 +130,7 @@ module.exports = {
|
|||||||
construct.connection = connection;
|
construct.connection = connection;
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
construct.startTime = date.getTime();
|
construct.startTime = date.getTime();
|
||||||
play(interaction, interaction.guild, client, url, Discord);
|
client.funcs.play(interaction, interaction.guild, client, url);
|
||||||
|
|
||||||
client.datastore.checkEntry(interaction.guild.id);
|
client.datastore.checkEntry(interaction.guild.id);
|
||||||
construct.currentGuild = client.datastore.getEntry(interaction.guild.id);
|
construct.currentGuild = client.datastore.getEntry(interaction.guild.id);
|
||||||
@ -181,160 +144,10 @@ module.exports = {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
client.radio.delete(interaction.guild.id);
|
client.radio.delete(interaction.guild.id);
|
||||||
return interaction.reply(client.messageEmojis["error"] + `An error occured: ${error}`);
|
return interaction.reply({
|
||||||
|
content: client.messageEmojis["error"] + `An error occured: ${error}`,
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
async function play(interaction, guild, client, url, Discord) {
|
|
||||||
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(client.messages.errorPlaying);
|
|
||||||
});
|
|
||||||
|
|
||||||
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("%client.funcs.msToTime(completed)%", "");
|
|
||||||
message.nowplayingDescription = message.nowplayingDescription.replace("Owner: ", "");
|
|
||||||
message.nowplayingDescription = message.nowplayingDescription.replace("**", "");
|
|
||||||
message.nowplayingDescription = message.nowplayingDescription.replace("**", "");
|
|
||||||
|
|
||||||
const embed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(client.user.username)
|
|
||||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["play"].replace(/[^0-9]+/g, ''))
|
|
||||||
.setColor(client.config.embedColor)
|
|
||||||
.addField(client.messages.nowplayingTitle, message.nowplayingDescription, true)
|
|
||||||
.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()
|
|
||||||
.setCustomId('list')
|
|
||||||
.setEmoji(client.messageEmojis["list"])
|
|
||||||
.setStyle('SECONDARY')
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new Discord.MessageButton()
|
|
||||||
.setCustomId('prev')
|
|
||||||
.setEmoji(client.messageEmojis["prev"])
|
|
||||||
.setStyle('SECONDARY')
|
|
||||||
.setDisabled(true)
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new Discord.MessageButton()
|
|
||||||
.setCustomId('stop')
|
|
||||||
.setEmoji(client.messageEmojis["stop"])
|
|
||||||
.setStyle('SECONDARY')
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new Discord.MessageButton()
|
|
||||||
.setCustomId('next')
|
|
||||||
.setEmoji(client.messageEmojis["next"])
|
|
||||||
.setStyle('SECONDARY')
|
|
||||||
.setDisabled(true)
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new Discord.MessageButton()
|
|
||||||
.setCustomId('statistics')
|
|
||||||
.setEmoji(client.messageEmojis["statistics"])
|
|
||||||
.setStyle('SECONDARY')
|
|
||||||
);
|
|
||||||
|
|
||||||
if(!radio.message){
|
|
||||||
radio.message = await radio.textChannel.send({ embeds: [embed], components: [buttons] });
|
|
||||||
} else {
|
|
||||||
radio.message.edit({ 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
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
39
src/client/commands/prev.js
Normal file
39
src/client/commands/prev.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
module.exports = {
|
||||||
|
name: 'prev',
|
||||||
|
description: 'Previous Station',
|
||||||
|
category: 'radio',
|
||||||
|
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 == -1) index = client.stations.length - 1;
|
||||||
|
|
||||||
|
let station = client.stations[index];
|
||||||
|
|
||||||
|
if(!station) return interaction.reply({
|
||||||
|
content: client.messageEmojis["error"] + client.messages.noSearchResults,
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
|
|
||||||
|
let url = station.stream[station.stream.default];
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
if(interaction.isButton()) {
|
||||||
|
interaction.deferUpdate();
|
||||||
|
client.funcs.play(null, interaction.guild, client, url);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,38 +1,47 @@
|
|||||||
|
import Discord from "discord.js";
|
||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'statistics',
|
name: 'statistics',
|
||||||
alias: 'stats',
|
|
||||||
usage: '',
|
|
||||||
description: 'Show statistics',
|
description: 'Show statistics',
|
||||||
permission: 'none',
|
|
||||||
category: 'info',
|
category: 'info',
|
||||||
execute(interaction, client, Discord, command) {
|
execute(interaction, client) {
|
||||||
let message = {};
|
let message = {};
|
||||||
let stations = client.stations;
|
let stations = client.stations;
|
||||||
let currentGuild = client.datastore.getEntry(interaction.guild.id);
|
let currentGuild = client.datastore.getEntry(interaction.guild.id);
|
||||||
|
let global = client.datastore.getEntry("global");
|
||||||
let statistics = "";
|
let statistics = "";
|
||||||
|
|
||||||
if(!client.stations) {
|
if(!client.stations) {
|
||||||
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
||||||
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
|
return interaction.reply({
|
||||||
|
content: client.messageEmojis["error"] + message.errorToGetPlaylist,
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!currentGuild || currentGuild && !currentGuild.statistics){
|
if(!currentGuild || currentGuild && !currentGuild.statistics){
|
||||||
statistics = "You have not listened any radio station";
|
statistics = "You have not listened any radio stations";
|
||||||
} else {
|
} else {
|
||||||
Object.keys(stations).forEach(function(station) {
|
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(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){
|
||||||
statistics += `**${parseInt(station) + 1}** ` + stations[station].name + " \n";
|
statistics += `**${parseInt(station) + 1}. ` + stations[station].name + "** \n";
|
||||||
statistics += "Time: " + client.funcs.msToTime(currentGuild.statistics[stations[station].name].time) + "\n";
|
if(global && global.statistics[stations[station].name] && global.statistics[stations[station].name].time && parseInt(global.statistics[stations[station].name].time) > 0 && global.statistics[stations[station].name].used && parseInt(global.statistics[stations[station].name].used) > 0){
|
||||||
statistics += "Used: " + currentGuild.statistics[stations[station].name].used + "\n";
|
statistics += "Guild – Time: " + client.funcs.msToTime(currentGuild.statistics[stations[station].name].time) + " (" + ((currentGuild.statistics[stations[station].name].time / global.statistics[stations[station].name].time) * 100).toFixed(0) + "%" + ")" + " / " + "Used: " + currentGuild.statistics[stations[station].name].used + " (" + ((currentGuild.statistics[stations[station].name].used / global.statistics[stations[station].name].used) * 100).toFixed(0) + "%" + ")" + "\n";
|
||||||
|
statistics += "Global – Time: " + client.funcs.msToTime(global.statistics[stations[station].name].time) + " / " + "Used: " + global.statistics[stations[station].name].used + "\n\n";
|
||||||
|
} else {
|
||||||
|
statistics += "Time: " + client.funcs.msToTime(currentGuild.statistics[stations[station].name].time) + " / " + "Used: " + currentGuild.statistics[stations[station].name].used + "\n\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const embed = new Discord.MessageEmbed()
|
const embed = new Discord.MessageEmbed()
|
||||||
.setTitle(client.messages.statisticsTitle)
|
.setTitle(client.messages.statisticsTitle)
|
||||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["statistics"].replace(/[^0-9]+/g, ''))
|
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["statistics"].replace(/[^0-9]+/g, ''))
|
||||||
.setColor(client.config.embedColor)
|
.setColor(client.config.embedColor)
|
||||||
.setDescription(statistics)
|
.setDescription(statistics)
|
||||||
|
.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, ''));
|
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
||||||
|
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
@ -40,4 +49,4 @@ module.exports = {
|
|||||||
ephemeral: true
|
ephemeral: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
|
import Discord from "discord.js";
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'status',
|
name: 'status',
|
||||||
alias: 'st',
|
|
||||||
usage: '',
|
|
||||||
description: 'Bot Status',
|
description: 'Bot Status',
|
||||||
permission: 'none',
|
|
||||||
category: 'info',
|
category: 'info',
|
||||||
async execute(interaction, client, Discord, command) {
|
async execute(interaction, client) {
|
||||||
let message = {};
|
let message = {};
|
||||||
|
|
||||||
message.statusTitle = client.messages.statusTitle.replace("%client.user.username%", client.user.username);
|
message.statusTitle = client.messages.statusTitle.replace("%client.user.username%", client.user.username);
|
||||||
@ -20,6 +19,7 @@ module.exports = {
|
|||||||
.addField(client.messages.statusField3, uptime, true)
|
.addField(client.messages.statusField3, uptime, true)
|
||||||
.addField(client.messages.statusField4, client.config.version, true)
|
.addField(client.messages.statusField4, client.config.version, true)
|
||||||
.addField(client.messages.statusField5, client.config.hostedBy, true)
|
.addField(client.messages.statusField5, client.config.hostedBy, 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, ''));
|
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
||||||
|
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
@ -28,4 +28,4 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
|
import Discord from "discord.js";
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'stop',
|
name: 'stop',
|
||||||
description: 'Stop radio',
|
description: 'Stop radio',
|
||||||
alias: 's',
|
|
||||||
usage: '',
|
|
||||||
permission: 'none',
|
|
||||||
category: 'radio',
|
category: 'radio',
|
||||||
async execute(interaction, client, Discord, command) {
|
async execute(interaction, client, command) {
|
||||||
const radio = client.radio.get(interaction.guild.id);
|
|
||||||
if (client.funcs.check(client, interaction, command)) {
|
if (client.funcs.check(client, interaction, command)) {
|
||||||
|
const radio = client.radio.get(interaction.guild.id);
|
||||||
client.funcs.statisticsUpdate(client, interaction.guild, radio);
|
client.funcs.statisticsUpdate(client, interaction.guild, radio);
|
||||||
radio.connection?.destroy();
|
radio.connection?.destroy();
|
||||||
radio.audioPlayer?.stop();
|
radio.audioPlayer?.stop();
|
||||||
@ -18,6 +17,7 @@ module.exports = {
|
|||||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["stop"].replace(/[^0-9]+/g, ''))
|
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["stop"].replace(/[^0-9]+/g, ''))
|
||||||
.setColor(client.config.embedColor)
|
.setColor(client.config.embedColor)
|
||||||
.addField(client.messages.nowplayingTitle, "-", true)
|
.addField(client.messages.nowplayingTitle, "-", 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, ''));
|
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
||||||
|
|
||||||
if(!radio.message){
|
if(!radio.message){
|
||||||
@ -38,4 +38,4 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -6,7 +6,7 @@ module.exports = class {
|
|||||||
this.map = new Map();
|
this.map = new Map();
|
||||||
this.loadData();
|
this.loadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
loadData() {
|
loadData() {
|
||||||
const dir = path.join(path.dirname(__dirname), '../datastore');
|
const dir = path.join(path.dirname(__dirname), '../datastore');
|
||||||
if (!fs.existsSync(dir)) {
|
if (!fs.existsSync(dir)) {
|
||||||
@ -33,7 +33,7 @@ module.exports = class {
|
|||||||
var statistics = {};
|
var statistics = {};
|
||||||
|
|
||||||
if(!client.stations) return;
|
if(!client.stations) return;
|
||||||
|
|
||||||
let calculation = guilds.next();
|
let calculation = guilds.next();
|
||||||
|
|
||||||
while (!calculation.done) {
|
while (!calculation.done) {
|
||||||
@ -47,7 +47,7 @@ module.exports = class {
|
|||||||
statistics[stations[station].name].time = 0;
|
statistics[stations[station].name].time = 0;
|
||||||
statistics[stations[station].name].used = 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].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);
|
statistics[stations[station].name].used = parseInt(statistics[stations[station].name].used)+parseInt(currentGuild.statistics[stations[station].name].used);
|
||||||
}
|
}
|
||||||
@ -84,26 +84,26 @@ module.exports = class {
|
|||||||
this.map.set(id, newData);
|
this.map.set(id, newData);
|
||||||
this.saveEntry(id, newData);
|
this.saveEntry(id, newData);
|
||||||
}
|
}
|
||||||
|
|
||||||
getEntry(id){
|
getEntry(id){
|
||||||
return this.map.get(id);
|
return this.map.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateEntry(guild, newData) {
|
updateEntry(guild, newData) {
|
||||||
newData.guild.name = guild.name;
|
newData.guild.name = guild.name;
|
||||||
|
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
newData.updated = date.toISOString().substring(0, 10)
|
newData.updated = date.toISOString().substring(0, 10)
|
||||||
|
|
||||||
this.map.set(guild.id, newData);
|
this.map.set(guild.id, newData);
|
||||||
this.saveEntry(guild.id, newData);
|
this.saveEntry(guild.id, newData);
|
||||||
//this.showEntry(this.getEntry(guild.id));
|
//this.showEntry(this.getEntry(guild.id));
|
||||||
}
|
}
|
||||||
|
|
||||||
showEntry(data){
|
showEntry(data){
|
||||||
console.log(data);
|
console.log(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
createTestFile () {
|
createTestFile () {
|
||||||
let newData = {
|
let newData = {
|
||||||
"guild": {
|
"guild": {
|
||||||
@ -120,10 +120,10 @@ module.exports = class {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateEntry(newData.guild, newData);
|
this.updateEntry(newData.guild, newData);
|
||||||
}
|
}
|
||||||
|
|
||||||
saveEntry(file, data) {
|
saveEntry(file, data) {
|
||||||
data = JSON.stringify(data, null, 4);
|
data = JSON.stringify(data, null, 4);
|
||||||
|
|
||||||
|
@ -39,4 +39,4 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,43 +1,14 @@
|
|||||||
import Discord from "discord.js";
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'SIGINT',
|
name: 'SIGINT',
|
||||||
async execute(client) {
|
execute(client) {
|
||||||
setTimeout(async function () {
|
client.user.setStatus('dnd');
|
||||||
let message = {};
|
|
||||||
|
|
||||||
if (!client.stations) return process.exit();
|
client.funcs.saveRadios(client);
|
||||||
|
|
||||||
let currentRadios = client.radio.keys();
|
setInterval(() => {
|
||||||
let radio = currentRadios.next();
|
if(client.radio.size == 0){
|
||||||
|
process.exit();
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
}, 500);
|
||||||
console.log("\n");
|
|
||||||
client.funcs.logger("Bot", "Closing");
|
|
||||||
console.log("\n");
|
|
||||||
|
|
||||||
client.user.setStatus('dnd');
|
|
||||||
|
|
||||||
setInterval(() => {
|
|
||||||
if(radio.done){
|
|
||||||
process.exit();
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'SIGTERM',
|
name: 'SIGTERM',
|
||||||
async execute(client) {
|
execute(client) {
|
||||||
process.emit('SIGINT');
|
process.emit('SIGINT');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,22 @@
|
|||||||
import Discord from "discord.js";
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'interactionCreate',
|
name: 'interactionCreate',
|
||||||
async execute(client, interaction) {
|
async execute(client, interaction) {
|
||||||
|
|
||||||
const permissions = interaction.channel.permissionsFor(interaction.client.user);
|
const permissions = interaction.channel.permissionsFor(interaction.client.user);
|
||||||
if (!permissions.has('EMBED_LINKS')) return interaction.send(client.messages.noPermsEmbed);
|
if (!permissions.has('VIEW_CHANNEL')) return;
|
||||||
|
|
||||||
|
if (!permissions.has('EMBED_LINKS')) return interaction.reply({
|
||||||
|
content: client.messages.noPermsEmbed,
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
|
|
||||||
if(interaction.isCommand()){
|
if(interaction.isCommand()){
|
||||||
const commandName = interaction.commandName;
|
const commandName = interaction.commandName;
|
||||||
const command = client.commands.get(commandName);
|
const command = client.commands.get(commandName);
|
||||||
if (!command) return;
|
if (!command) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
command.execute(interaction, client, Discord, command);
|
command.execute(interaction, client);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
content: client.messages.runningCommandFailed,
|
content: client.messages.runningCommandFailed,
|
||||||
@ -27,7 +30,7 @@ module.exports = {
|
|||||||
if (!command) return;
|
if (!command) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
command.execute(interaction, client, Discord, command);
|
command.execute(interaction, client, command);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
content: client.messages.runningCommandFailed,
|
content: client.messages.runningCommandFailed,
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import Discord from "discord.js";
|
import Discord from "discord.js";
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'messageCreate',
|
name: 'messageCreate',
|
||||||
async execute(client, msg) {
|
async execute(client, message) {
|
||||||
|
|
||||||
if (msg.author.bot || !msg.guild) return;
|
if (message.author.bot || !message.guild) return;
|
||||||
let prefix = "rx$";
|
let prefix = "rx$";
|
||||||
if(client.user.username == "RadioX"){
|
if(client.user.username == "RadioX"){
|
||||||
prefix = "rx>";
|
prefix = "rx>";
|
||||||
@ -11,44 +11,48 @@ module.exports = {
|
|||||||
prefix = "rx-";
|
prefix = "rx-";
|
||||||
} else if (client.user.username == "RadioX Dev"){
|
} else if (client.user.username == "RadioX Dev"){
|
||||||
prefix = "rx$";
|
prefix = "rx$";
|
||||||
} else if(msg.mentions.members.first() && msg.mentions.members.first().user.id === client.user.id){
|
} else if(message.mentions.members.first() && message.mentions.members.first().user.id === client.user.id){
|
||||||
prefix = "<@!" + client.user.id + "> ";
|
prefix = "<@!" + client.user.id + "> ";
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const args = msg.content.slice(prefix.length).split(' ');
|
const args = message.content.slice(prefix.length).split(' ');
|
||||||
if (!msg.content.startsWith(prefix)) return;
|
if (!message.content.startsWith(prefix)) return;
|
||||||
if (!args[0]) return;
|
if (!args[0]) return;
|
||||||
const commandName = args[0].toLowerCase();
|
const commandName = args[0].toLowerCase();
|
||||||
if (commandName === 'none') return;
|
if (commandName === 'none') return;
|
||||||
const command = client.commands.get(commandName) || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)) || client.commandAliases.get(commandName);
|
const command = client.commands.get(commandName) || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));
|
||||||
if (!command && msg.content !== `${prefix}`) return;
|
if (!command && message.content !== `${prefix}`) return;
|
||||||
const permissions = msg.channel.permissionsFor(msg.client.user);
|
const permissions = message.channel.permissionsFor(message.client.user);
|
||||||
if (!permissions.has('EMBED_LINKS')) return msg.channel.send(client.messages.noPermsEmbed);
|
if (!permissions.has('EMBED_LINKS')) return message.channel.send(client.messages.noPermsEmbed);
|
||||||
try {
|
try {
|
||||||
let message = {};
|
let newMessage = {};
|
||||||
|
|
||||||
|
newMessage.messageCommandsDeprecatedTitle = client.messages.messageCommandsDeprecatedTitle.replace("%client.user.username%", client.user.username);
|
||||||
|
|
||||||
message.messageCommandsDeprecatedTitle = client.messages.messageCommandsDeprecatedTitle.replace("%client.user.username%", client.user.username);
|
|
||||||
|
|
||||||
const embed = new Discord.MessageEmbed()
|
const embed = new Discord.MessageEmbed()
|
||||||
.setTitle(message.messageCommandsDeprecatedTitle)
|
.setTitle(newMessage.messageCommandsDeprecatedTitle)
|
||||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
|
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
|
||||||
.setColor(client.config.embedColor)
|
.setColor(client.config.embedColor)
|
||||||
.setDescription(client.messages.messageCommandsDeprecatedDescription)
|
.setDescription(client.messages.messageCommandsDeprecatedDescription)
|
||||||
|
.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, ''));
|
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
||||||
|
|
||||||
msg.channel.send({ embeds: [embed] });
|
let msg = await message.channel.send({ embeds: [embed] });
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(async function() {
|
||||||
msg.delete();
|
try {
|
||||||
|
await msg.delete();
|
||||||
|
} catch (DiscordAPIError) {
|
||||||
|
}
|
||||||
}, 30000);
|
}, 30000);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
msg.reply({
|
message.reply({
|
||||||
content: client.messages.runningCommandFailed,
|
content: client.messages.runningCommandFailed,
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
});
|
});
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,4 +7,4 @@ module.exports = {
|
|||||||
if(msg.id != radio.message.id) return;
|
if(msg.id != radio.message.id) return;
|
||||||
radio.message = null;
|
radio.message = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Datastore from "../datastore.js";
|
import Datastore from "../datastore.js";
|
||||||
import fetch from "node-fetch";
|
const _importDynamic = new Function('modulePath', 'return import(modulePath)');
|
||||||
|
const fetch = (...args) => _importDynamic('node-fetch').then(({default: fetch}) => fetch(...args));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'ready',
|
name: 'ready',
|
||||||
@ -11,9 +12,17 @@ module.exports = {
|
|||||||
client.funcs.logger('Datastore', 'Initialize');
|
client.funcs.logger('Datastore', 'Initialize');
|
||||||
client.datastore = new Datastore();
|
client.datastore = new Datastore();
|
||||||
|
|
||||||
|
client.funcs.logger('Datastore');
|
||||||
|
client.datastore.map.forEach(datastore => {
|
||||||
|
console.log("- " + datastore.guild.id + " / " + datastore.guild.name);
|
||||||
|
});
|
||||||
|
console.log("\n");
|
||||||
|
|
||||||
|
client.funcs.logger('Datastore', 'Ready');
|
||||||
|
|
||||||
/*DEVELOPERS*/
|
/*DEVELOPERS*/
|
||||||
client.funcs.logger('Developers');
|
client.funcs.logger('Developers');
|
||||||
|
|
||||||
client.developers = "";
|
client.developers = "";
|
||||||
let user = "";
|
let user = "";
|
||||||
for (let i = 0; i < client.config.devId.length; i++) {
|
for (let i = 0; i < client.config.devId.length; i++) {
|
||||||
@ -45,7 +54,7 @@ module.exports = {
|
|||||||
client.funcs.logger('Stations', 'Fetching list failed');
|
client.funcs.logger('Stations', 'Fetching list failed');
|
||||||
console.error(error + "\n");
|
console.error(error + "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
try {
|
try {
|
||||||
client.funcs.logger('Stations', 'Started fetching list – ' + client.config.stationslistUrl);
|
client.funcs.logger('Stations', 'Started fetching list – ' + client.config.stationslistUrl);
|
||||||
@ -63,19 +72,19 @@ module.exports = {
|
|||||||
if(!client.stations) {
|
if(!client.stations) {
|
||||||
client.user.setStatus('dnd');
|
client.user.setStatus('dnd');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*GUILDS*/
|
/*GUILDS*/
|
||||||
client.funcs.logger('Guilds', 'Started fetching list');
|
client.funcs.logger('Guilds', 'Started fetching list');
|
||||||
|
|
||||||
client.funcs.logger('Guilds');
|
client.funcs.logger('Guilds');
|
||||||
let guilds = await client.guilds.fetch();
|
let guilds = await client.guilds.fetch();
|
||||||
guilds.forEach(guild => {
|
guilds.forEach(guild => {
|
||||||
console.log("- " + guild.id + ": " + guild.name);
|
console.log("- " + guild.id + " / " + guild.name);
|
||||||
});
|
});
|
||||||
console.log("\n");
|
console.log("\n");
|
||||||
|
|
||||||
client.funcs.logger('Guilds', 'Successfully fetched list');
|
client.funcs.logger('Guilds', 'Successfully fetched list');
|
||||||
|
|
||||||
/*STATISTICS*/
|
/*STATISTICS*/
|
||||||
client.datastore.calculateGlobal(client);
|
client.datastore.calculateGlobal(client);
|
||||||
|
|
||||||
@ -86,9 +95,15 @@ module.exports = {
|
|||||||
require(`../commands.js`).execute(client);
|
require(`../commands.js`).execute(client);
|
||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
/*RESTORE RADIO*/
|
/*RESTORE RADIOS*/
|
||||||
require(`../restoreradio.js`).execute(client, guilds);
|
client.funcs.restoreRadios(client, guilds);
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
/*MAINTENANCE MODE*/
|
||||||
|
client.funcs.logger("Maintenance Mode", "Disabled");
|
||||||
|
client.config.maintenance = false;
|
||||||
|
}, 10000);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
src/client/events/uncaughtException.js
Normal file
10
src/client/events/uncaughtException.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
module.exports = {
|
||||||
|
name: 'uncaughtException',
|
||||||
|
execute(client, error) {
|
||||||
|
client.funcs.logger("Error");
|
||||||
|
console.log(error.stack);
|
||||||
|
console.log('');
|
||||||
|
|
||||||
|
process.emit('SIGINT');
|
||||||
|
}
|
||||||
|
}
|
12
src/client/events/warning.js
Normal file
12
src/client/events/warning.js
Normal 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('');
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,21 @@ module.exports = function (client, interaction, command) {
|
|||||||
let message = {};
|
let message = {};
|
||||||
const radio = client.radio.get(interaction.guild.id);
|
const radio = client.radio.get(interaction.guild.id);
|
||||||
const permissions = interaction.channel.permissionsFor(interaction.user);
|
const permissions = interaction.channel.permissionsFor(interaction.user);
|
||||||
|
if(client.config.maintenance){
|
||||||
|
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({
|
||||||
|
content: client.messageEmojis["error"] + message.errorToGetPlaylist,
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!radio) {
|
if (!radio) {
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
content: client.messageEmojis["error"] + client.messages.notPlaying,
|
content: client.messageEmojis["error"] + client.messages.notPlaying,
|
||||||
@ -16,14 +31,6 @@ module.exports = function (client, interaction, command) {
|
|||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(!command.permission == 'none'){
|
|
||||||
if (!permissions.has(command.permission)) {
|
return true;
|
||||||
message.noPerms = client.messages.noPerms.replace("%command.permission%", command.permission);
|
|
||||||
interaction.reply({
|
|
||||||
content: client.messageEmojis["error"] + message.noPerms,
|
|
||||||
ephemeral: true
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
} else return true;
|
|
||||||
} else return true;
|
|
||||||
};
|
};
|
||||||
|
@ -4,4 +4,4 @@ module.exports = function (response) {
|
|||||||
} else {
|
} else {
|
||||||
throw new Error(response.status + " " + response.statusText);
|
throw new Error(response.status + " " + response.statusText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,4 +7,4 @@ module.exports = function (devList, authorID){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
33
src/client/funcs/listStations.js
Normal file
33
src/client/funcs/listStations.js
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import Discord from "discord.js";
|
||||||
|
|
||||||
|
module.exports = function (client, interaction){
|
||||||
|
let stations = new Array();
|
||||||
|
let options = new Array();
|
||||||
|
|
||||||
|
stations = client.stations.forEach(station => {
|
||||||
|
if(station.name == "GrooveFM") return;
|
||||||
|
station = {
|
||||||
|
label: station.name,
|
||||||
|
description: station.owner,
|
||||||
|
value: station.name
|
||||||
|
};
|
||||||
|
options.push(station);
|
||||||
|
});
|
||||||
|
|
||||||
|
const menu = new Discord.MessageActionRow()
|
||||||
|
.addComponents(
|
||||||
|
new Discord.MessageSelectMenu()
|
||||||
|
.setCustomId('play')
|
||||||
|
.setPlaceholder('Nothing selected')
|
||||||
|
.addOptions(options)
|
||||||
|
);
|
||||||
|
|
||||||
|
stations = null;
|
||||||
|
options = null;
|
||||||
|
|
||||||
|
return interaction.reply({
|
||||||
|
content: '**Select station:**',
|
||||||
|
components: [menu],
|
||||||
|
ephemeral: true
|
||||||
|
});
|
||||||
|
}
|
@ -7,4 +7,4 @@ module.exports = function loadState(client, guild){
|
|||||||
data.state = {};
|
data.state = {};
|
||||||
client.datastore.updateEntry(guild, data);
|
client.datastore.updateEntry(guild, data);
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
@ -2,4 +2,4 @@ module.exports = function (area, text){
|
|||||||
let date = new Date();
|
let date = new Date();
|
||||||
console.log('[' + area + '] – ' + date.toISOString());
|
console.log('[' + area + '] – ' + date.toISOString());
|
||||||
if(text) console.log(text + '\n');
|
if(text) console.log(text + '\n');
|
||||||
}
|
}
|
||||||
|
@ -9,4 +9,4 @@ module.exports = function msToTime(duration) {
|
|||||||
: +hours > 0
|
: +hours > 0
|
||||||
? `${+hours < 10 ? `0${hours}` : hours}:${+minutes < 10 ? `0${minutes}` : minutes}:${+seconds < 10 ? `0${seconds}` : seconds}`
|
? `${+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}`;
|
: `${+minutes < 10 ? `0${minutes}` : minutes}:${+seconds < 10 ? `0${seconds}` : seconds}`;
|
||||||
}
|
}
|
||||||
|
96
src/client/funcs/play.js
Normal file
96
src/client/funcs/play.js
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
import Discord from "discord.js";
|
||||||
|
const {
|
||||||
|
createAudioResource
|
||||||
|
} = require("@discordjs/voice");
|
||||||
|
|
||||||
|
module.exports = async function play(interaction, guild, client, url) {
|
||||||
|
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
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
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("%client.funcs.msToTime(completed)%", "");
|
||||||
|
message.nowplayingDescription = message.nowplayingDescription.replace("Owner: ", "");
|
||||||
|
message.nowplayingDescription = message.nowplayingDescription.replace("**", "");
|
||||||
|
message.nowplayingDescription = message.nowplayingDescription.replace("**", "");
|
||||||
|
|
||||||
|
const embed = new Discord.MessageEmbed()
|
||||||
|
.setTitle(client.user.username)
|
||||||
|
.setThumbnail((radio.station.logo || "https://cdn.discordapp.com/emojis/" + client.messageEmojis["play"].replace(/[^0-9]+/g, '')))
|
||||||
|
.setColor(client.config.embedColor)
|
||||||
|
.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()
|
||||||
|
.setCustomId('list')
|
||||||
|
.setEmoji(client.messageEmojis["list"])
|
||||||
|
.setStyle('SECONDARY')
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new Discord.MessageButton()
|
||||||
|
.setCustomId('prev')
|
||||||
|
.setEmoji(client.messageEmojis["prev"])
|
||||||
|
.setStyle('SECONDARY')
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new Discord.MessageButton()
|
||||||
|
.setCustomId('stop')
|
||||||
|
.setEmoji(client.messageEmojis["stop"])
|
||||||
|
.setStyle('SECONDARY')
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new Discord.MessageButton()
|
||||||
|
.setCustomId('next')
|
||||||
|
.setEmoji(client.messageEmojis["next"])
|
||||||
|
.setStyle('SECONDARY')
|
||||||
|
)
|
||||||
|
.addComponents(
|
||||||
|
new Discord.MessageButton()
|
||||||
|
.setCustomId('statistics')
|
||||||
|
.setEmoji(client.messageEmojis["statistics"])
|
||||||
|
.setStyle('SECONDARY')
|
||||||
|
);
|
||||||
|
|
||||||
|
if(!radio.message){
|
||||||
|
radio.message = await radio.textChannel.send({ embeds: [embed], components: [buttons] });
|
||||||
|
} else {
|
||||||
|
radio.message.edit({ 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
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
62
src/client/funcs/restoreRadios.js
Normal file
62
src/client/funcs/restoreRadios.js
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
20
src/client/funcs/saveRadios.js
Normal file
20
src/client/funcs/saveRadios.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
module.exports = function saveState(client, guild, radio){
|
module.exports = function saveState(client, guild, radio){
|
||||||
client.datastore.checkEntry(guild.id);
|
client.datastore.checkEntry(guild.id);
|
||||||
|
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
|
|
||||||
let data = client.datastore.getEntry(guild.id);
|
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;
|
data.state.station.owner = radio.station.owner;
|
||||||
|
|
||||||
client.datastore.updateEntry(guild, data);
|
client.datastore.updateEntry(guild, data);
|
||||||
}
|
}
|
||||||
|
62
src/client/funcs/searchStation.js
Normal file
62
src/client/funcs/searchStation.js
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
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;
|
||||||
|
}
|
@ -1,22 +1,22 @@
|
|||||||
module.exports = function statisticsUpdate(client, guild, radio) {
|
module.exports = function statisticsUpdate(client, guild, radio) {
|
||||||
|
|
||||||
client.datastore.checkEntry(guild.id);
|
client.datastore.checkEntry(guild.id);
|
||||||
|
|
||||||
radio.datastore = client.datastore.getEntry(guild.id);
|
radio.datastore = client.datastore.getEntry(guild.id);
|
||||||
|
|
||||||
if(!radio.datastore.statistics[radio.station.name]){
|
if(!radio.datastore.statistics[radio.station.name]){
|
||||||
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].time = 0;
|
||||||
radio.datastore.statistics[radio.station.name].used = 0;
|
radio.datastore.statistics[radio.station.name].used = 0;
|
||||||
client.datastore.updateEntry(guild, radio.datastore);
|
client.datastore.updateEntry(guild, radio.datastore);
|
||||||
}
|
}
|
||||||
|
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
radio.currentTime = date.getTime();
|
radio.currentTime = date.getTime();
|
||||||
radio.playTime = parseInt(radio.currentTime)-parseInt(radio.startTime);
|
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].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;
|
radio.datastore.statistics[radio.station.name].used = parseInt(radio.datastore.statistics[radio.station.name].used)+1;
|
||||||
client.datastore.updateEntry(guild, radio.datastore);
|
client.datastore.updateEntry(guild, radio.datastore);
|
||||||
client.datastore.calculateGlobal(client);
|
client.datastore.calculateGlobal(client);
|
||||||
}
|
}
|
||||||
|
@ -5,13 +5,13 @@ module.exports = {
|
|||||||
runningCommandFailed: "Running this command failed!",
|
runningCommandFailed: "Running this command failed!",
|
||||||
noPermsEmbed: "I cannot send embeds (Embed links).",
|
noPermsEmbed: "I cannot send embeds (Embed links).",
|
||||||
bugTitle: "Found a bug with %client.user.username%?",
|
bugTitle: "Found a bug with %client.user.username%?",
|
||||||
bugDescription: "Join the support server \n %client.config.supportGuild%",
|
bugDescription: "Join the support server" + "\n" + "%client.config.supportGuild%",
|
||||||
helpTitle: "%client.user.username% help:",
|
helpTitle: "%client.user.username% help:",
|
||||||
helpDescription: "%commands%",
|
helpDescription: "%commands%",
|
||||||
inviteTitle: "Invite %client.user.username% to your Discord server!",
|
inviteTitle: "Invite %client.user.username% to your Discord server!",
|
||||||
listTitle: "Radio Stations",
|
listTitle: "Radio Stations",
|
||||||
nowplayingTitle: "Now Playing",
|
nowplayingTitle: "Now Playing",
|
||||||
nowplayingDescription: "**%radio.station.name%** \n Owner: %radio.station.owner% \n %client.funcs.msToTime(completed)%",
|
nowplayingDescription: "**%radio.station.name%**" + "\n" + "Owner: %radio.station.owner%" + "\n" + "%client.funcs.msToTime(completed)%",
|
||||||
noVoiceChannel: "You need to be in a voice channel to play radio!",
|
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!",
|
noQuery: "You need to use a number or search for a supported station!",
|
||||||
noPermsConnect: "I cannot connect to your voice channel.",
|
noPermsConnect: "I cannot connect to your voice channel.",
|
||||||
@ -36,5 +36,6 @@ module.exports = {
|
|||||||
statusField5: "Hosted by",
|
statusField5: "Hosted by",
|
||||||
errorStationURL: "Station can't be URL",
|
errorStationURL: "Station can't be URL",
|
||||||
messageCommandsDeprecatedTitle: "%client.user.username%",
|
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."
|
||||||
|
};
|
||||||
|
@ -1,207 +0,0 @@
|
|||||||
import Discord from "discord.js";
|
|
||||||
const {
|
|
||||||
createAudioPlayer,
|
|
||||||
createAudioResource,
|
|
||||||
getVoiceConnection,
|
|
||||||
joinVoiceChannel
|
|
||||||
} = require("@discordjs/voice");
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
async execute(client, guilds) {
|
|
||||||
guilds.forEach(async guild => {
|
|
||||||
let state = client.funcs.loadState(client, guild);
|
|
||||||
if(!state) return;
|
|
||||||
if(!state.station || !state.channels.voice || !state.channels.text) return;
|
|
||||||
|
|
||||||
const sstation = await 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 {
|
|
||||||
let voiceChannel = client.channels.cache.get(state.channels.voice);
|
|
||||||
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();
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function play(interaction, guild, client, url, Discord) {
|
|
||||||
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);
|
|
||||||
});
|
|
||||||
|
|
||||||
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("%client.funcs.msToTime(completed)%", "");
|
|
||||||
message.nowplayingDescription = message.nowplayingDescription.replace("Owner: ", "");
|
|
||||||
message.nowplayingDescription = message.nowplayingDescription.replace("**", "");
|
|
||||||
message.nowplayingDescription = message.nowplayingDescription.replace("**", "");
|
|
||||||
|
|
||||||
const embed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(client.user.username)
|
|
||||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["play"].replace(/[^0-9]+/g, ''))
|
|
||||||
.setColor(client.config.embedColor)
|
|
||||||
.addField(client.messages.nowplayingTitle, message.nowplayingDescription, true)
|
|
||||||
.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()
|
|
||||||
.setCustomId('list')
|
|
||||||
.setEmoji(client.messageEmojis["list"])
|
|
||||||
.setStyle('SECONDARY')
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new Discord.MessageButton()
|
|
||||||
.setCustomId('prev')
|
|
||||||
.setEmoji(client.messageEmojis["prev"])
|
|
||||||
.setStyle('SECONDARY')
|
|
||||||
.setDisabled(true)
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new Discord.MessageButton()
|
|
||||||
.setCustomId('stop')
|
|
||||||
.setEmoji(client.messageEmojis["stop"])
|
|
||||||
.setStyle('SECONDARY')
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new Discord.MessageButton()
|
|
||||||
.setCustomId('next')
|
|
||||||
.setEmoji(client.messageEmojis["next"])
|
|
||||||
.setStyle('SECONDARY')
|
|
||||||
.setDisabled(true)
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new Discord.MessageButton()
|
|
||||||
.setCustomId('statistics')
|
|
||||||
.setEmoji(client.messageEmojis["statistics"])
|
|
||||||
.setStyle('SECONDARY')
|
|
||||||
);
|
|
||||||
|
|
||||||
if(!radio.message){
|
|
||||||
radio.message = await radio.textChannel.send({ embeds: [embed], components: [buttons] });
|
|
||||||
} else {
|
|
||||||
radio.message.edit({ embeds: [embed], components: [buttons] });
|
|
||||||
}
|
|
||||||
|
|
||||||
message.play = client.messages.play.replace("%radio.station.name%", radio.station.name);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
@ -1,3 +1,3 @@
|
|||||||
export interface command { }
|
export interface command { }
|
||||||
|
|
||||||
export interface radio {}
|
export interface radio {}
|
||||||
|
@ -21,6 +21,6 @@ module.exports = {
|
|||||||
|
|
||||||
//Settings
|
//Settings
|
||||||
version: process.env.RADIOX_VERSION || process.env.npm_package_version,
|
version: process.env.RADIOX_VERSION || process.env.npm_package_version,
|
||||||
debug: process.env.DEBUG_MODE || false
|
debug: process.env.DEBUG_MODE || false,
|
||||||
|
maintenance: false
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user