mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2025-07-01 09:43:41 +00:00
Compare commits
113 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 | |||
55905e3841 | |||
190852bc16 | |||
73857c9fc5 | |||
853661ff52 | |||
41fb87fab6 | |||
65bd82054a | |||
40879c85bb | |||
0858f9e49e | |||
a1aa96fc2f | |||
6ed91fe43b |
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
|
2
.github/workflows/docker-build.yml
vendored
2
.github/workflows/docker-build.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1.5.1
|
||||
uses: docker/setup-buildx-action@v1.6.0
|
||||
id: buildx
|
||||
with:
|
||||
install: true
|
||||
|
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:
|
||||
- uses: actions/checkout@v1
|
||||
- name: install node v16
|
||||
uses: actions/setup-node@v2.3.1
|
||||
uses: actions/setup-node@v2.4.0
|
||||
with:
|
||||
node-version: 16
|
||||
- name: npm install
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,5 @@
|
||||
datastore/
|
||||
node_modules/
|
||||
npm-debug.log
|
||||
.vscode/
|
||||
.env
|
||||
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).
|
@ -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.
|
||||
|
||||
## 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`
|
||||
|
||||
## 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.
|
402
package-lock.json
generated
402
package-lock.json
generated
@ -1,30 +1,30 @@
|
||||
{
|
||||
"name": "eximiabots-radiox",
|
||||
"version": "0.3.4",
|
||||
"version": "0.3.8",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "eximiabots-radiox",
|
||||
"version": "0.3.4",
|
||||
"version": "0.3.8",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@discordjs/builders": "^0.6.0",
|
||||
"@discordjs/opus": "^0.6.0",
|
||||
"@discordjs/rest": "^0.1.1-canary.0",
|
||||
"@discordjs/voice": "^0.6.0",
|
||||
"discord-api-types": "^0.22.0",
|
||||
"discord-api-types": "^0.23.1",
|
||||
"discord.js": "^13.1.0",
|
||||
"dotenv": "^10.0.0",
|
||||
"libsodium-wrappers": "^0.7.9",
|
||||
"node-fetch": "^2.6.1",
|
||||
"node-fetch": "^3.0.0",
|
||||
"path": "^0.12.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.7.8",
|
||||
"@types/node": "^16.9.0",
|
||||
"@types/ws": "^7.4.7",
|
||||
"@typescript-eslint/eslint-plugin": "^4.29.3",
|
||||
"@typescript-eslint/parser": "^4.29.3",
|
||||
"@typescript-eslint/eslint-plugin": "^4.31.0",
|
||||
"@typescript-eslint/parser": "^4.31.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
@ -36,7 +36,7 @@
|
||||
"typescript": "^4.4.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.6.0",
|
||||
"node": ">=16.8.0",
|
||||
"npm": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
@ -180,6 +180,14 @@
|
||||
"npm": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/builders/node_modules/discord-api-types": {
|
||||
"version": "0.22.0",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/collection": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
|
||||
@ -220,6 +228,14 @@
|
||||
"node-pre-gyp": "bin/node-pre-gyp"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/node-pre-gyp/node_modules/node-fetch": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
|
||||
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==",
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/opus": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.6.0.tgz",
|
||||
@ -251,6 +267,22 @@
|
||||
"node": ">=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/rest/node_modules/discord-api-types": {
|
||||
"version": "0.22.0",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/rest/node_modules/node-fetch": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
|
||||
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==",
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/voice": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.6.0.tgz",
|
||||
@ -281,6 +313,14 @@
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/voice/node_modules/discord-api-types": {
|
||||
"version": "0.22.0",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/voice/node_modules/node-addon-api": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
|
||||
@ -460,9 +500,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "16.7.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.10.tgz",
|
||||
"integrity": "sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA=="
|
||||
"version": "16.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz",
|
||||
"integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g=="
|
||||
},
|
||||
"node_modules/@types/ws": {
|
||||
"version": "7.4.7",
|
||||
@ -473,13 +513,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "4.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.30.0.tgz",
|
||||
"integrity": "sha512-NgAnqk55RQ/SD+tZFD9aPwNSeHmDHHe5rtUyhIq0ZeCWZEvo4DK9rYz7v9HDuQZFvn320Ot+AikaCKMFKLlD0g==",
|
||||
"version": "4.31.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.0.tgz",
|
||||
"integrity": "sha512-iPKZTZNavAlOhfF4gymiSuUkgLne/nh5Oz2/mdiUmuZVD42m9PapnCnzjxuDsnpnbH3wT5s2D8bw6S39TC6GNw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/experimental-utils": "4.30.0",
|
||||
"@typescript-eslint/scope-manager": "4.30.0",
|
||||
"@typescript-eslint/experimental-utils": "4.31.0",
|
||||
"@typescript-eslint/scope-manager": "4.31.0",
|
||||
"debug": "^4.3.1",
|
||||
"functional-red-black-tree": "^1.0.1",
|
||||
"regexpp": "^3.1.0",
|
||||
@ -504,15 +544,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/experimental-utils": {
|
||||
"version": "4.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.30.0.tgz",
|
||||
"integrity": "sha512-K8RNIX9GnBsv5v4TjtwkKtqMSzYpjqAQg/oSphtxf3xxdt6T0owqnpojztjjTcatSteH3hLj3t/kklKx87NPqw==",
|
||||
"version": "4.31.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.0.tgz",
|
||||
"integrity": "sha512-Hld+EQiKLMppgKKkdUsLeVIeEOrwKc2G983NmznY/r5/ZtZCDvIOXnXtwqJIgYz/ymsy7n7RGvMyrzf1WaSQrw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/json-schema": "^7.0.7",
|
||||
"@typescript-eslint/scope-manager": "4.30.0",
|
||||
"@typescript-eslint/types": "4.30.0",
|
||||
"@typescript-eslint/typescript-estree": "4.30.0",
|
||||
"@typescript-eslint/scope-manager": "4.31.0",
|
||||
"@typescript-eslint/types": "4.31.0",
|
||||
"@typescript-eslint/typescript-estree": "4.31.0",
|
||||
"eslint-scope": "^5.1.1",
|
||||
"eslint-utils": "^3.0.0"
|
||||
},
|
||||
@ -528,14 +568,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "4.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.30.0.tgz",
|
||||
"integrity": "sha512-HJ0XuluSZSxeboLU7Q2VQ6eLlCwXPBOGnA7CqgBnz2Db3JRQYyBDJgQnop6TZ+rsbSx5gEdWhw4rE4mDa1FnZg==",
|
||||
"version": "4.31.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.0.tgz",
|
||||
"integrity": "sha512-oWbzvPh5amMuTmKaf1wp0ySxPt2ZXHnFQBN2Szu1O//7LmOvgaKTCIDNLK2NvzpmVd5A2M/1j/rujBqO37hj3w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "4.30.0",
|
||||
"@typescript-eslint/types": "4.30.0",
|
||||
"@typescript-eslint/typescript-estree": "4.30.0",
|
||||
"@typescript-eslint/scope-manager": "4.31.0",
|
||||
"@typescript-eslint/types": "4.31.0",
|
||||
"@typescript-eslint/typescript-estree": "4.31.0",
|
||||
"debug": "^4.3.1"
|
||||
},
|
||||
"engines": {
|
||||
@ -555,13 +595,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "4.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.30.0.tgz",
|
||||
"integrity": "sha512-VJ/jAXovxNh7rIXCQbYhkyV2Y3Ac/0cVHP/FruTJSAUUm4Oacmn/nkN5zfWmWFEanN4ggP0vJSHOeajtHq3f8A==",
|
||||
"version": "4.31.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.0.tgz",
|
||||
"integrity": "sha512-LJ+xtl34W76JMRLjbaQorhR0hfRAlp3Lscdiz9NeI/8i+q0hdBZ7BsiYieLoYWqy+AnRigaD3hUwPFugSzdocg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "4.30.0",
|
||||
"@typescript-eslint/visitor-keys": "4.30.0"
|
||||
"@typescript-eslint/types": "4.31.0",
|
||||
"@typescript-eslint/visitor-keys": "4.31.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
|
||||
@ -572,9 +612,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "4.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.30.0.tgz",
|
||||
"integrity": "sha512-YKldqbNU9K4WpTNwBqtAerQKLLW/X2A/j4yw92e3ZJYLx+BpKLeheyzoPfzIXHfM8BXfoleTdiYwpsvVPvHrDw==",
|
||||
"version": "4.31.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.0.tgz",
|
||||
"integrity": "sha512-9XR5q9mk7DCXgXLS7REIVs+BaAswfdHhx91XqlJklmqWpTALGjygWVIb/UnLh4NWhfwhR5wNe1yTyCInxVhLqQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
|
||||
@ -585,13 +625,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "4.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.30.0.tgz",
|
||||
"integrity": "sha512-6WN7UFYvykr/U0Qgy4kz48iGPWILvYL34xXJxvDQeiRE018B7POspNRVtAZscWntEPZpFCx4hcz/XBT+erenfg==",
|
||||
"version": "4.31.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.0.tgz",
|
||||
"integrity": "sha512-QHl2014t3ptg+xpmOSSPn5hm4mY8D4s97ftzyk9BZ8RxYQ3j73XcwuijnJ9cMa6DO4aLXeo8XS3z1omT9LA/Eg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "4.30.0",
|
||||
"@typescript-eslint/visitor-keys": "4.30.0",
|
||||
"@typescript-eslint/types": "4.31.0",
|
||||
"@typescript-eslint/visitor-keys": "4.31.0",
|
||||
"debug": "^4.3.1",
|
||||
"globby": "^11.0.3",
|
||||
"is-glob": "^4.0.1",
|
||||
@ -612,12 +652,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "4.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.30.0.tgz",
|
||||
"integrity": "sha512-pNaaxDt/Ol/+JZwzP7MqWc8PJQTUhZwoee/PVlQ+iYoYhagccvoHnC9e4l+C/krQYYkENxznhVSDwClIbZVxRw==",
|
||||
"version": "4.31.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.0.tgz",
|
||||
"integrity": "sha512-HUcRp2a9I+P21+O21yu3ezv3GEPGjyGiXoEUQwZXjR8UxRApGeLyWH4ZIIUSalE28aG4YsV6GjtaAVB3QKOu0w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "4.30.0",
|
||||
"@typescript-eslint/types": "4.31.0",
|
||||
"eslint-visitor-keys": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
@ -666,9 +706,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/acorn-walk": {
|
||||
"version": "8.1.1",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.1.1.tgz",
|
||||
"integrity": "sha512-FbJdceMlPHEAWJOILDk1fXD8lnTlEIWFkqtfk+MvmL5q/qlHfN7GEHcsFZWt/Tea9jRNPWUZG4G976nqAAmU9w==",
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
||||
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
@ -1190,6 +1230,14 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/data-uri-to-buffer": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz",
|
||||
"integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==",
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.2",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
|
||||
@ -1285,9 +1333,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/discord-api-types": {
|
||||
"version": "0.22.0",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
|
||||
"version": "0.23.1",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
|
||||
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
@ -1327,6 +1375,22 @@
|
||||
"npm": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/discord.js/node_modules/discord-api-types": {
|
||||
"version": "0.22.0",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/discord.js/node_modules/node-fetch": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
|
||||
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==",
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/doctrine": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
|
||||
@ -1743,6 +1807,27 @@
|
||||
"reusify": "^1.0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/fetch-blob": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.2.tgz",
|
||||
"integrity": "sha512-hunJbvy/6OLjCD0uuhLdp0mMPzP/yd2ssd1t2FCJsaA7wkWhpbp9xfuNVpv7Ll4jFhzp6T4LAupSiV9uOeg0VQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/jimmywarting"
|
||||
},
|
||||
{
|
||||
"type": "paypal",
|
||||
"url": "https://paypal.me/jimmywarting"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"web-streams-polyfill": "^3.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.20 || >= 14.13"
|
||||
}
|
||||
},
|
||||
"node_modules/file-entry-cache": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
||||
@ -2535,11 +2620,19 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
||||
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0.tgz",
|
||||
"integrity": "sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==",
|
||||
"dependencies": {
|
||||
"data-uri-to-buffer": "^3.0.1",
|
||||
"fetch-blob": "^3.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/node-fetch"
|
||||
}
|
||||
},
|
||||
"node_modules/nodemon": {
|
||||
@ -2836,9 +2929,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz",
|
||||
"integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==",
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.0.tgz",
|
||||
"integrity": "sha512-DsEPLY1dE5HF3BxCRBmD4uYZ+5DCbvatnolqTqcxEgKVZnL2kUfyu7b8pPQ5+hTBkdhU9SLUmK0/pHb07RE4WQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"prettier": "bin-prettier.js"
|
||||
@ -3549,9 +3642,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ts-node/node_modules/acorn": {
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz",
|
||||
"integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==",
|
||||
"version": "8.5.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz",
|
||||
"integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
@ -3783,6 +3876,14 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/web-streams-polyfill": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz",
|
||||
"integrity": "sha512-Czi3fG883e96T4DLEPRvufrF2ydhOOW1+1a6c3gNjH2aIh50DNFBdfwh2AKoOf1rXvpvavAoA11Qdq9+BKjE0Q==",
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
@ -3874,9 +3975,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ws": {
|
||||
"version": "7.5.4",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.4.tgz",
|
||||
"integrity": "sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg==",
|
||||
"version": "7.5.5",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz",
|
||||
"integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==",
|
||||
"engines": {
|
||||
"node": ">=8.3.0"
|
||||
},
|
||||
@ -4027,6 +4128,13 @@
|
||||
"ow": "^0.27.0",
|
||||
"ts-mixer": "^6.0.0",
|
||||
"tslib": "^2.3.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"discord-api-types": {
|
||||
"version": "0.22.0",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@discordjs/collection": {
|
||||
@ -4058,6 +4166,13 @@
|
||||
"rimraf": "^3.0.2",
|
||||
"semver": "^7.3.5",
|
||||
"tar": "^6.1.8"
|
||||
},
|
||||
"dependencies": {
|
||||
"node-fetch": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
|
||||
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@discordjs/opus": {
|
||||
@ -4082,6 +4197,18 @@
|
||||
"form-data": "^4.0.0",
|
||||
"node-fetch": "^2.6.1",
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"discord-api-types": {
|
||||
"version": "0.22.0",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
|
||||
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@discordjs/voice": {
|
||||
@ -4107,6 +4234,11 @@
|
||||
"node-addon-api": "^3.2.1"
|
||||
}
|
||||
},
|
||||
"discord-api-types": {
|
||||
"version": "0.22.0",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
|
||||
},
|
||||
"node-addon-api": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
|
||||
@ -4237,9 +4369,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "16.7.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.10.tgz",
|
||||
"integrity": "sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA=="
|
||||
"version": "16.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz",
|
||||
"integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g=="
|
||||
},
|
||||
"@types/ws": {
|
||||
"version": "7.4.7",
|
||||
@ -4250,13 +4382,13 @@
|
||||
}
|
||||
},
|
||||
"@typescript-eslint/eslint-plugin": {
|
||||
"version": "4.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.30.0.tgz",
|
||||
"integrity": "sha512-NgAnqk55RQ/SD+tZFD9aPwNSeHmDHHe5rtUyhIq0ZeCWZEvo4DK9rYz7v9HDuQZFvn320Ot+AikaCKMFKLlD0g==",
|
||||
"version": "4.31.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.0.tgz",
|
||||
"integrity": "sha512-iPKZTZNavAlOhfF4gymiSuUkgLne/nh5Oz2/mdiUmuZVD42m9PapnCnzjxuDsnpnbH3wT5s2D8bw6S39TC6GNw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@typescript-eslint/experimental-utils": "4.30.0",
|
||||
"@typescript-eslint/scope-manager": "4.30.0",
|
||||
"@typescript-eslint/experimental-utils": "4.31.0",
|
||||
"@typescript-eslint/scope-manager": "4.31.0",
|
||||
"debug": "^4.3.1",
|
||||
"functional-red-black-tree": "^1.0.1",
|
||||
"regexpp": "^3.1.0",
|
||||
@ -4265,55 +4397,55 @@
|
||||
}
|
||||
},
|
||||
"@typescript-eslint/experimental-utils": {
|
||||
"version": "4.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.30.0.tgz",
|
||||
"integrity": "sha512-K8RNIX9GnBsv5v4TjtwkKtqMSzYpjqAQg/oSphtxf3xxdt6T0owqnpojztjjTcatSteH3hLj3t/kklKx87NPqw==",
|
||||
"version": "4.31.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.0.tgz",
|
||||
"integrity": "sha512-Hld+EQiKLMppgKKkdUsLeVIeEOrwKc2G983NmznY/r5/ZtZCDvIOXnXtwqJIgYz/ymsy7n7RGvMyrzf1WaSQrw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/json-schema": "^7.0.7",
|
||||
"@typescript-eslint/scope-manager": "4.30.0",
|
||||
"@typescript-eslint/types": "4.30.0",
|
||||
"@typescript-eslint/typescript-estree": "4.30.0",
|
||||
"@typescript-eslint/scope-manager": "4.31.0",
|
||||
"@typescript-eslint/types": "4.31.0",
|
||||
"@typescript-eslint/typescript-estree": "4.31.0",
|
||||
"eslint-scope": "^5.1.1",
|
||||
"eslint-utils": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"@typescript-eslint/parser": {
|
||||
"version": "4.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.30.0.tgz",
|
||||
"integrity": "sha512-HJ0XuluSZSxeboLU7Q2VQ6eLlCwXPBOGnA7CqgBnz2Db3JRQYyBDJgQnop6TZ+rsbSx5gEdWhw4rE4mDa1FnZg==",
|
||||
"version": "4.31.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.0.tgz",
|
||||
"integrity": "sha512-oWbzvPh5amMuTmKaf1wp0ySxPt2ZXHnFQBN2Szu1O//7LmOvgaKTCIDNLK2NvzpmVd5A2M/1j/rujBqO37hj3w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@typescript-eslint/scope-manager": "4.30.0",
|
||||
"@typescript-eslint/types": "4.30.0",
|
||||
"@typescript-eslint/typescript-estree": "4.30.0",
|
||||
"@typescript-eslint/scope-manager": "4.31.0",
|
||||
"@typescript-eslint/types": "4.31.0",
|
||||
"@typescript-eslint/typescript-estree": "4.31.0",
|
||||
"debug": "^4.3.1"
|
||||
}
|
||||
},
|
||||
"@typescript-eslint/scope-manager": {
|
||||
"version": "4.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.30.0.tgz",
|
||||
"integrity": "sha512-VJ/jAXovxNh7rIXCQbYhkyV2Y3Ac/0cVHP/FruTJSAUUm4Oacmn/nkN5zfWmWFEanN4ggP0vJSHOeajtHq3f8A==",
|
||||
"version": "4.31.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.0.tgz",
|
||||
"integrity": "sha512-LJ+xtl34W76JMRLjbaQorhR0hfRAlp3Lscdiz9NeI/8i+q0hdBZ7BsiYieLoYWqy+AnRigaD3hUwPFugSzdocg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@typescript-eslint/types": "4.30.0",
|
||||
"@typescript-eslint/visitor-keys": "4.30.0"
|
||||
"@typescript-eslint/types": "4.31.0",
|
||||
"@typescript-eslint/visitor-keys": "4.31.0"
|
||||
}
|
||||
},
|
||||
"@typescript-eslint/types": {
|
||||
"version": "4.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.30.0.tgz",
|
||||
"integrity": "sha512-YKldqbNU9K4WpTNwBqtAerQKLLW/X2A/j4yw92e3ZJYLx+BpKLeheyzoPfzIXHfM8BXfoleTdiYwpsvVPvHrDw==",
|
||||
"version": "4.31.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.0.tgz",
|
||||
"integrity": "sha512-9XR5q9mk7DCXgXLS7REIVs+BaAswfdHhx91XqlJklmqWpTALGjygWVIb/UnLh4NWhfwhR5wNe1yTyCInxVhLqQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@typescript-eslint/typescript-estree": {
|
||||
"version": "4.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.30.0.tgz",
|
||||
"integrity": "sha512-6WN7UFYvykr/U0Qgy4kz48iGPWILvYL34xXJxvDQeiRE018B7POspNRVtAZscWntEPZpFCx4hcz/XBT+erenfg==",
|
||||
"version": "4.31.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.0.tgz",
|
||||
"integrity": "sha512-QHl2014t3ptg+xpmOSSPn5hm4mY8D4s97ftzyk9BZ8RxYQ3j73XcwuijnJ9cMa6DO4aLXeo8XS3z1omT9LA/Eg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@typescript-eslint/types": "4.30.0",
|
||||
"@typescript-eslint/visitor-keys": "4.30.0",
|
||||
"@typescript-eslint/types": "4.31.0",
|
||||
"@typescript-eslint/visitor-keys": "4.31.0",
|
||||
"debug": "^4.3.1",
|
||||
"globby": "^11.0.3",
|
||||
"is-glob": "^4.0.1",
|
||||
@ -4322,12 +4454,12 @@
|
||||
}
|
||||
},
|
||||
"@typescript-eslint/visitor-keys": {
|
||||
"version": "4.30.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.30.0.tgz",
|
||||
"integrity": "sha512-pNaaxDt/Ol/+JZwzP7MqWc8PJQTUhZwoee/PVlQ+iYoYhagccvoHnC9e4l+C/krQYYkENxznhVSDwClIbZVxRw==",
|
||||
"version": "4.31.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.0.tgz",
|
||||
"integrity": "sha512-HUcRp2a9I+P21+O21yu3ezv3GEPGjyGiXoEUQwZXjR8UxRApGeLyWH4ZIIUSalE28aG4YsV6GjtaAVB3QKOu0w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@typescript-eslint/types": "4.30.0",
|
||||
"@typescript-eslint/types": "4.31.0",
|
||||
"eslint-visitor-keys": "^2.0.0"
|
||||
}
|
||||
},
|
||||
@ -4358,9 +4490,9 @@
|
||||
"requires": {}
|
||||
},
|
||||
"acorn-walk": {
|
||||
"version": "8.1.1",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.1.1.tgz",
|
||||
"integrity": "sha512-FbJdceMlPHEAWJOILDk1fXD8lnTlEIWFkqtfk+MvmL5q/qlHfN7GEHcsFZWt/Tea9jRNPWUZG4G976nqAAmU9w==",
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
||||
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||
"dev": true
|
||||
},
|
||||
"agent-base": {
|
||||
@ -4764,6 +4896,11 @@
|
||||
"integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==",
|
||||
"dev": true
|
||||
},
|
||||
"data-uri-to-buffer": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz",
|
||||
"integrity": "sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og=="
|
||||
},
|
||||
"debug": {
|
||||
"version": "4.3.2",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
|
||||
@ -4830,9 +4967,9 @@
|
||||
}
|
||||
},
|
||||
"discord-api-types": {
|
||||
"version": "0.22.0",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
|
||||
"version": "0.23.1",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
|
||||
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ=="
|
||||
},
|
||||
"discord.js": {
|
||||
"version": "13.1.0",
|
||||
@ -4860,6 +4997,16 @@
|
||||
"ts-mixer": "^6.0.0",
|
||||
"tslib": "^2.3.0"
|
||||
}
|
||||
},
|
||||
"discord-api-types": {
|
||||
"version": "0.22.0",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.2",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
|
||||
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -5178,6 +5325,14 @@
|
||||
"reusify": "^1.0.4"
|
||||
}
|
||||
},
|
||||
"fetch-blob": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.2.tgz",
|
||||
"integrity": "sha512-hunJbvy/6OLjCD0uuhLdp0mMPzP/yd2ssd1t2FCJsaA7wkWhpbp9xfuNVpv7Ll4jFhzp6T4LAupSiV9uOeg0VQ==",
|
||||
"requires": {
|
||||
"web-streams-polyfill": "^3.0.3"
|
||||
}
|
||||
},
|
||||
"file-entry-cache": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
||||
@ -5797,9 +5952,13 @@
|
||||
"dev": true
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
||||
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0.tgz",
|
||||
"integrity": "sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==",
|
||||
"requires": {
|
||||
"data-uri-to-buffer": "^3.0.1",
|
||||
"fetch-blob": "^3.1.2"
|
||||
}
|
||||
},
|
||||
"nodemon": {
|
||||
"version": "2.0.12",
|
||||
@ -6018,9 +6177,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"prettier": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz",
|
||||
"integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==",
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.0.tgz",
|
||||
"integrity": "sha512-DsEPLY1dE5HF3BxCRBmD4uYZ+5DCbvatnolqTqcxEgKVZnL2kUfyu7b8pPQ5+hTBkdhU9SLUmK0/pHb07RE4WQ==",
|
||||
"dev": true
|
||||
},
|
||||
"prettier-linter-helpers": {
|
||||
@ -6516,9 +6675,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"acorn": {
|
||||
"version": "8.4.1",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz",
|
||||
"integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==",
|
||||
"version": "8.5.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz",
|
||||
"integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@ -6705,6 +6864,11 @@
|
||||
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
|
||||
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY="
|
||||
},
|
||||
"web-streams-polyfill": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz",
|
||||
"integrity": "sha512-Czi3fG883e96T4DLEPRvufrF2ydhOOW1+1a6c3gNjH2aIh50DNFBdfwh2AKoOf1rXvpvavAoA11Qdq9+BKjE0Q=="
|
||||
},
|
||||
"which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
@ -6780,9 +6944,9 @@
|
||||
}
|
||||
},
|
||||
"ws": {
|
||||
"version": "7.5.4",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.4.tgz",
|
||||
"integrity": "sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg==",
|
||||
"version": "7.5.5",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz",
|
||||
"integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==",
|
||||
"requires": {}
|
||||
},
|
||||
"xdg-basedir": {
|
||||
|
18
package.json
18
package.json
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "eximiabots-radiox",
|
||||
"version": "0.3.4",
|
||||
"version": "0.3.8",
|
||||
"description": "Internet Radio to your Discord guild",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "rimraf ./build && tsc",
|
||||
"start": "node build/index.js",
|
||||
"start:dev": "npm run build && node build/index.js"
|
||||
"start": "node --no-warnings build/index.js",
|
||||
"start:dev": "npm run build && node --no-warnings build/index.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -22,18 +22,18 @@
|
||||
"@discordjs/opus": "^0.6.0",
|
||||
"@discordjs/rest": "^0.1.1-canary.0",
|
||||
"@discordjs/voice": "^0.6.0",
|
||||
"discord-api-types": "^0.22.0",
|
||||
"discord-api-types": "^0.23.1",
|
||||
"discord.js": "^13.1.0",
|
||||
"dotenv": "^10.0.0",
|
||||
"libsodium-wrappers": "^0.7.9",
|
||||
"node-fetch": "^2.6.1",
|
||||
"node-fetch": "^3.0.0",
|
||||
"path": "^0.12.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.7.8",
|
||||
"@types/node": "^16.9.0",
|
||||
"@types/ws": "^7.4.7",
|
||||
"@typescript-eslint/eslint-plugin": "^4.29.3",
|
||||
"@typescript-eslint/parser": "^4.29.3",
|
||||
"@typescript-eslint/eslint-plugin": "^4.31.0",
|
||||
"@typescript-eslint/parser": "^4.31.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
@ -45,7 +45,7 @@
|
||||
"typescript": "^4.4.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.6.0",
|
||||
"node": ">=16.8.0",
|
||||
"npm": ">=7.0.0"
|
||||
}
|
||||
}
|
@ -42,6 +42,8 @@ class RadioClient extends Client {
|
||||
this.funcs.searchStation = require("./client/funcs/searchStation.js");
|
||||
this.funcs.play = require("./client/funcs/play.js");
|
||||
this.funcs.listStations = require("./client/funcs/listStations.js");
|
||||
this.funcs.restoreRadios = require("./client/funcs/restoreRadios.js");
|
||||
this.funcs.saveRadios = require("./client/funcs/saveRadios.js");
|
||||
|
||||
console.log('RadioX ' + this.config.version);
|
||||
console.log('Internet Radio to your Discord guild');
|
||||
@ -50,6 +52,9 @@ class RadioClient extends Client {
|
||||
|
||||
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"));
|
||||
for (const file of commandFiles) {
|
||||
const command = require(`./client/commands/${file}`);
|
||||
@ -76,6 +81,12 @@ class RadioClient extends Client {
|
||||
require(`${events}voiceStateUpdate`).execute(this, oldState, newState);
|
||||
});
|
||||
|
||||
this.on("error", error => {
|
||||
this.funcs.logger("Discord Client / Error");
|
||||
console.error(error);
|
||||
console.log('');
|
||||
});
|
||||
|
||||
process.on('SIGINT', () => {
|
||||
require(`${events}SIGINT`).execute(this);
|
||||
});
|
||||
@ -84,11 +95,23 @@ class RadioClient extends Client {
|
||||
require(`${events}SIGTERM`).execute(this);
|
||||
});
|
||||
|
||||
this.on("error", error => {
|
||||
console.error(error);
|
||||
process.on('uncaughtException', (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('');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@ module.exports = {
|
||||
if(command.options) {
|
||||
command.options.forEach(function(option) {
|
||||
if(option.type == "STRING") option.type = 3;
|
||||
if(option.type == "NUMBER") option.type = 10;
|
||||
command.data.options.push(option);
|
||||
});
|
||||
}
|
||||
@ -49,6 +50,7 @@ module.exports = {
|
||||
client.funcs.logger('Slash Commands', 'Guild Applications – Successful' + "\n" + guild.id + " / " + guild.name);
|
||||
} 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 {
|
||||
|
@ -3,7 +3,6 @@ import Discord from "discord.js";
|
||||
module.exports = {
|
||||
name: 'bug',
|
||||
description: 'Report a bug',
|
||||
permission: 'none',
|
||||
category: 'info',
|
||||
async execute(interaction, client) {
|
||||
let message = {};
|
||||
|
@ -3,7 +3,6 @@ import Discord from "discord.js";
|
||||
module.exports = {
|
||||
name: 'help',
|
||||
description: 'Get help using bot',
|
||||
permission: 'none',
|
||||
category: 'info',
|
||||
execute(interaction, client) {
|
||||
let message = {};
|
||||
|
@ -3,7 +3,6 @@ import Discord from "discord.js";
|
||||
module.exports = {
|
||||
name: 'invite',
|
||||
description: 'Invite Bot',
|
||||
permission: 'none',
|
||||
category: 'info',
|
||||
execute(interaction, client) {
|
||||
let message = {};
|
||||
|
@ -3,18 +3,21 @@ import Discord from "discord.js";
|
||||
module.exports = {
|
||||
name: 'list',
|
||||
description: 'List radio stations',
|
||||
permission: 'none',
|
||||
category: 'radio',
|
||||
execute(interaction, client) {
|
||||
let message = {};
|
||||
|
||||
if(!client.stations) {
|
||||
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
||||
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
|
||||
return interaction.reply({
|
||||
content: client.messageEmojis["error"] + message.errorToGetPlaylist,
|
||||
ephemeral: true
|
||||
});
|
||||
}
|
||||
|
||||
const radio = client.radio.get(interaction.guild.id);
|
||||
|
||||
if(radio){
|
||||
if(radio && !client.config.maintenance){
|
||||
client.funcs.listStations(client, interaction);
|
||||
} else {
|
||||
let stations = `${client.stations.map(s => `**#** ${s.name}`).join('\n')}`
|
||||
|
@ -1,62 +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 = {
|
||||
name: 'maintenance',
|
||||
description: 'Bot Maintenance',
|
||||
permission: 'none',
|
||||
category: 'info',
|
||||
execute(interaction, client) {
|
||||
options: [
|
||||
{ type: "NUMBER", name: "action", description: "Select action", required: false}
|
||||
],
|
||||
async execute(interaction, client) {
|
||||
let message = {};
|
||||
|
||||
if(!client.funcs.isDev(client.config.devId, interaction.user.id)) return interaction.reply(client.messageEmojis["error"] + client.messages.notAllowed);
|
||||
|
||||
if(client.config.version.includes("-dev")){
|
||||
interaction.reply({
|
||||
content: "Maintenance Initiated",
|
||||
ephemeral: true
|
||||
});
|
||||
|
||||
process.emit('SIGINT');
|
||||
} else {
|
||||
if(!client.stations) {
|
||||
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
||||
return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
|
||||
if(!client.funcs.isDev(client.config.devId, interaction.user.id)) return interaction.reply({
|
||||
content: client.messageEmojis["error"] + client.messages.notAllowed,
|
||||
ephemeral: true
|
||||
});
|
||||
let action = interaction.options?.getNumber("action") ?? interaction.values?.[0];
|
||||
const options = new Array(
|
||||
{
|
||||
emoji: "🌀",
|
||||
label: "Restart Bot",
|
||||
description: "",
|
||||
value: "0"
|
||||
},
|
||||
{
|
||||
emoji: "<:RadioXStop:688541155377414168>",
|
||||
label: "Save Radios",
|
||||
description: "",
|
||||
value: "4"
|
||||
},
|
||||
{
|
||||
emoji: "<:RadioXPlay:688541155712827458>",
|
||||
label: "Restore Radios",
|
||||
description: "",
|
||||
value: "5"
|
||||
},
|
||||
{
|
||||
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"
|
||||
}
|
||||
);
|
||||
|
||||
let currentRadios = client.radio.keys();
|
||||
let radio = currentRadios.next();
|
||||
let stoppedRadios = "";
|
||||
const menu = new Discord.MessageActionRow()
|
||||
.addComponents(
|
||||
new Discord.MessageSelectMenu()
|
||||
.setCustomId('maintenance')
|
||||
.setPlaceholder('Select action')
|
||||
.addOptions(options)
|
||||
);
|
||||
|
||||
client.user.setStatus('dnd');
|
||||
|
||||
while (!radio.done) {
|
||||
let currentRadio = client.radio.get(radio.value);
|
||||
currentRadio.guild = client.datastore.getEntry(radio.value).guild;
|
||||
|
||||
if(currentRadio){
|
||||
client.funcs.statisticsUpdate(client, currentRadio.guild, currentRadio);
|
||||
currentRadio.connection?.destroy();
|
||||
currentRadio.audioPlayer?.stop();
|
||||
currentRadio.message?.delete();
|
||||
client.radio.delete(radio.value);
|
||||
stoppedRadios += "-" + radio.value + ": " + currentRadio.guild.name + "\n";
|
||||
}
|
||||
radio = currentRadios.next();
|
||||
}
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setTitle(client.messages.maintenanceTitle)
|
||||
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["maintenance"].replace(/[^0-9]+/g, ''))
|
||||
.setColor(client.config.embedColor)
|
||||
.setDescription("Stopped all radios" + "\n" + stoppedRadios)
|
||||
.setImage('https://waren.io/berriabot-temp-sa7a36a9xm6837br/images/empty-3.png')
|
||||
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
||||
|
||||
interaction.reply({
|
||||
embeds: [embed],
|
||||
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()
|
||||
.setTitle(client.messages.maintenanceTitle)
|
||||
.setColor(client.config.embedColor)
|
||||
.setDescription(options.find(option => option.value == action).label)
|
||||
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
|
||||
|
||||
interaction.reply({
|
||||
embeds: [embed],
|
||||
ephemeral: true
|
||||
});
|
||||
|
||||
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:
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
@ -1,7 +1,6 @@
|
||||
module.exports = {
|
||||
name: 'next',
|
||||
description: 'Next Station',
|
||||
permission: 'none',
|
||||
category: 'radio',
|
||||
async execute(interaction, client, command) {
|
||||
if (client.funcs.check(client, interaction, command)) {
|
||||
@ -17,8 +16,6 @@ module.exports = {
|
||||
ephemeral: true
|
||||
});
|
||||
|
||||
interaction.deferUpdate();
|
||||
|
||||
let url = station.stream[station.stream.default];
|
||||
|
||||
client.funcs.statisticsUpdate(client, interaction.guild, radio);
|
||||
@ -28,7 +25,14 @@ module.exports = {
|
||||
radio.station = station;
|
||||
radio.textChannel = interaction.channel;
|
||||
radio.startTime = date.getTime();
|
||||
client.funcs.play(null, interaction.guild, client, url);
|
||||
|
||||
if(interaction.isCommand()) {
|
||||
client.funcs.play(interaction, interaction.guild, client, url);
|
||||
}
|
||||
if(interaction.isButton()) {
|
||||
interaction.deferUpdate();
|
||||
client.funcs.play(null, interaction.guild, client, url);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ import Discord from "discord.js";
|
||||
module.exports = {
|
||||
name: 'nowplaying',
|
||||
description: 'Current Radio Station',
|
||||
permission: 'none',
|
||||
category: 'radio',
|
||||
async execute(interaction, client, command) {
|
||||
if (client.funcs.check(client, interaction, command)) {
|
||||
|
@ -11,52 +11,59 @@ module.exports = {
|
||||
options: [
|
||||
{ type: "STRING", name: "query", description: "Select station", required: false}
|
||||
],
|
||||
permission: "none",
|
||||
category: "radio",
|
||||
async execute(interaction, client) {
|
||||
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);
|
||||
}
|
||||
|
||||
client.funcs.listStations(client, interaction);
|
||||
if(client.config.maintenance){
|
||||
interaction.reply({
|
||||
content: client.messageEmojis["error"] + client.messages.maintenance,
|
||||
ephemeral: true
|
||||
});
|
||||
return false;
|
||||
}
|
||||
let url = query ? query.replace(/<(.+)>/g, "$1") : "";
|
||||
const radio = client.radio.get(interaction.guild.id);
|
||||
const voiceChannel = interaction.member.voice.channel;
|
||||
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
|
||||
);
|
||||
|
||||
if(!client.stations) {
|
||||
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
|
||||
return interaction.reply({
|
||||
content: client.messageEmojis["error"] + message.errorToGetPlaylist,
|
||||
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);
|
||||
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")) {
|
||||
return interaction.reply(client.messageEmojis["error"] + client.messages.noPermsSpeak);
|
||||
return interaction.reply({
|
||||
content: client.messageEmojis["error"] + client.messages.noPermsSpeak,
|
||||
ephemeral: true
|
||||
});
|
||||
}
|
||||
let station;
|
||||
const number = parseInt(query - 1);
|
||||
@ -76,17 +83,15 @@ module.exports = {
|
||||
station = client.stations[number];
|
||||
}
|
||||
} else {
|
||||
if (query.length < 3)
|
||||
return interaction.reply({
|
||||
content: client.messageEmojis["error"] + client.messages.tooShortSearch,
|
||||
ephemeral: true
|
||||
});
|
||||
if (query.length < 3) return interaction.reply({
|
||||
content: client.messageEmojis["error"] + client.messages.tooShortSearch,
|
||||
ephemeral: true
|
||||
});
|
||||
const sstation = await client.funcs.searchStation(query, client);
|
||||
if (!sstation)
|
||||
return interaction.reply({
|
||||
content: client.messageEmojis["error"] + client.messages.noSearchResults,
|
||||
ephemeral: true
|
||||
});
|
||||
if (!sstation) return interaction.reply({
|
||||
content: client.messageEmojis["error"] + client.messages.noSearchResults,
|
||||
ephemeral: true
|
||||
});
|
||||
url = sstation.stream[sstation.stream.default];
|
||||
station = sstation;
|
||||
}
|
||||
@ -139,7 +144,10 @@ module.exports = {
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
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
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
@ -1,7 +1,6 @@
|
||||
module.exports = {
|
||||
name: 'prev',
|
||||
description: 'Previous Station',
|
||||
permission: 'none',
|
||||
category: 'radio',
|
||||
async execute(interaction, client, command) {
|
||||
if (client.funcs.check(client, interaction, command)) {
|
||||
@ -17,8 +16,6 @@ module.exports = {
|
||||
ephemeral: true
|
||||
});
|
||||
|
||||
interaction.deferUpdate();
|
||||
|
||||
let url = station.stream[station.stream.default];
|
||||
|
||||
client.funcs.statisticsUpdate(client, interaction.guild, radio);
|
||||
@ -28,7 +25,14 @@ module.exports = {
|
||||
radio.station = station;
|
||||
radio.textChannel = interaction.channel;
|
||||
radio.startTime = date.getTime();
|
||||
client.funcs.play(null, interaction.guild, client, url);
|
||||
|
||||
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,9 +1,9 @@
|
||||
import Discord from "discord.js";
|
||||
|
||||
|
||||
module.exports = {
|
||||
name: 'statistics',
|
||||
description: 'Show statistics',
|
||||
permission: 'none',
|
||||
category: 'info',
|
||||
execute(interaction, client) {
|
||||
let message = {};
|
||||
@ -14,17 +14,20 @@ module.exports = {
|
||||
|
||||
if(!client.stations) {
|
||||
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){
|
||||
statistics = "You have not listened any radio station";
|
||||
statistics = "You have not listened any radio stations";
|
||||
} else {
|
||||
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){
|
||||
statistics += `**${parseInt(station) + 1}. ` + stations[station].name + "** \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 += "Guild – Time: " + client.funcs.msToTime(currentGuild.statistics[stations[station].name].time) + " (" + ((currentGuild.statistics[stations[station].name].time / global.statistics[stations[station].name].time) * 100) + "%" + ")" + " / " + "Used: " + currentGuild.statistics[stations[station].name].used + " (" + ((currentGuild.statistics[stations[station].name].used / global.statistics[stations[station].name].used) * 100) + "%" + ")" + "\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";
|
||||
|
@ -3,7 +3,6 @@ import Discord from "discord.js";
|
||||
module.exports = {
|
||||
name: 'status',
|
||||
description: 'Bot Status',
|
||||
permission: 'none',
|
||||
category: 'info',
|
||||
async execute(interaction, client) {
|
||||
let message = {};
|
||||
|
@ -3,11 +3,10 @@ import Discord from "discord.js";
|
||||
module.exports = {
|
||||
name: 'stop',
|
||||
description: 'Stop radio',
|
||||
permission: 'none',
|
||||
category: 'radio',
|
||||
async execute(interaction, client, command) {
|
||||
const radio = client.radio.get(interaction.guild.id);
|
||||
if (client.funcs.check(client, interaction, command)) {
|
||||
const radio = client.radio.get(interaction.guild.id);
|
||||
client.funcs.statisticsUpdate(client, interaction.guild, radio);
|
||||
radio.connection?.destroy();
|
||||
radio.audioPlayer?.stop();
|
||||
|
@ -1,65 +1,14 @@
|
||||
const { REST } = require('@discordjs/rest');
|
||||
const { Routes } = require('discord-api-types/v9');
|
||||
const { token, version } = require('../../config.js');
|
||||
|
||||
module.exports = {
|
||||
name: 'SIGINT',
|
||||
async execute(client) {
|
||||
execute(client) {
|
||||
client.user.setStatus('dnd');
|
||||
|
||||
console.log("\n");
|
||||
client.funcs.logger("Bot", "Closing");
|
||||
console.log("\n");
|
||||
client.funcs.saveRadios(client);
|
||||
|
||||
setTimeout(async function () {
|
||||
let message = {};
|
||||
|
||||
if (!client.stations) return process.exit();
|
||||
|
||||
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) {
|
||||
await client.funcs.statisticsUpdate(client, currentRadio.guild, currentRadio);
|
||||
await client.funcs.saveState(client, currentRadio.guild, currentRadio);
|
||||
currentRadio.connection?.destroy();
|
||||
currentRadio.audioPlayer?.stop();
|
||||
currentRadio.message?.delete();
|
||||
client.radio.delete(radio.value);
|
||||
}
|
||||
|
||||
radio = currentRadios.next();
|
||||
setInterval(() => {
|
||||
if(client.radio.size == 0){
|
||||
process.exit();
|
||||
}
|
||||
|
||||
/*const rest = new REST({ version: '9' }).setToken(token);
|
||||
if(version.includes("-dev")){
|
||||
await rest.put(
|
||||
Routes.applicationCommands(client.user.id),
|
||||
{ body: [] },
|
||||
);
|
||||
|
||||
let guilds = await client.guilds.fetch();
|
||||
guilds.forEach(async guild => {
|
||||
try {
|
||||
await rest.put(
|
||||
Routes.applicationGuildCommands(client.user.id, guild.id),
|
||||
{ body: [] }
|
||||
);
|
||||
} catch (DiscordAPIError) {
|
||||
|
||||
}
|
||||
});
|
||||
}*/
|
||||
|
||||
setInterval(() => {
|
||||
if(radio.done){
|
||||
process.exit();
|
||||
}
|
||||
}, 1000);
|
||||
}, 5000);
|
||||
}, 500);
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
module.exports = {
|
||||
name: 'SIGTERM',
|
||||
async execute(client) {
|
||||
execute(client) {
|
||||
process.emit('SIGINT');
|
||||
}
|
||||
}
|
@ -3,7 +3,12 @@ module.exports = {
|
||||
async execute(client, interaction) {
|
||||
|
||||
const permissions = interaction.channel.permissionsFor(interaction.client.user);
|
||||
if (!permissions.has('EMBED_LINKS')) return interaction.reply(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()){
|
||||
const commandName = interaction.commandName;
|
||||
|
@ -41,8 +41,11 @@ module.exports = {
|
||||
|
||||
let msg = await message.channel.send({ embeds: [embed] });
|
||||
|
||||
setTimeout(function() {
|
||||
msg.delete();
|
||||
setTimeout(async function() {
|
||||
try {
|
||||
await msg.delete();
|
||||
} catch (DiscordAPIError) {
|
||||
}
|
||||
}, 30000);
|
||||
} catch (error) {
|
||||
message.reply({
|
||||
|
@ -1,5 +1,6 @@
|
||||
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 = {
|
||||
name: 'ready',
|
||||
@ -94,9 +95,15 @@ module.exports = {
|
||||
require(`../commands.js`).execute(client);
|
||||
|
||||
setTimeout(function () {
|
||||
/*RESTORE RADIO*/
|
||||
require(`../restoreradio.js`).execute(client, guilds);
|
||||
/*RESTORE RADIOS*/
|
||||
client.funcs.restoreRadios(client, guilds);
|
||||
}, 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,13 @@ module.exports = function (client, interaction, command) {
|
||||
let message = {};
|
||||
const radio = client.radio.get(interaction.guild.id);
|
||||
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({
|
||||
@ -24,14 +31,6 @@ module.exports = function (client, interaction, command) {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if(!command.permission == 'none'){
|
||||
if (!permissions.has(command.permission)) {
|
||||
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;
|
||||
|
||||
return true;
|
||||
};
|
||||
|
@ -2,27 +2,16 @@ import Discord from "discord.js";
|
||||
|
||||
module.exports = function (client, interaction){
|
||||
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 => {
|
||||
stations = client.stations.forEach(station => {
|
||||
if(station.name == "GrooveFM") return;
|
||||
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);
|
||||
options.push(station);
|
||||
});
|
||||
|
||||
const menu = new Discord.MessageActionRow()
|
||||
@ -30,8 +19,7 @@ module.exports = function (client, interaction){
|
||||
new Discord.MessageSelectMenu()
|
||||
.setCustomId('play')
|
||||
.setPlaceholder('Nothing selected')
|
||||
.addOptions(options[1])
|
||||
.addOptions(options[2])
|
||||
.addOptions(options)
|
||||
);
|
||||
|
||||
stations = null;
|
||||
|
@ -27,7 +27,10 @@ module.exports = async function play(interaction, guild, client, url) {
|
||||
radio.connection?.destroy();
|
||||
radio.audioPlayer?.stop();
|
||||
client.radio.delete(guild.id);
|
||||
return interaction.reply(client.messages.errorPlaying);
|
||||
return interaction.reply({
|
||||
content: client.messages.errorPlaying,
|
||||
ephemeral: true
|
||||
});
|
||||
});
|
||||
|
||||
message.nowplayingDescription = client.messages.nowplayingDescription.replace("%radio.station.name%", radio.station.name);
|
||||
|
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();
|
||||
}
|
||||
}
|
@ -36,5 +36,6 @@ module.exports = {
|
||||
statusField5: "Hosted by",
|
||||
errorStationURL: "Station can't be URL",
|
||||
messageCommandsDeprecatedTitle: "%client.user.username%",
|
||||
messageCommandsDeprecatedDescription: "We recommend you to reauthorize our bot by clicking the invite link down below, because Discord is planning to remove message content from verified bots [Read More](https://support-dev.discord.com/hc/en-us/articles/4404772028055)" + "\n\n" + "**Invite Bot**" + "\n" + "https://wgi.fi/radiox_invite" + "\n\n" + "This bot now supports slash commands, you should start using them instead. Type / into the message box and select the bot you wish to use. Remember to be careful as there are a few bugs here and there on Discord." + "\n\n" + "We will remove this deprecation message in March of 2022 when RadioX 1.0.0 is released."
|
||||
messageCommandsDeprecatedDescription: "We recommend you to reauthorize our bot by clicking the invite link down below, because Discord is planning to remove message content from verified bots [Read More](https://support-dev.discord.com/hc/en-us/articles/4404772028055)" + "\n\n" + "**Invite Bot**" + "\n" + "https://wgi.fi/radiox_invite" + "\n\n" + "This bot now supports slash commands, you should start using them instead. Type / into the message box and select the bot you wish to use. Remember to be careful as there are a few bugs here and there on Discord." + "\n\n" + "We will remove this deprecation message in March of 2022 when RadioX 1.0.0 is released.",
|
||||
maintenance: "Shhhh... We are now sleeping and dreaming about new features to implement. Will be back soon."
|
||||
};
|
@ -1,61 +0,0 @@
|
||||
import Discord from "discord.js";
|
||||
const {
|
||||
createAudioPlayer,
|
||||
getVoiceConnection,
|
||||
joinVoiceChannel
|
||||
} = require("@discordjs/voice");
|
||||
|
||||
module.exports = {
|
||||
async execute(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;
|
||||
|
||||
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 {
|
||||
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();
|
||||
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -21,6 +21,6 @@ module.exports = {
|
||||
|
||||
//Settings
|
||||
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