Compare commits

..

42 Commits
0.3.5 ... 0.3.7

Author SHA1 Message Date
33e674f7c7 Merge pull request #53 from warengroup/develop
Version 0.3.7
2021-09-07 15:43:43 +03:00
d0c10018f3 Updated messageCreate event 2021-09-07 15:36:33 +03:00
523c94aafb Updated labeler workflow (Github Workflows) 2021-09-07 15:30:12 +03:00
ac42502883 Merge pull request #56 from warengroup/dependabot/npm_and_yarn/develop/types/node-16.7.13
Bump @types/node from 16.7.10 to 16.7.13
2021-09-07 13:21:40 +03:00
704596c371 Bump @types/node from 16.7.10 to 16.7.13
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.7.10 to 16.7.13.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-07 08:02:48 +00:00
4de241ecab Merge pull request #51 from warengroup/dependabot/npm_and_yarn/develop/typescript-eslint/parser-4.31.0
Bump @typescript-eslint/parser from 4.30.0 to 4.31.0
2021-09-06 23:06:36 +03:00
f70818c9f3 Bump @typescript-eslint/parser from 4.30.0 to 4.31.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.30.0 to 4.31.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.31.0/packages/parser)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-06 20:04:19 +00:00
6ad412000d Merge pull request #50 from warengroup/dependabot/npm_and_yarn/develop/typescript-eslint/eslint-plugin-4.31.0
Bump @typescript-eslint/eslint-plugin from 4.30.0 to 4.31.0
2021-09-06 23:03:16 +03:00
2804f942b7 Merge pull request #48 from warengroup/dependabot/github_actions/develop/actions/setup-node-2.4.0
Bump actions/setup-node from 2.3.1 to 2.4.0
2021-09-06 23:01:20 +03:00
561b365e44 Merge pull request #49 from warengroup/dependabot/github_actions/develop/docker/setup-buildx-action-1.6.0
Bump docker/setup-buildx-action from 1.5.1 to 1.6.0
2021-09-06 23:00:20 +03:00
9475c68682 Bumb Version 2021-09-06 22:52:24 +03:00
890df2c27c Bump @typescript-eslint/eslint-plugin from 4.30.0 to 4.31.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.30.0 to 4.31.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.31.0/packages/eslint-plugin)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-06 19:39:41 +00:00
cb1d2ca6b9 Bump docker/setup-buildx-action from 1.5.1 to 1.6.0
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v1.5.1...v1.6.0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-06 19:39:29 +00:00
f31ad5ceca Bump actions/setup-node from 2.3.1 to 2.4.0
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2.3.1 to 2.4.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2.3.1...v2.4.0)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-06 19:39:26 +00:00
8b5933749d Merge pull request #47 from warengroup/develop
Version 0.3.6
2021-09-06 22:39:05 +03:00
ab950352fa Added uncaughtException event 2021-09-06 22:35:49 +03:00
984e8aab76 Fixed prev command 2021-09-06 22:35:21 +03:00
cc8b44db9b Fixed next command 2021-09-06 22:35:14 +03:00
1371a83e90 Removed permissions property from commands 2021-09-06 21:56:19 +03:00
33e4a416a9 Updated saveRadios function 2021-09-06 21:46:59 +03:00
5bf4bd9a1c Updated maintenance command 2021-09-06 21:45:13 +03:00
4edfe6848c Updated SIGINT event 2021-09-06 21:44:59 +03:00
884233a938 Updated SIGTERM event 2021-09-06 21:44:45 +03:00
3ac284e237 Updated maintenance command 2021-09-06 20:42:14 +03:00
d1fe9177af Updated play.js 2021-09-06 19:43:28 +03:00
8316723a6a Added reload stations option in maintenance command 2021-09-06 19:43:14 +03:00
f9ce2bfaf9 Updated play command 2021-09-06 19:10:15 +03:00
a9857cb34b Updated play function 2021-09-06 19:09:34 +03:00
894a1d82f5 Updated play command 2021-09-06 18:38:46 +03:00
fa4f5e1e09 Updated labeler workflow (Github Workflows) 2021-09-06 18:07:00 +03:00
12c8b8558f Updated labeler config 2021-09-06 18:06:44 +03:00
bb8a36ad5c Added labeler config 2021-09-06 17:44:52 +03:00
ebeeadd5c3 Added labeler workflow (Github Workflows) 2021-09-06 17:38:43 +03:00
6e0b2f5092 Updated CodeQL Analyze workflow (Github Workflows) 2021-09-06 17:18:08 +03:00
2286815485 Renamed CodeQL Analyze workflow (Github Workflows) 2021-09-06 17:16:05 +03:00
2e402de6bf Added CodeQL Analysis workflow (Github Workflow) 2021-09-06 17:08:34 +03:00
45d68ff4ab Added dependabot config 2021-09-06 16:51:53 +03:00
370701a4b9 Updated Dependencies 2021-09-06 16:28:17 +03:00
956f1f7b6d Updated README.md 2021-09-06 16:19:56 +03:00
115a2e7589 Updated Dependencies 2021-09-06 16:06:17 +03:00
f9d195788c Changed interaction replies to ephemeral in commands 2021-09-06 14:42:49 +03:00
c673ae27f6 Bumb version 2021-09-06 05:48:34 +03:00
29 changed files with 342 additions and 192 deletions

19
.github/dependabot.yml vendored Normal file
View 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"

7
.github/labeler.yml vendored Normal file
View File

@ -0,0 +1,7 @@
dependencies:
- package-lock.json
documentation:
- README.md
- LICENSE
- .env_example

71
.github/workflows/codeql-analyze.yml vendored Normal file
View 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

View File

@ -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
View 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

View File

@ -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

View File

@ -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

198
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "eximiabots-radiox",
"version": "0.3.5",
"version": "0.3.7",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "eximiabots-radiox",
"version": "0.3.5",
"version": "0.3.7",
"license": "MIT",
"dependencies": {
"@discordjs/builders": "^0.6.0",
@ -17,14 +17,14 @@
"discord.js": "^13.1.0",
"dotenv": "^10.0.0",
"libsodium-wrappers": "^0.7.9",
"node-fetch": "^2.6.1",
"node-fetch": "^2.6.2",
"path": "^0.12.7"
},
"devDependencies": {
"@types/node": "^16.7.8",
"@types/node": "^16.7.13",
"@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"
}
},
@ -460,9 +460,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.7.13",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.13.tgz",
"integrity": "sha512-pLUPDn+YG3FYEt/pHI74HmnJOWzeR+tOIQzUx93pi9M7D8OE7PSLr97HboXwk5F+JS+TLtWuzCOW97AHjmOXXA=="
},
"node_modules/@types/ws": {
"version": "7.4.7",
@ -473,13 +473,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 +504,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 +528,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 +555,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 +572,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 +585,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 +612,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 +666,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"
@ -2535,9 +2535,9 @@
"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": "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"
}
@ -3549,9 +3549,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"
@ -4237,9 +4237,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.7.13",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.13.tgz",
"integrity": "sha512-pLUPDn+YG3FYEt/pHI74HmnJOWzeR+tOIQzUx93pi9M7D8OE7PSLr97HboXwk5F+JS+TLtWuzCOW97AHjmOXXA=="
},
"@types/ws": {
"version": "7.4.7",
@ -4250,13 +4250,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 +4265,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 +4322,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 +4358,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": {
@ -5797,9 +5797,9 @@
"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": "2.6.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA=="
},
"nodemon": {
"version": "2.0.12",
@ -6516,9 +6516,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
}
}

View File

@ -1,6 +1,6 @@
{
"name": "eximiabots-radiox",
"version": "0.3.5",
"version": "0.3.7",
"description": "Internet Radio to your Discord guild",
"main": "index.js",
"scripts": {
@ -26,14 +26,14 @@
"discord.js": "^13.1.0",
"dotenv": "^10.0.0",
"libsodium-wrappers": "^0.7.9",
"node-fetch": "^2.6.1",
"node-fetch": "^2.6.2",
"path": "^0.12.7"
},
"devDependencies": {
"@types/node": "^16.7.8",
"@types/node": "^16.7.13",
"@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"
}
}

View File

@ -85,6 +85,10 @@ class RadioClient extends Client {
process.on('SIGTERM', () => {
require(`${events}SIGTERM`).execute(this);
});
process.on('uncaughtException', (error) => {
require(`${events}uncaughtException`).execute(this, error);
});
this.on("error", error => {
console.error(error);

View File

@ -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 = {};

View File

@ -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 = {};

View File

@ -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 = {};

View File

@ -3,13 +3,15 @@ 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);

View File

@ -1,9 +1,9 @@
import Discord from "discord.js";
import fetch from "node-fetch";
module.exports = {
name: 'maintenance',
description: 'Bot Maintenance',
permission: 'none',
category: 'info',
options: [
{ type: "NUMBER", name: "action", description: "Select action", required: false}
@ -11,7 +11,10 @@ module.exports = {
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.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(
{
@ -38,6 +41,12 @@ module.exports = {
description: "",
value: "6"
},
{
emoji: "<:RadioXList:688541155519889482>",
label: "Reload Stations",
description: "",
value: "7"
},
{
emoji: "<:dnd:746069698139127831>",
label: "Enable Maintenance Mode",
@ -87,17 +96,13 @@ module.exports = {
break;
case "4":
client.user.setStatus('idle');
setTimeout(function () {
client.funcs.saveRadios(client);
}, 5000);
client.funcs.saveRadios(client);
client.user.setStatus('online');
break;
case "5":
client.user.setStatus('idle');
let guilds = await client.guilds.fetch();
setTimeout(function () {
client.funcs.restoreRadios(client, guilds);
}, 5000);
client.funcs.restoreRadios(client, guilds);
client.user.setStatus('online');
break;
case "6":
@ -105,6 +110,18 @@ module.exports = {
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');
break;

View File

@ -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);
}
}
}

View File

@ -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)) {

View File

@ -11,13 +11,15 @@ module.exports = {
options: [
{ type: "STRING", name: "query", description: "Select station", required: false}
],
permission: "none",
category: "radio",
async 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
});
}
let query = interaction.options?.getString("query") ?? interaction.values?.[0];
@ -27,26 +29,32 @@ module.exports = {
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 (!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(client.messages.noQuery);
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);
@ -66,17 +74,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;
}
@ -129,7 +135,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
});
}
}
};

View File

@ -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);
}
}
}

View File

@ -4,7 +4,6 @@ import Discord from "discord.js";
module.exports = {
name: 'statistics',
description: 'Show statistics',
permission: 'none',
category: 'info',
execute(interaction, client) {
let message = {};
@ -15,7 +14,10 @@ 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){

View File

@ -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 = {};

View File

@ -3,7 +3,6 @@ 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);

View File

@ -1,23 +1,18 @@
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();
await client.funcs.saveRadios(client);
await process.exit();
}, 5000);
setInterval(() => {
if(client.radio.size == 0){
process.exit();
}
}, 500);
}
}

View File

@ -1,6 +1,6 @@
module.exports = {
name: 'SIGTERM',
async execute(client) {
execute(client) {
process.emit('SIGINT');
}
}

View File

@ -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({

View File

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

View File

@ -24,14 +24,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;
};

View File

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

View File

@ -1,4 +1,4 @@
module.exports = async function saveRadios(client) {
module.exports = function saveRadios(client) {
let currentRadios = client.radio.keys();
let radio = currentRadios.next();
@ -7,8 +7,8 @@ module.exports = async function saveRadios(client) {
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);
client.funcs.statisticsUpdate(client, currentRadio.guild, currentRadio);
client.funcs.saveState(client, currentRadio.guild, currentRadio);
currentRadio.connection?.destroy();
currentRadio.audioPlayer?.stop();
currentRadio.message?.delete();