Compare commits

...

81 Commits
0.2.2 ... 0.3.0

Author SHA1 Message Date
0f184a9fc6 Merge pull request #25 from warengroup/develop
Version 0.3.0
2021-08-31 17:39:49 +03:00
ec651a681c Updated list.js 2021-08-31 15:55:36 +03:00
fe165f03c6 List developers in ready.js 2021-08-31 13:59:38 +03:00
73e2427a21 Updated ready.js 2021-08-31 13:53:23 +03:00
47ed5b7e04 Merge branch 'master' into develop 2021-08-31 12:48:54 +03:00
34b7bf8f19 Merge pull request #31 from warengroup/v0.2.4
Version 0.2.4
2021-08-31 12:33:31 +03:00
18a03d50ee Updated Dependencies 2021-08-31 12:20:47 +03:00
6c89770d16 Removed createDiscordJSAdapter 2021-08-31 12:18:58 +03:00
79acdc9687 Changed button style in play.js 2021-08-31 12:13:49 +03:00
0c93814013 Added selectMenu when no query in play.js 2021-08-31 11:56:50 +03:00
1c9ad75b8e Updated interactionCreate event 2021-08-31 11:55:57 +03:00
277b67e3df Making interaction.options nullable in play.js 2021-08-31 10:48:04 +03:00
b5d5ca1fe6 Updated interactionCreate event 2021-08-31 10:47:39 +03:00
5df88494b0 Updated logger in ready.js line 30 2021-08-31 10:38:48 +03:00
7a93cd001f Edited embed message and delete components when stopping radio 2021-08-31 10:38:21 +03:00
bdc76b73a7 Edited options & added buttons in play.js 2021-08-31 10:37:47 +03:00
25e9ebbd4e Added new emojis 2021-08-31 10:37:20 +03:00
c4c2461175 Updated Dependencies 2021-08-31 10:37:12 +03:00
e2d74c10ea Updated Dependencies 2021-08-28 18:21:50 +03:00
f0dcd76033 Update 2021-08-28 11:07:47 +03:00
5f5b164e0d Updated stop.js 2021-08-27 04:59:23 +03:00
1358787793 Updated play.js 2021-08-27 04:59:15 +03:00
42591791c3 Fixed typos in ready.ts 2021-08-27 02:52:30 +03:00
c539a63011 Updated Dependencies 2021-08-27 02:52:19 +03:00
33c41233da Updated Dockerfile 2021-08-27 02:11:49 +03:00
32ac31a8af Updated TypeScript Build workflow (Github Workflows) 2021-08-27 02:11:09 +03:00
0b7da1937b Removed createDiscordJSAdapter 2021-08-27 01:38:33 +03:00
ee13f11f71 Ephemeral reply to nowplaying.js 2021-08-27 00:34:17 +03:00
a6d1f68191 Small fix in play.js 2021-08-26 23:33:28 +03:00
0ac8491a96 Customizing searchStation function in play.js 2021-08-26 23:15:55 +03:00
a36f3bf90d Updated TypeScript Build workflow (Github Workflows) 2021-08-26 22:55:08 +03:00
c08d5650ec Fixed nowplaying command 2021-08-26 22:25:31 +03:00
3488d8e737 Updated nowplaying.js 2021-08-26 22:06:41 +03:00
96e1ce82ae Updated logger function 2021-08-26 22:06:26 +03:00
4498efcdcd Ephemeral replies 2021-08-26 22:06:15 +03:00
294aa28849 Fix commands.js 2021-08-26 21:50:15 +03:00
f0887514af Fixing indentations in multiple commands 2021-08-26 18:14:15 +03:00
8d15567f85 Removed comments in interactionCreate.js 2021-08-26 18:10:45 +03:00
fbbd901cbd Updated Dependencies 2021-08-26 18:05:44 +03:00
fcb5f4f6e6 Moved SlashCommandBuilder to commands.js 2021-08-26 18:00:04 +03:00
bd70f2bedc Removed comments in help.js 2021-08-26 17:02:11 +03:00
4ba582295b Removed second variable from msToTime in multiple files 2021-08-25 23:05:06 +03:00
d524649ad5 Updated msToTime function 2021-08-25 22:45:37 +03:00
ca494df400 Updated msToTime function 2021-08-25 22:39:44 +03:00
6ec4a068f9 Updated Dependencies 2021-08-25 22:21:15 +03:00
b8c1816b1c Added logger to voiceStateUpdate.js 2021-08-22 20:51:02 +03:00
c5f269c0a7 Added logger to ready.js 2021-08-22 20:50:48 +03:00
b979d26425 Added logger to stop.js 2021-08-22 20:50:14 +03:00
f18776ce1a Added logger to play.js 2021-08-22 20:50:02 +03:00
8168650f69 Updated maintenance command 2021-08-22 20:49:43 +03:00
dd37b3447f Added logging to commands.js 2021-08-22 20:49:11 +03:00
b03c6fd3b0 Created logger function 2021-08-22 20:47:40 +03:00
7810f6fff8 Updated help command 2021-08-22 19:00:19 +03:00
2fec81e84d Updated code 2021-08-22 18:48:40 +03:00
606dcc0ab3 Hiding help subcommands 2021-08-22 14:54:40 +03:00
727cae13b4 Merge branch 'master' into develop 2021-08-21 19:43:57 +03:00
dc5a9d4e71 Merge pull request #29 from warengroup/v0.2.3
Version 0.2.3
2021-08-21 19:31:46 +03:00
e479e5a82a Updated Dependencies 2021-08-21 19:17:31 +03:00
6afe6c30f9 Fixed help command 2021-08-21 19:12:52 +03:00
17161b72b9 Updated helpDescription message 2021-08-21 19:12:18 +03:00
3cb54c9470 Nulling connection after bot is disconnected 2021-08-21 18:29:59 +03:00
9533748f0f Added version to console.log in ready.js 2021-08-21 17:56:33 +03:00
42b8f52834 Required commands to load when bot is ready 2021-08-21 17:55:52 +03:00
8785d0c715 Updated commands.js 2021-08-21 17:55:10 +03:00
1706007088 Updated Dependencies 2021-08-21 15:58:07 +03:00
7ccd72cc6d Merge branch 'master' into develop 2021-08-21 15:24:33 +03:00
0a269aac94 Updated commands.js 2021-08-19 02:01:06 +03:00
4b10736508 Updated check.js 2021-08-19 01:59:55 +03:00
97317449f9 Updated play.js 2021-08-19 01:59:47 +03:00
0b7c04d242 Updated check.js 2021-08-19 01:53:04 +03:00
63e99dd2b3 Updated ready.js 2021-08-19 01:52:55 +03:00
d5b8d67064 Removed message event 2021-08-19 01:52:46 +03:00
ce5351c3f4 Added interactionCreate event 2021-08-19 01:52:31 +03:00
2d68eb1ffd Updated commands 2021-08-19 01:52:16 +03:00
cecadb2bef Updated commands.js 2021-08-19 01:50:56 +03:00
c5d5d28475 Updated config.js 2021-08-19 01:50:45 +03:00
9e6d60bde8 Updated Client.ts 2021-08-19 01:50:35 +03:00
76fe1aaae9 Added new dependencies 2021-08-19 01:50:03 +03:00
684a87c398 Disabled message commands 2021-08-19 00:01:13 +03:00
8c35d71818 Updated Invite Link 2021-08-18 23:57:59 +03:00
03248bcfa8 Updated dependencies 2021-08-18 23:46:35 +03:00
27 changed files with 867 additions and 467 deletions

View File

@ -2,7 +2,6 @@ name: TypeScript Build
on: on:
push: push:
pull_request:
jobs: jobs:
tsc: tsc:
@ -14,8 +13,6 @@ jobs:
uses: actions/setup-node@v2.3.1 uses: actions/setup-node@v2.3.1
with: with:
node-version: 16 node-version: 16
- name: npm install -g npm
run: npm install -g npm
- name: npm install - name: npm install
run: npm install run: npm install
- name: tsc - name: tsc

View File

@ -10,8 +10,6 @@ WORKDIR /usr/src/app
COPY / /usr/src/app/ COPY / /usr/src/app/
RUN npm install -g npm
RUN npm install RUN npm install
RUN npm run build RUN npm run build

506
package-lock.json generated
View File

@ -1,15 +1,17 @@
{ {
"name": "eximiabots-radiox", "name": "eximiabots-radiox",
"version": "0.2.2", "version": "0.3.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "eximiabots-radiox", "name": "eximiabots-radiox",
"version": "0.2.2", "version": "0.3.0",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@discordjs/opus": "^0.5.3", "@discordjs/builders": "^0.6.0",
"@discordjs/opus": "^0.6.0",
"@discordjs/rest": "^0.1.1-canary.0",
"@discordjs/voice": "^0.6.0", "@discordjs/voice": "^0.6.0",
"discord-api-types": "^0.22.0", "discord-api-types": "^0.22.0",
"discord.js": "^13.1.0", "discord.js": "^13.1.0",
@ -19,19 +21,19 @@
"path": "^0.12.7" "path": "^0.12.7"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^16.6.1", "@types/node": "^16.7.8",
"@types/ws": "^7.4.7", "@types/ws": "^7.4.7",
"@typescript-eslint/eslint-plugin": "^4.29.2", "@typescript-eslint/eslint-plugin": "^4.29.3",
"@typescript-eslint/parser": "^4.29.2", "@typescript-eslint/parser": "^4.29.3",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "^4.0.0",
"nodemon": "^2.0.12", "nodemon": "^2.0.12",
"prettier": "^2.3.2", "prettier": "^2.3.2",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"ts-node": "^10.1.0", "ts-node": "^10.2.1",
"tsc-watch": "^4.4.0", "tsc-watch": "^4.5.0",
"typescript": "^4.3.5" "typescript": "^4.4.2"
}, },
"engines": { "engines": {
"node": ">=16.6.0", "node": ">=16.6.0",
@ -163,15 +165,15 @@
} }
}, },
"node_modules/@discordjs/builders": { "node_modules/@discordjs/builders": {
"version": "0.5.0", "version": "0.6.0",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.5.0.tgz", "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.6.0.tgz",
"integrity": "sha512-HP5y4Rqw68o61Qv4qM5tVmDbWi4mdTFftqIOGRo33SNPpLJ1Ga3KEIR2ibKofkmsoQhEpLmopD1AZDs3cKpHuw==", "integrity": "sha512-mH3Gx61LKk2CD05laCI9K5wp+a3NyASHDUGx83DGJFkqJlRlSV5WMJNY6RS37A5SjqDtGMF4wVR9jzFaqShe6Q==",
"dependencies": { "dependencies": {
"@sindresorhus/is": "^4.0.1", "@sindresorhus/is": "^4.0.1",
"discord-api-types": "^0.22.0", "discord-api-types": "^0.22.0",
"ow": "^0.27.0", "ow": "^0.27.0",
"ts-mixer": "^6.0.0", "ts-mixer": "^6.0.0",
"tslib": "^2.3.0" "tslib": "^2.3.1"
}, },
"engines": { "engines": {
"node": ">=14.0.0", "node": ">=14.0.0",
@ -219,18 +221,36 @@
} }
}, },
"node_modules/@discordjs/opus": { "node_modules/@discordjs/opus": {
"version": "0.5.3", "version": "0.6.0",
"resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.5.3.tgz", "resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.6.0.tgz",
"integrity": "sha512-IQhCwCy2WKXLe+qkOkwO1Wjgk20uqeAbqM62tCbzIqbTsXX4YAge8Me9RFnI77Lx+UTkgm4rSVM3VPVdS/GsUw==", "integrity": "sha512-Xuw8OP9BJgObEBs/SgxixnKj+y+w9st45uOAJ+cGegUGwxAIR4J7sQt3Y1J3G9SGGe82+MTxvy7sg1/QUkigcg==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@discordjs/node-pre-gyp": "^0.4.0", "@discordjs/node-pre-gyp": "^0.4.1",
"node-addon-api": "^3.2.1" "node-addon-api": "^4.0.0"
}, },
"engines": { "engines": {
"node": ">=12.0.0" "node": ">=12.0.0"
} }
}, },
"node_modules/@discordjs/rest": {
"version": "0.1.1-canary.0",
"resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-0.1.1-canary.0.tgz",
"integrity": "sha512-zUhGBok8eVJYkQjhOVTxVKwglQd0lElhkwCfvRus5xVD46zyz4h0UzoZFVpeAb9GNaAmEazcw/j/2s07DnQcnw==",
"dependencies": {
"@discordjs/collection": "^0.2.1",
"@sapphire/async-queue": "^1.1.4",
"@sapphire/snowflake": "^2.0.0",
"abort-controller": "^3.0.0",
"discord-api-types": "^0.22.0",
"form-data": "^4.0.0",
"node-fetch": "^2.6.1",
"tslib": "^2.3.0"
},
"engines": {
"node": ">=16.0.0"
}
},
"node_modules/@discordjs/voice": { "node_modules/@discordjs/voice": {
"version": "0.6.0", "version": "0.6.0",
"resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.6.0.tgz", "resolved": "https://registry.npmjs.org/@discordjs/voice/-/voice-0.6.0.tgz",
@ -246,6 +266,53 @@
"node": ">=16.0.0" "node": ">=16.0.0"
} }
}, },
"node_modules/@discordjs/voice/node_modules/@discordjs/opus": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.5.3.tgz",
"integrity": "sha512-IQhCwCy2WKXLe+qkOkwO1Wjgk20uqeAbqM62tCbzIqbTsXX4YAge8Me9RFnI77Lx+UTkgm4rSVM3VPVdS/GsUw==",
"hasInstallScript": true,
"optional": true,
"peer": true,
"dependencies": {
"@discordjs/node-pre-gyp": "^0.4.0",
"node-addon-api": "^3.2.1"
},
"engines": {
"node": ">=12.0.0"
}
},
"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",
"integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==",
"optional": true,
"peer": true
},
"node_modules/@discordjs/voice/node_modules/prism-media": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.2.tgz",
"integrity": "sha512-L6UsGHcT6i4wrQhFF1aPK+MNYgjRqR2tUoIqEY+CG1NqVkMjPRKzS37j9f8GiYPlD6wG9ruBj+q5Ax+bH8Ik1g==",
"peerDependencies": {
"@discordjs/opus": "^0.5.0",
"ffmpeg-static": "^4.2.7 || ^3.0.0 || ^2.4.0",
"node-opus": "^0.3.3",
"opusscript": "^0.0.8"
},
"peerDependenciesMeta": {
"@discordjs/opus": {
"optional": true
},
"ffmpeg-static": {
"optional": true
},
"node-opus": {
"optional": true
},
"opusscript": {
"optional": true
}
}
},
"node_modules/@eslint/eslintrc": { "node_modules/@eslint/eslintrc": {
"version": "0.4.3", "version": "0.4.3",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz",
@ -330,6 +397,15 @@
"npm": ">=6" "npm": ">=6"
} }
}, },
"node_modules/@sapphire/snowflake": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-2.0.0.tgz",
"integrity": "sha512-gPSOQKmEWeuif2ftmW7gyToCnOoqpDqTSNrxX7HsoMwGNLtrT9p5DHcQolkBg5CEK3ooDFy5DNEFKUshQU7vyQ==",
"engines": {
"node": ">=12",
"npm": ">=6"
}
},
"node_modules/@sindresorhus/is": { "node_modules/@sindresorhus/is": {
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.1.tgz", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.1.tgz",
@ -384,9 +460,9 @@
"dev": true "dev": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "16.7.1", "version": "16.7.8",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.1.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.8.tgz",
"integrity": "sha512-ncRdc45SoYJ2H4eWU9ReDfp3vtFqDYhjOsKlFFUDEn8V1Bgr2RjYal8YT5byfadWIRluhPFU6JiDOl0H6Sl87A==" "integrity": "sha512-8upnoQU0OPzbIkm+ZMM0zCeFCkw2s3mS0IWdx0+AAaWqm4fkBb0UJp8Edl7FVKRamYbpJC/aVsHpKWBIbiC7Zg=="
}, },
"node_modules/@types/ws": { "node_modules/@types/ws": {
"version": "7.4.7", "version": "7.4.7",
@ -397,13 +473,13 @@
} }
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
"version": "4.29.2", "version": "4.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.30.0.tgz",
"integrity": "sha512-x4EMgn4BTfVd9+Z+r+6rmWxoAzBaapt4QFqE+d8L8sUtYZYLDTK6VG/y/SMMWA5t1/BVU5Kf+20rX4PtWzUYZg==", "integrity": "sha512-NgAnqk55RQ/SD+tZFD9aPwNSeHmDHHe5rtUyhIq0ZeCWZEvo4DK9rYz7v9HDuQZFvn320Ot+AikaCKMFKLlD0g==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/experimental-utils": "4.29.2", "@typescript-eslint/experimental-utils": "4.30.0",
"@typescript-eslint/scope-manager": "4.29.2", "@typescript-eslint/scope-manager": "4.30.0",
"debug": "^4.3.1", "debug": "^4.3.1",
"functional-red-black-tree": "^1.0.1", "functional-red-black-tree": "^1.0.1",
"regexpp": "^3.1.0", "regexpp": "^3.1.0",
@ -428,15 +504,15 @@
} }
}, },
"node_modules/@typescript-eslint/experimental-utils": { "node_modules/@typescript-eslint/experimental-utils": {
"version": "4.29.2", "version": "4.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.30.0.tgz",
"integrity": "sha512-P6mn4pqObhftBBPAv4GQtEK7Yos1fz/MlpT7+YjH9fTxZcALbiiPKuSIfYP/j13CeOjfq8/fr9Thr2glM9ub7A==", "integrity": "sha512-K8RNIX9GnBsv5v4TjtwkKtqMSzYpjqAQg/oSphtxf3xxdt6T0owqnpojztjjTcatSteH3hLj3t/kklKx87NPqw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/json-schema": "^7.0.7", "@types/json-schema": "^7.0.7",
"@typescript-eslint/scope-manager": "4.29.2", "@typescript-eslint/scope-manager": "4.30.0",
"@typescript-eslint/types": "4.29.2", "@typescript-eslint/types": "4.30.0",
"@typescript-eslint/typescript-estree": "4.29.2", "@typescript-eslint/typescript-estree": "4.30.0",
"eslint-scope": "^5.1.1", "eslint-scope": "^5.1.1",
"eslint-utils": "^3.0.0" "eslint-utils": "^3.0.0"
}, },
@ -452,14 +528,14 @@
} }
}, },
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "4.29.2", "version": "4.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.30.0.tgz",
"integrity": "sha512-WQ6BPf+lNuwteUuyk1jD/aHKqMQ9jrdCn7Gxt9vvBnzbpj7aWEf+aZsJ1zvTjx5zFxGCt000lsbD9tQPEL8u6g==", "integrity": "sha512-HJ0XuluSZSxeboLU7Q2VQ6eLlCwXPBOGnA7CqgBnz2Db3JRQYyBDJgQnop6TZ+rsbSx5gEdWhw4rE4mDa1FnZg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "4.29.2", "@typescript-eslint/scope-manager": "4.30.0",
"@typescript-eslint/types": "4.29.2", "@typescript-eslint/types": "4.30.0",
"@typescript-eslint/typescript-estree": "4.29.2", "@typescript-eslint/typescript-estree": "4.30.0",
"debug": "^4.3.1" "debug": "^4.3.1"
}, },
"engines": { "engines": {
@ -479,13 +555,13 @@
} }
}, },
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "4.29.2", "version": "4.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.30.0.tgz",
"integrity": "sha512-mfHmvlQxmfkU8D55CkZO2sQOueTxLqGvzV+mG6S/6fIunDiD2ouwsAoiYCZYDDK73QCibYjIZmGhpvKwAB5BOA==", "integrity": "sha512-VJ/jAXovxNh7rIXCQbYhkyV2Y3Ac/0cVHP/FruTJSAUUm4Oacmn/nkN5zfWmWFEanN4ggP0vJSHOeajtHq3f8A==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "4.29.2", "@typescript-eslint/types": "4.30.0",
"@typescript-eslint/visitor-keys": "4.29.2" "@typescript-eslint/visitor-keys": "4.30.0"
}, },
"engines": { "engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1" "node": "^8.10.0 || ^10.13.0 || >=11.10.1"
@ -496,9 +572,9 @@
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/types": {
"version": "4.29.2", "version": "4.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.30.0.tgz",
"integrity": "sha512-K6ApnEXId+WTGxqnda8z4LhNMa/pZmbTFkDxEBLQAbhLZL50DjeY0VIDCml/0Y3FlcbqXZrABqrcKxq+n0LwzQ==", "integrity": "sha512-YKldqbNU9K4WpTNwBqtAerQKLLW/X2A/j4yw92e3ZJYLx+BpKLeheyzoPfzIXHfM8BXfoleTdiYwpsvVPvHrDw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1" "node": "^8.10.0 || ^10.13.0 || >=11.10.1"
@ -509,13 +585,13 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/typescript-estree": {
"version": "4.29.2", "version": "4.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.30.0.tgz",
"integrity": "sha512-TJ0/hEnYxapYn9SGn3dCnETO0r+MjaxtlWZ2xU+EvytF0g4CqTpZL48SqSNn2hXsPolnewF30pdzR9a5Lj3DNg==", "integrity": "sha512-6WN7UFYvykr/U0Qgy4kz48iGPWILvYL34xXJxvDQeiRE018B7POspNRVtAZscWntEPZpFCx4hcz/XBT+erenfg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "4.29.2", "@typescript-eslint/types": "4.30.0",
"@typescript-eslint/visitor-keys": "4.29.2", "@typescript-eslint/visitor-keys": "4.30.0",
"debug": "^4.3.1", "debug": "^4.3.1",
"globby": "^11.0.3", "globby": "^11.0.3",
"is-glob": "^4.0.1", "is-glob": "^4.0.1",
@ -536,12 +612,12 @@
} }
}, },
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/visitor-keys": {
"version": "4.29.2", "version": "4.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.30.0.tgz",
"integrity": "sha512-bDgJLQ86oWHJoZ1ai4TZdgXzJxsea3Ee9u9wsTAvjChdj2WLcVsgWYAPeY7RQMn16tKrlQaBnpKv7KBfs4EQag==", "integrity": "sha512-pNaaxDt/Ol/+JZwzP7MqWc8PJQTUhZwoee/PVlQ+iYoYhagccvoHnC9e4l+C/krQYYkENxznhVSDwClIbZVxRw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "4.29.2", "@typescript-eslint/types": "4.30.0",
"eslint-visitor-keys": "^2.0.0" "eslint-visitor-keys": "^2.0.0"
}, },
"engines": { "engines": {
@ -557,6 +633,17 @@
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
}, },
"node_modules/abort-controller": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
"dependencies": {
"event-target-shim": "^5.0.0"
},
"engines": {
"node": ">=6.5"
}
},
"node_modules/acorn": { "node_modules/acorn": {
"version": "7.4.1", "version": "7.4.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
@ -1226,6 +1313,22 @@
"npm": ">=7.0.0" "npm": ">=7.0.0"
} }
}, },
"node_modules/discord.js/node_modules/@discordjs/builders": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.5.0.tgz",
"integrity": "sha512-HP5y4Rqw68o61Qv4qM5tVmDbWi4mdTFftqIOGRo33SNPpLJ1Ga3KEIR2ibKofkmsoQhEpLmopD1AZDs3cKpHuw==",
"dependencies": {
"@sindresorhus/is": "^4.0.1",
"discord-api-types": "^0.22.0",
"ow": "^0.27.0",
"ts-mixer": "^6.0.0",
"tslib": "^2.3.0"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/doctrine": { "node_modules/doctrine": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
@ -1390,9 +1493,9 @@
} }
}, },
"node_modules/eslint-plugin-prettier": { "node_modules/eslint-plugin-prettier": {
"version": "3.4.1", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz",
"integrity": "sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g==", "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"prettier-linter-helpers": "^1.0.0" "prettier-linter-helpers": "^1.0.0"
@ -1401,8 +1504,8 @@
"node": ">=6.0.0" "node": ">=6.0.0"
}, },
"peerDependencies": { "peerDependencies": {
"eslint": ">=5.0.0", "eslint": ">=7.28.0",
"prettier": ">=1.13.0" "prettier": ">=2.0.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"eslint-config-prettier": { "eslint-config-prettier": {
@ -1585,6 +1688,14 @@
"through": "~2.3.1" "through": "~2.3.1"
} }
}, },
"node_modules/event-target-shim": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
"engines": {
"node": ">=6"
}
},
"node_modules/fast-deep-equal": { "node_modules/fast-deep-equal": {
"version": "3.1.3", "version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
@ -1677,6 +1788,19 @@
"integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==",
"dev": true "dev": true
}, },
"node_modules/form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/from": { "node_modules/from": {
"version": "0.1.7", "version": "0.1.7",
"resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz",
@ -2407,9 +2531,9 @@
"dev": true "dev": true
}, },
"node_modules/node-addon-api": { "node_modules/node-addon-api": {
"version": "3.2.1", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.1.0.tgz",
"integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" "integrity": "sha512-Zz1o1BDX2VtduiAt6kgiUl8jX1Vm3NMboljFYKQJ6ee8AGfiTvM2mlZFI3xPbqjs80rCQgiVJI/DjQ/1QJ0HwA=="
}, },
"node_modules/node-cleanup": { "node_modules/node-cleanup": {
"version": "2.1.2", "version": "2.1.2",
@ -2742,31 +2866,6 @@
"node": ">=6.0.0" "node": ">=6.0.0"
} }
}, },
"node_modules/prism-media": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.2.tgz",
"integrity": "sha512-L6UsGHcT6i4wrQhFF1aPK+MNYgjRqR2tUoIqEY+CG1NqVkMjPRKzS37j9f8GiYPlD6wG9ruBj+q5Ax+bH8Ik1g==",
"peerDependencies": {
"@discordjs/opus": "^0.5.0",
"ffmpeg-static": "^4.2.7 || ^3.0.0 || ^2.4.0",
"node-opus": "^0.3.3",
"opusscript": "^0.0.8"
},
"peerDependenciesMeta": {
"@discordjs/opus": {
"optional": true
},
"ffmpeg-static": {
"optional": true
},
"node-opus": {
"optional": true
},
"opusscript": {
"optional": true
}
}
},
"node_modules/process": { "node_modules/process": {
"version": "0.11.10", "version": "0.11.10",
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
@ -3307,9 +3406,9 @@
} }
}, },
"node_modules/tar": { "node_modules/tar": {
"version": "6.1.10", "version": "6.1.11",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.10.tgz", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz",
"integrity": "sha512-kvvfiVvjGMxeUNB6MyYv5z7vhfFRwbwCXJAeL0/lnbrttBVqcMOnpHUf0X42LrPMR8mMpgapkJMchFH4FSHzNA==", "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==",
"dependencies": { "dependencies": {
"chownr": "^2.0.0", "chownr": "^2.0.0",
"fs-minipass": "^2.0.0", "fs-minipass": "^2.0.0",
@ -3542,9 +3641,9 @@
} }
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "4.3.5", "version": "4.4.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz",
"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", "integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==",
"dev": true, "dev": true,
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
@ -3774,9 +3873,9 @@
} }
}, },
"node_modules/ws": { "node_modules/ws": {
"version": "7.5.3", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.4.tgz",
"integrity": "sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg==", "integrity": "sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg==",
"engines": { "engines": {
"node": ">=8.3.0" "node": ">=8.3.0"
}, },
@ -3918,15 +4017,15 @@
} }
}, },
"@discordjs/builders": { "@discordjs/builders": {
"version": "0.5.0", "version": "0.6.0",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.5.0.tgz", "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.6.0.tgz",
"integrity": "sha512-HP5y4Rqw68o61Qv4qM5tVmDbWi4mdTFftqIOGRo33SNPpLJ1Ga3KEIR2ibKofkmsoQhEpLmopD1AZDs3cKpHuw==", "integrity": "sha512-mH3Gx61LKk2CD05laCI9K5wp+a3NyASHDUGx83DGJFkqJlRlSV5WMJNY6RS37A5SjqDtGMF4wVR9jzFaqShe6Q==",
"requires": { "requires": {
"@sindresorhus/is": "^4.0.1", "@sindresorhus/is": "^4.0.1",
"discord-api-types": "^0.22.0", "discord-api-types": "^0.22.0",
"ow": "^0.27.0", "ow": "^0.27.0",
"ts-mixer": "^6.0.0", "ts-mixer": "^6.0.0",
"tslib": "^2.3.0" "tslib": "^2.3.1"
} }
}, },
"@discordjs/collection": { "@discordjs/collection": {
@ -3961,12 +4060,27 @@
} }
}, },
"@discordjs/opus": { "@discordjs/opus": {
"version": "0.5.3", "version": "0.6.0",
"resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.5.3.tgz", "resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.6.0.tgz",
"integrity": "sha512-IQhCwCy2WKXLe+qkOkwO1Wjgk20uqeAbqM62tCbzIqbTsXX4YAge8Me9RFnI77Lx+UTkgm4rSVM3VPVdS/GsUw==", "integrity": "sha512-Xuw8OP9BJgObEBs/SgxixnKj+y+w9st45uOAJ+cGegUGwxAIR4J7sQt3Y1J3G9SGGe82+MTxvy7sg1/QUkigcg==",
"requires": { "requires": {
"@discordjs/node-pre-gyp": "^0.4.0", "@discordjs/node-pre-gyp": "^0.4.1",
"node-addon-api": "^3.2.1" "node-addon-api": "^4.0.0"
}
},
"@discordjs/rest": {
"version": "0.1.1-canary.0",
"resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-0.1.1-canary.0.tgz",
"integrity": "sha512-zUhGBok8eVJYkQjhOVTxVKwglQd0lElhkwCfvRus5xVD46zyz4h0UzoZFVpeAb9GNaAmEazcw/j/2s07DnQcnw==",
"requires": {
"@discordjs/collection": "^0.2.1",
"@sapphire/async-queue": "^1.1.4",
"@sapphire/snowflake": "^2.0.0",
"abort-controller": "^3.0.0",
"discord-api-types": "^0.22.0",
"form-data": "^4.0.0",
"node-fetch": "^2.6.1",
"tslib": "^2.3.0"
} }
}, },
"@discordjs/voice": { "@discordjs/voice": {
@ -3979,6 +4093,32 @@
"prism-media": "^1.3.1", "prism-media": "^1.3.1",
"tiny-typed-emitter": "^2.0.3", "tiny-typed-emitter": "^2.0.3",
"ws": "^7.4.4" "ws": "^7.4.4"
},
"dependencies": {
"@discordjs/opus": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/@discordjs/opus/-/opus-0.5.3.tgz",
"integrity": "sha512-IQhCwCy2WKXLe+qkOkwO1Wjgk20uqeAbqM62tCbzIqbTsXX4YAge8Me9RFnI77Lx+UTkgm4rSVM3VPVdS/GsUw==",
"optional": true,
"peer": true,
"requires": {
"@discordjs/node-pre-gyp": "^0.4.0",
"node-addon-api": "^3.2.1"
}
},
"node-addon-api": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
"integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==",
"optional": true,
"peer": true
},
"prism-media": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.2.tgz",
"integrity": "sha512-L6UsGHcT6i4wrQhFF1aPK+MNYgjRqR2tUoIqEY+CG1NqVkMjPRKzS37j9f8GiYPlD6wG9ruBj+q5Ax+bH8Ik1g==",
"requires": {}
}
} }
}, },
"@eslint/eslintrc": { "@eslint/eslintrc": {
@ -4046,6 +4186,11 @@
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.4.tgz", "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.4.tgz",
"integrity": "sha512-fFrlF/uWpGOX5djw5Mu2Hnnrunao75WGey0sP0J3jnhmrJ5TAPzHYOmytD5iN/+pMxS+f+u/gezqHa9tPhRHEA==" "integrity": "sha512-fFrlF/uWpGOX5djw5Mu2Hnnrunao75WGey0sP0J3jnhmrJ5TAPzHYOmytD5iN/+pMxS+f+u/gezqHa9tPhRHEA=="
}, },
"@sapphire/snowflake": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-2.0.0.tgz",
"integrity": "sha512-gPSOQKmEWeuif2ftmW7gyToCnOoqpDqTSNrxX7HsoMwGNLtrT9p5DHcQolkBg5CEK3ooDFy5DNEFKUshQU7vyQ=="
},
"@sindresorhus/is": { "@sindresorhus/is": {
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.1.tgz", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.1.tgz",
@ -4091,9 +4236,9 @@
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
"version": "16.7.1", "version": "16.7.8",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.1.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.8.tgz",
"integrity": "sha512-ncRdc45SoYJ2H4eWU9ReDfp3vtFqDYhjOsKlFFUDEn8V1Bgr2RjYal8YT5byfadWIRluhPFU6JiDOl0H6Sl87A==" "integrity": "sha512-8upnoQU0OPzbIkm+ZMM0zCeFCkw2s3mS0IWdx0+AAaWqm4fkBb0UJp8Edl7FVKRamYbpJC/aVsHpKWBIbiC7Zg=="
}, },
"@types/ws": { "@types/ws": {
"version": "7.4.7", "version": "7.4.7",
@ -4104,13 +4249,13 @@
} }
}, },
"@typescript-eslint/eslint-plugin": { "@typescript-eslint/eslint-plugin": {
"version": "4.29.2", "version": "4.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.30.0.tgz",
"integrity": "sha512-x4EMgn4BTfVd9+Z+r+6rmWxoAzBaapt4QFqE+d8L8sUtYZYLDTK6VG/y/SMMWA5t1/BVU5Kf+20rX4PtWzUYZg==", "integrity": "sha512-NgAnqk55RQ/SD+tZFD9aPwNSeHmDHHe5rtUyhIq0ZeCWZEvo4DK9rYz7v9HDuQZFvn320Ot+AikaCKMFKLlD0g==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/experimental-utils": "4.29.2", "@typescript-eslint/experimental-utils": "4.30.0",
"@typescript-eslint/scope-manager": "4.29.2", "@typescript-eslint/scope-manager": "4.30.0",
"debug": "^4.3.1", "debug": "^4.3.1",
"functional-red-black-tree": "^1.0.1", "functional-red-black-tree": "^1.0.1",
"regexpp": "^3.1.0", "regexpp": "^3.1.0",
@ -4119,55 +4264,55 @@
} }
}, },
"@typescript-eslint/experimental-utils": { "@typescript-eslint/experimental-utils": {
"version": "4.29.2", "version": "4.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.30.0.tgz",
"integrity": "sha512-P6mn4pqObhftBBPAv4GQtEK7Yos1fz/MlpT7+YjH9fTxZcALbiiPKuSIfYP/j13CeOjfq8/fr9Thr2glM9ub7A==", "integrity": "sha512-K8RNIX9GnBsv5v4TjtwkKtqMSzYpjqAQg/oSphtxf3xxdt6T0owqnpojztjjTcatSteH3hLj3t/kklKx87NPqw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/json-schema": "^7.0.7", "@types/json-schema": "^7.0.7",
"@typescript-eslint/scope-manager": "4.29.2", "@typescript-eslint/scope-manager": "4.30.0",
"@typescript-eslint/types": "4.29.2", "@typescript-eslint/types": "4.30.0",
"@typescript-eslint/typescript-estree": "4.29.2", "@typescript-eslint/typescript-estree": "4.30.0",
"eslint-scope": "^5.1.1", "eslint-scope": "^5.1.1",
"eslint-utils": "^3.0.0" "eslint-utils": "^3.0.0"
} }
}, },
"@typescript-eslint/parser": { "@typescript-eslint/parser": {
"version": "4.29.2", "version": "4.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.30.0.tgz",
"integrity": "sha512-WQ6BPf+lNuwteUuyk1jD/aHKqMQ9jrdCn7Gxt9vvBnzbpj7aWEf+aZsJ1zvTjx5zFxGCt000lsbD9tQPEL8u6g==", "integrity": "sha512-HJ0XuluSZSxeboLU7Q2VQ6eLlCwXPBOGnA7CqgBnz2Db3JRQYyBDJgQnop6TZ+rsbSx5gEdWhw4rE4mDa1FnZg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/scope-manager": "4.29.2", "@typescript-eslint/scope-manager": "4.30.0",
"@typescript-eslint/types": "4.29.2", "@typescript-eslint/types": "4.30.0",
"@typescript-eslint/typescript-estree": "4.29.2", "@typescript-eslint/typescript-estree": "4.30.0",
"debug": "^4.3.1" "debug": "^4.3.1"
} }
}, },
"@typescript-eslint/scope-manager": { "@typescript-eslint/scope-manager": {
"version": "4.29.2", "version": "4.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.30.0.tgz",
"integrity": "sha512-mfHmvlQxmfkU8D55CkZO2sQOueTxLqGvzV+mG6S/6fIunDiD2ouwsAoiYCZYDDK73QCibYjIZmGhpvKwAB5BOA==", "integrity": "sha512-VJ/jAXovxNh7rIXCQbYhkyV2Y3Ac/0cVHP/FruTJSAUUm4Oacmn/nkN5zfWmWFEanN4ggP0vJSHOeajtHq3f8A==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "4.29.2", "@typescript-eslint/types": "4.30.0",
"@typescript-eslint/visitor-keys": "4.29.2" "@typescript-eslint/visitor-keys": "4.30.0"
} }
}, },
"@typescript-eslint/types": { "@typescript-eslint/types": {
"version": "4.29.2", "version": "4.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.30.0.tgz",
"integrity": "sha512-K6ApnEXId+WTGxqnda8z4LhNMa/pZmbTFkDxEBLQAbhLZL50DjeY0VIDCml/0Y3FlcbqXZrABqrcKxq+n0LwzQ==", "integrity": "sha512-YKldqbNU9K4WpTNwBqtAerQKLLW/X2A/j4yw92e3ZJYLx+BpKLeheyzoPfzIXHfM8BXfoleTdiYwpsvVPvHrDw==",
"dev": true "dev": true
}, },
"@typescript-eslint/typescript-estree": { "@typescript-eslint/typescript-estree": {
"version": "4.29.2", "version": "4.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.30.0.tgz",
"integrity": "sha512-TJ0/hEnYxapYn9SGn3dCnETO0r+MjaxtlWZ2xU+EvytF0g4CqTpZL48SqSNn2hXsPolnewF30pdzR9a5Lj3DNg==", "integrity": "sha512-6WN7UFYvykr/U0Qgy4kz48iGPWILvYL34xXJxvDQeiRE018B7POspNRVtAZscWntEPZpFCx4hcz/XBT+erenfg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "4.29.2", "@typescript-eslint/types": "4.30.0",
"@typescript-eslint/visitor-keys": "4.29.2", "@typescript-eslint/visitor-keys": "4.30.0",
"debug": "^4.3.1", "debug": "^4.3.1",
"globby": "^11.0.3", "globby": "^11.0.3",
"is-glob": "^4.0.1", "is-glob": "^4.0.1",
@ -4176,12 +4321,12 @@
} }
}, },
"@typescript-eslint/visitor-keys": { "@typescript-eslint/visitor-keys": {
"version": "4.29.2", "version": "4.30.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.30.0.tgz",
"integrity": "sha512-bDgJLQ86oWHJoZ1ai4TZdgXzJxsea3Ee9u9wsTAvjChdj2WLcVsgWYAPeY7RQMn16tKrlQaBnpKv7KBfs4EQag==", "integrity": "sha512-pNaaxDt/Ol/+JZwzP7MqWc8PJQTUhZwoee/PVlQ+iYoYhagccvoHnC9e4l+C/krQYYkENxznhVSDwClIbZVxRw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@typescript-eslint/types": "4.29.2", "@typescript-eslint/types": "4.30.0",
"eslint-visitor-keys": "^2.0.0" "eslint-visitor-keys": "^2.0.0"
} }
}, },
@ -4190,6 +4335,14 @@
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
}, },
"abort-controller": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
"requires": {
"event-target-shim": "^5.0.0"
}
},
"acorn": { "acorn": {
"version": "7.4.1", "version": "7.4.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
@ -4698,6 +4851,20 @@
"discord-api-types": "^0.22.0", "discord-api-types": "^0.22.0",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.1",
"ws": "^7.5.1" "ws": "^7.5.1"
},
"dependencies": {
"@discordjs/builders": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.5.0.tgz",
"integrity": "sha512-HP5y4Rqw68o61Qv4qM5tVmDbWi4mdTFftqIOGRo33SNPpLJ1Ga3KEIR2ibKofkmsoQhEpLmopD1AZDs3cKpHuw==",
"requires": {
"@sindresorhus/is": "^4.0.1",
"discord-api-types": "^0.22.0",
"ow": "^0.27.0",
"ts-mixer": "^6.0.0",
"tslib": "^2.3.0"
}
}
} }
}, },
"doctrine": { "doctrine": {
@ -4845,9 +5012,9 @@
"requires": {} "requires": {}
}, },
"eslint-plugin-prettier": { "eslint-plugin-prettier": {
"version": "3.4.1", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz",
"integrity": "sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g==", "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"prettier-linter-helpers": "^1.0.0" "prettier-linter-helpers": "^1.0.0"
@ -4964,6 +5131,11 @@
"through": "~2.3.1" "through": "~2.3.1"
} }
}, },
"event-target-shim": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
},
"fast-deep-equal": { "fast-deep-equal": {
"version": "3.1.3", "version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
@ -5044,6 +5216,16 @@
"integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==",
"dev": true "dev": true
}, },
"form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
}
},
"from": { "from": {
"version": "0.1.7", "version": "0.1.7",
"resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz",
@ -5613,9 +5795,9 @@
"dev": true "dev": true
}, },
"node-addon-api": { "node-addon-api": {
"version": "3.2.1", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.1.0.tgz",
"integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" "integrity": "sha512-Zz1o1BDX2VtduiAt6kgiUl8jX1Vm3NMboljFYKQJ6ee8AGfiTvM2mlZFI3xPbqjs80rCQgiVJI/DjQ/1QJ0HwA=="
}, },
"node-cleanup": { "node-cleanup": {
"version": "2.1.2", "version": "2.1.2",
@ -5859,12 +6041,6 @@
"fast-diff": "^1.1.2" "fast-diff": "^1.1.2"
} }
}, },
"prism-media": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.2.tgz",
"integrity": "sha512-L6UsGHcT6i4wrQhFF1aPK+MNYgjRqR2tUoIqEY+CG1NqVkMjPRKzS37j9f8GiYPlD6wG9ruBj+q5Ax+bH8Ik1g==",
"requires": {}
},
"process": { "process": {
"version": "0.11.10", "version": "0.11.10",
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
@ -6262,9 +6438,9 @@
} }
}, },
"tar": { "tar": {
"version": "6.1.10", "version": "6.1.11",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.10.tgz", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz",
"integrity": "sha512-kvvfiVvjGMxeUNB6MyYv5z7vhfFRwbwCXJAeL0/lnbrttBVqcMOnpHUf0X42LrPMR8mMpgapkJMchFH4FSHzNA==", "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==",
"requires": { "requires": {
"chownr": "^2.0.0", "chownr": "^2.0.0",
"fs-minipass": "^2.0.0", "fs-minipass": "^2.0.0",
@ -6425,9 +6601,9 @@
} }
}, },
"typescript": { "typescript": {
"version": "4.3.5", "version": "4.4.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz",
"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", "integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==",
"dev": true "dev": true
}, },
"undefsafe": { "undefsafe": {
@ -6622,9 +6798,9 @@
} }
}, },
"ws": { "ws": {
"version": "7.5.3", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.4.tgz",
"integrity": "sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg==", "integrity": "sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg==",
"requires": {} "requires": {}
}, },
"xdg-basedir": { "xdg-basedir": {

View File

@ -1,6 +1,6 @@
{ {
"name": "eximiabots-radiox", "name": "eximiabots-radiox",
"version": "0.2.2", "version": "0.3.0",
"description": "Internet Radio to your Discord guild", "description": "Internet Radio to your Discord guild",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -18,7 +18,9 @@
"url": "https://github.com/warengroup/eximiabots-radiox/issues" "url": "https://github.com/warengroup/eximiabots-radiox/issues"
}, },
"dependencies": { "dependencies": {
"@discordjs/opus": "^0.5.3", "@discordjs/builders": "^0.6.0",
"@discordjs/opus": "^0.6.0",
"@discordjs/rest": "^0.1.1-canary.0",
"@discordjs/voice": "^0.6.0", "@discordjs/voice": "^0.6.0",
"discord-api-types": "^0.22.0", "discord-api-types": "^0.22.0",
"discord.js": "^13.1.0", "discord.js": "^13.1.0",
@ -28,19 +30,19 @@
"path": "^0.12.7" "path": "^0.12.7"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^16.6.1", "@types/node": "^16.7.8",
"@types/ws": "^7.4.7", "@types/ws": "^7.4.7",
"@typescript-eslint/eslint-plugin": "^4.29.2", "@typescript-eslint/eslint-plugin": "^4.29.3",
"@typescript-eslint/parser": "^4.29.2", "@typescript-eslint/parser": "^4.29.3",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "^4.0.0",
"nodemon": "^2.0.12", "nodemon": "^2.0.12",
"prettier": "^2.3.2", "prettier": "^2.3.2",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"ts-node": "^10.1.0", "ts-node": "^10.2.1",
"tsc-watch": "^4.4.0", "tsc-watch": "^4.5.0",
"typescript": "^4.3.5" "typescript": "^4.4.2"
}, },
"engines": { "engines": {
"node": ">=16.6.0", "node": ">=16.6.0",

View File

@ -5,18 +5,16 @@ import Datastore from "./client/datastore.js";
import { command, radio } from "./client/utils/typings.js"; import { command, radio } from "./client/utils/typings.js";
import config from "./config.js"; import config from "./config.js";
import messages from "./client/messages.js"; import messages from "./client/messages.js";
import path from "path" import path from "path";
const GatewayIntents = new Discord.Intents(); const GatewayIntents = new Discord.Intents();
GatewayIntents.add( GatewayIntents.add(
1 << 0, // GUILDS 1 << 0, // GUILDS
1 << 7, // GUILD_VOICE_STATES 1 << 7, // GUILD_VOICE_STATES
1 << 9 // GUILD_MESSAGES
); );
class RadioClient extends Client { class RadioClient extends Client {
readonly commands: Collection<string, command>; readonly commands: Collection<string, command>;
readonly commandAliases: Collection<string, command>;
readonly radio: Map<string, radio>; readonly radio: Map<string, radio>;
public funcs: any; public funcs: any;
readonly config = config; readonly config = config;
@ -27,7 +25,6 @@ class RadioClient extends Client {
intents: GatewayIntents intents: GatewayIntents
}); });
this.commands = new Collection(); this.commands = new Collection();
this.commandAliases = new Collection();
this.radio = new Map(); this.radio = new Map();
this.datastore = null; this.datastore = null;
@ -35,23 +32,22 @@ class RadioClient extends Client {
this.funcs.check = require("./client/funcs/check.js"); this.funcs.check = require("./client/funcs/check.js");
this.funcs.checkFetchStatus = require("./client/funcs/checkFetchStatus.js"); this.funcs.checkFetchStatus = require("./client/funcs/checkFetchStatus.js");
this.funcs.isDev = require("./client/funcs/isDev.js"); this.funcs.isDev = require("./client/funcs/isDev.js");
this.funcs.logger = require("./client/funcs/logger.js");
this.funcs.msToTime = require("./client/funcs/msToTime.js"); this.funcs.msToTime = require("./client/funcs/msToTime.js");
this.funcs.statisticsUpdate = require("./client/funcs/statisticsUpdate.js"); this.funcs.statisticsUpdate = require("./client/funcs/statisticsUpdate.js");
const commandFiles = fs.readdirSync(path.join("./src/client/commands")).filter(f => f.endsWith(".js")); const commandFiles = fs.readdirSync(path.join("./src/client/commands")).filter(f => f.endsWith(".js"));
for (const file of commandFiles) { for (const file of commandFiles) {
const command = require(`./client/commands/${file}`); const command = require(`./client/commands/${file}`);
command.uses = 0;
this.commands.set(command.name, command); this.commands.set(command.name, command);
this.commandAliases.set(command.alias, command);
} }
this.on("ready", () => { this.on("ready", () => {
require(`${events}ready`).execute(this, Discord); require(`${events}ready`).execute(this);
this.datastore = new Datastore(); this.datastore = new Datastore();
}); });
this.on("messageCreate", msg => { this.on("interactionCreate", interaction => {
require(`${events}msg`).execute(this, msg, Discord); require(`${events}interactionCreate`).execute(this, interaction);
}); });
this.on("voiceStateUpdate", (oldState, newState) => { this.on("voiceStateUpdate", (oldState, newState) => {
require(`${events}voiceStateUpdate`).execute(this, oldState, newState); require(`${events}voiceStateUpdate`).execute(this, oldState, newState);

67
src/client/commands.js Normal file
View File

@ -0,0 +1,67 @@
const { SlashCommandBuilder } = require('@discordjs/builders');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { token, version } = require('../config.js');
const fs = require('fs');
const path = require ('path');
module.exports = {
async execute(client) {
const commands = [];
const commandFiles = fs.readdirSync(path.join("./src/client/commands")).filter(f => f.endsWith(".js"));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
command.data = new SlashCommandBuilder()
.setName(command.name)
.setDescription(command.description);
command.data = command.data.toJSON();
if(command.options) {
command.options.forEach(function(option) {
if(option.type == "STRING") option.type = 3;
command.data.options.push(option);
});
}
commands.push(command.data);
}
const rest = new REST({ version: '9' }).setToken(token);
(async () => {
try {
client.funcs.logger('Slash Commands', 'Started refreshing application (/) commands.');
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: commands },
);
} catch (DiscordAPIError) {
}
});
} else {
await rest.put(
Routes.applicationCommands(client.user.id),
{ body: commands },
);
}
client.funcs.logger('Slash Commands', 'Successfully reloaded application (/) commands.' + "\n");
} catch (error) {
client.funcs.logger('Slash Commands', 'Reloading application (/) commands failed.' + "\n");
console.error(error);
}
})();
}
}

View File

@ -5,7 +5,7 @@ module.exports = {
description: 'Report a bug', description: 'Report a bug',
permission: 'none', permission: 'none',
category: 'info', category: 'info',
async execute(msg, args, client, Discord, command) { async execute(interaction, client, Discord, command) {
let message = {}; let message = {};
message.bugTitle = client.messages.bugTitle.replace("%client.user.username%", client.user.username); message.bugTitle = client.messages.bugTitle.replace("%client.user.username%", client.user.username);
@ -17,7 +17,10 @@ module.exports = {
.setColor(client.config.embedColor) .setColor(client.config.embedColor)
.setDescription(message.bugDescription) .setDescription(message.bugDescription)
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '')); .setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
msg.channel.send({ embeds: [embed] });
interaction.reply({
embeds: [embed],
ephemeral: true
});
} }
}; };

View File

@ -5,47 +5,32 @@ module.exports = {
description: 'Get help using bot', description: 'Get help using bot',
permission: 'none', permission: 'none',
category: 'info', category: 'info',
execute(msg, args, client, Discord, command) { execute(interaction, client, Discord, command) {
let message = {}; let message = {};
if (args[1]) { const categories = [];
if (!client.commands.has(args[1]) || (client.commands.has(args[1]) && client.commands.get(args[1]).omitFromHelp === true)) return msg.channel.send('That command does not exist'); for (let i = 0; i < client.commands.size; i++) {
const command = client.commands.get(args[1]); if (!categories.includes([...client.commands.values()][i].category)) categories.push([...client.commands.values()][i].category);
message.helpCommandTitle = client.messages.helpCommandTitle.replace("%client.config.prefix%", client.config.prefix);
message.helpCommandTitle = message.helpCommandTitle.replace("%command.name%", command.name);
message.helpCommandTitle = message.helpCommandTitle.replace("%command.usage%", command.usage);
message.helpCommandDescription = client.messages.helpCommandDescription.replace("%command.description%", command.description);
message.helpCommandDescription = message.helpCommandDescription.replace("%command.alias%", command.alias);
const embed = new Discord.MessageEmbed()
.setTitle(message.helpCommandTitle)
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
.setColor(client.config.embedColor)
.setDescription(message.helpCommandDescription)
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
msg.channel.send({ embeds: [embed] });
} else {
const categories = [];
for (let i = 0; i < client.commands.size; i++) {
if (!categories.includes(client.commands.array()[i].category)) categories.push(client.commands.array()[i].category);
}
let commands = '';
for (let i = 0; i < categories.length; i++) {
commands += `**» ${categories[i].toUpperCase()}**\n${client.commands.filter(x => x.category === categories[i] && !x.omitFromHelp).map(x => `\`${x.name}\``).join(', ')}\n`;
}
message.helpTitle = client.messages.helpTitle.replace("%client.user.username%", client.user.username);
message.helpDescription = client.messages.helpDescription.replace("%commands%", commands);
message.helpDescription = message.helpDescription.replace("%client.config.prefix%", client.config.prefix);
const embed = new Discord.MessageEmbed()
.setTitle(message.helpTitle)
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
.setColor(client.config.embedColor)
.setDescription(message.helpDescription)
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
msg.channel.send({ embeds: [embed] });
} }
let commands = '';
for (let i = 0; i < categories.length; i++) {
commands += `**» ${categories[i].toUpperCase()}**\n${client.commands.filter(x => x.category === categories[i] && !x.omitFromHelp).map(x => `\`${x.name}\``).join(', ')}\n`;
}
message.helpTitle = client.messages.helpTitle.replace("%client.user.username%", client.user.username);
message.helpDescription = client.messages.helpDescription.replace("%commands%", commands);
message.helpDescription = message.helpDescription.replace("%client.config.prefix%", client.config.prefix);
const embed = new Discord.MessageEmbed()
.setTitle(message.helpTitle)
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
.setColor(client.config.embedColor)
.setDescription(message.helpDescription)
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
interaction.reply({
embeds: [embed],
ephemeral: true
});
} }
}; };

View File

@ -5,14 +5,18 @@ module.exports = {
description: 'Invite Bot', description: 'Invite Bot',
permission: 'none', permission: 'none',
category: 'info', category: 'info',
execute(msg, args, client, Discord, command) { execute(interaction, client, Discord, command) {
let message = {}; let message = {};
message.inviteTitle = client.messages.inviteTitle.replace("%client.user.username%", client.user.username); message.inviteTitle = client.messages.inviteTitle.replace("%client.user.username%", client.user.username);
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setTitle(message.inviteTitle) .setTitle(message.inviteTitle)
.setColor(client.config.embedColor) .setColor(client.config.embedColor)
.setURL("https://discordapp.com/api/oauth2/authorize?client_id=" + client.user.id + "&permissions=3427328&scope=bot") .setURL("https://discordapp.com/api/oauth2/authorize?client_id=" + client.user.id + "&permissions=2184465408&scope=applications.commands%20bot") //View Channels, Send Messages, Embed Links, Use External Emojis, Use Slash Commands, Connect, Speak, Use Voice Activity
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '')); .setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
return msg.channel.send({ embeds: [embed] });
interaction.reply({
embeds: [embed],
ephemeral: true
});
} }
}; };

View File

@ -2,19 +2,19 @@ module.exports = {
name: 'list', name: 'list',
alias: 'l', alias: 'l',
usage: '', usage: '',
description: 'List radio stations.', description: 'List radio stations',
permission: 'none', permission: 'none',
category: 'radio', category: 'radio',
execute(msg, args, client, Discord, command) { execute(interaction, client, Discord, command) {
let message = {}; let message = {};
if(!client.stations) { if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild); message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return msg.channel.send(client.messageEmojis["error"] + message.errorToGetPlaylist); return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
} }
let stations = `${client.stations.map(s => `**#** ${s.name}`).join('\n')}` let stations = `${client.stations.map(s => `**#** ${s.name}`).join('\n')}`
const hashs = stations.split('**#**').length; const hashs = stations.split('**#**').length;
for (let i = 0; i < hashs; i++) { for (let i = 0; i < hashs; i++) {
stations = stations.replace('**#**', `**${i + 1}**`); stations = stations.replace('**#**', `**${i + 1}.**`);
} }
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
@ -23,6 +23,10 @@ module.exports = {
.setColor(client.config.embedColor) .setColor(client.config.embedColor)
.setDescription(stations) .setDescription(stations)
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '')); .setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
return msg.channel.send({ embeds: [embed] });
interaction.reply({
embeds: [embed],
ephemeral: true
});
} }
}; };

View File

@ -5,14 +5,14 @@ module.exports = {
description: 'Bot Maintenance', description: 'Bot Maintenance',
permission: 'none', permission: 'none',
category: 'info', category: 'info',
execute(msg, args, client, Discord, command) { execute(interaction, client, Discord, command) {
let message = {}; let message = {};
if(!client.funcs.isDev(client.config.devId, msg.author.id)) return msg.channel.send(client.messageEmojis["error"] + client.messages.notAllowed); if(!client.funcs.isDev(client.config.devId, interaction.user.id)) return interaction.reply(client.messageEmojis["error"] + client.messages.notAllowed);
if(!client.stations) { if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild); message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return msg.channel.send(client.messageEmojis["error"] + message.errorToGetPlaylist); return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
} }
let currentRadios = client.radio.keys(); let currentRadios = client.radio.keys();
@ -27,8 +27,8 @@ module.exports = {
if(currentRadio){ if(currentRadio){
client.funcs.statisticsUpdate(client, currentRadio.currentGuild.guild, currentRadio); client.funcs.statisticsUpdate(client, currentRadio.currentGuild.guild, currentRadio);
currentRadio.connection.destroy(); currentRadio.connection?.destroy();
currentRadio.audioPlayer.stop(); currentRadio.audioPlayer?.stop();
const cembed = new Discord.MessageEmbed() const cembed = new Discord.MessageEmbed()
.setTitle(client.messages.maintenanceTitle) .setTitle(client.messages.maintenanceTitle)
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["maintenance"].replace(/[^0-9]+/g, '')) .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["maintenance"].replace(/[^0-9]+/g, ''))
@ -48,6 +48,10 @@ module.exports = {
.setColor(client.config.embedColor) .setColor(client.config.embedColor)
.setDescription("Stopped all radios" + "\n" + stoppedRadios) .setDescription("Stopped all radios" + "\n" + stoppedRadios)
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '')); .setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
return msg.channel.send({ embeds: [embed] });
interaction.reply({
embeds: [embed],
ephemeral: true
});
} }
}; };

View File

@ -5,19 +5,23 @@ module.exports = {
description: 'Current Radio Station', description: 'Current Radio Station',
permission: 'none', permission: 'none',
category: 'radio', category: 'radio',
async execute(msg, args, client, Discord, command) { async execute(interaction, client, Discord, command) {
let message = {}; let message = {};
const radio = client.radio.get(msg.guild.id); const radio = client.radio.get(interaction.guild.id);
if (!radio) return msg.channel.send('There is nothing playing.'); if (!radio) return interaction.reply('There is nothing playing.');
if(!client.stations) { if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild); message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return msg.channel.send(client.messageEmojis["error"] + message.errorToGetPlaylist); return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
} }
const completed = (radio.connection.dispatcher.streamTime.toFixed(0));
let date = new Date();
radio.currentTime = date.getTime();
radio.playTime = parseInt(radio.currentTime)-parseInt(radio.startTime);
const completed = (radio.playTime);
message.nowplayingDescription = client.messages.nowplayingDescription.replace("%radio.station.name%", radio.station.name); message.nowplayingDescription = client.messages.nowplayingDescription.replace("%radio.station.name%", radio.station.name);
message.nowplayingDescription = message.nowplayingDescription.replace("%radio.station.owner%", radio.station.owner); message.nowplayingDescription = message.nowplayingDescription.replace("%radio.station.owner%", radio.station.owner);
message.nowplayingDescription = message.nowplayingDescription.replace("%client.funcs.msToTime(completed, \"hh:mm:ss\")%", client.funcs.msToTime(completed, "hh:mm:ss")); message.nowplayingDescription = message.nowplayingDescription.replace("%client.funcs.msToTime(completed)%", client.funcs.msToTime(completed));
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setTitle(client.messages.nowplayingTitle) .setTitle(client.messages.nowplayingTitle)
@ -25,6 +29,10 @@ module.exports = {
.setColor(client.config.embedColor) .setColor(client.config.embedColor)
.setDescription(message.nowplayingDescription) .setDescription(message.nowplayingDescription)
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '')); .setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
return msg.channel.send({ embeds: [embed] });
interaction.reply({
embeds: [embed],
ephemeral: true
});
} }
}; };

View File

@ -4,94 +4,155 @@ const {
getVoiceConnection, getVoiceConnection,
joinVoiceChannel joinVoiceChannel
} = require("@discordjs/voice"); } = require("@discordjs/voice");
const { createDiscordJSAdapter } = require("../utils/adapter");
module.exports = { module.exports = {
name: "play", name: "play",
alias: "p", alias: "p",
usage: "<song name>", usage: "<song name>",
description: "Play some music.", description: "Play radio",
options: [
{ type: "STRING", name: "query", description: "Select station", required: false}
],
permission: "none", permission: "none",
category: "radio", category: "radio",
async execute(msg, args, client, Discord, command) { async execute(interaction, client, Discord, command) {
let message = {}; let message = {};
let url = args[1] ? args[1].replace(/<(.+)>/g, "$1") : ""; let query = interaction.options?.getString("query") ?? interaction.values?.[0];
const radio = client.radio.get(msg.guild.id); if(!query){
const voiceChannel = msg.member.voice.channel; if(!client.stations) {
if (!radio) { message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
if (!msg.member.voice.channel) return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
return msg.channel.send( }
client.messageEmojis["error"] + client.messages.noVoiceChannel
let stations = new Array();
let options = new Array();
options[1] = new Array();
options[2] = new Array();
stations[1] = client.stations.slice(0,24).forEach(station => {
station = {
label: station.name,
description: station.owner,
value: station.name
};
options[1].push(station);
});
stations[2] = client.stations.slice(25).forEach(station => {
station = {
label: station.name,
description: station.owner,
value: station.name
};
options[2].push(station);
});
const menu = new Discord.MessageActionRow()
.addComponents(
new Discord.MessageSelectMenu()
.setCustomId('play')
.setPlaceholder('Nothing selected')
.addOptions(options[1])
.addOptions(options[2])
); );
stations = null;
options = null;
return interaction.reply({
content: '**Select station:**',
components: [menu],
ephemeral: true
});
}
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 { } else {
if (voiceChannel !== radio.voiceChannel) if (voiceChannel !== radio.voiceChannel)
return msg.channel.send( return interaction.reply({
client.messageEmojis["error"] + client.messages.wrongVoiceChannel content: client.messageEmojis["error"] + client.messages.wrongVoiceChannel,
); ephemeral: true
});
} }
if (!client.stations) { if (!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace( message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace(
"%client.config.supportGuild%", "%client.config.supportGuild%",
client.config.supportGuild client.config.supportGuild
); );
return msg.channel.send(client.messageEmojis["error"] + message.errorToGetPlaylist); return interaction.reply({
content: client.messageEmojis["error"] + message.errorToGetPlaylist,
ephemeral: true
});
} }
if (!args[1]) return msg.channel.send(client.messages.noQuery); if (!query) return interaction.reply(client.messages.noQuery);
const permissions = voiceChannel.permissionsFor(msg.client.user); const permissions = voiceChannel.permissionsFor(interaction.client.user);
if (!permissions.has("CONNECT")) { if (!permissions.has("CONNECT")) {
return msg.channel.send(client.messageEmojis["error"] + client.messages.noPermsConnect); return interaction.reply(client.messageEmojis["error"] + client.messages.noPermsConnect);
} }
if (!permissions.has("SPEAK")) { if (!permissions.has("SPEAK")) {
return msg.channel.send(client.messageEmojis["error"] + client.messages.noPermsSpeak); return interaction.reply(client.messageEmojis["error"] + client.messages.noPermsSpeak);
} }
let station; let station;
const number = parseInt(args[1] - 1); const number = parseInt(query - 1);
if (url.startsWith("http")) { if (url.startsWith("http")) {
return msg.channel.send( return interaction.reply({
client.messageEmojis["error"] + client.messages.errorStationURL content: client.messageEmojis["error"] + client.messages.errorStationURL,
); ephemeral: true
});
} else if (!isNaN(number)) { } else if (!isNaN(number)) {
if (number > client.stations.length - 1) { if (number > client.stations.length - 1) {
return msg.channel.send( return interaction.reply({
client.messageEmojis["error"] + client.messages.wrongStationNumber content: client.messageEmojis["error"] + client.messages.wrongStationNumber,
); ephemeral: true
});
} else { } else {
url = client.stations[number].stream[client.stations[number].stream.default]; url = client.stations[number].stream[client.stations[number].stream.default];
station = client.stations[number]; station = client.stations[number];
} }
} else { } else {
if (args[1].length < 3) if (query.length < 3)
return msg.channel.send( return interaction.reply({
client.messageEmojis["error"] + client.messages.tooShortSearch content: client.messageEmojis["error"] + client.messages.tooShortSearch,
); ephemeral: true
const sstation = await searchStation(args.slice(1).join(" "), client); });
const sstation = await searchStation(query, client);
if (!sstation) if (!sstation)
return msg.channel.send( return interaction.reply({
client.messageEmojis["error"] + client.messages.noSearchResults content: client.messageEmojis["error"] + client.messages.noSearchResults,
); ephemeral: true
});
url = sstation.stream[sstation.stream.default]; url = sstation.stream[sstation.stream.default];
station = sstation; station = sstation;
} }
if (radio) { if (radio) {
client.funcs.statisticsUpdate(client, msg.guild, radio); client.funcs.statisticsUpdate(client, interaction.guild, radio);
radio.audioPlayer.stop(); radio.audioPlayer.stop();
radio.station = station; radio.station = station;
radio.textChannel = msg.channel; radio.textChannel = interaction.channel;
play(msg.guild, client, url); play(interaction, interaction.guild, client, url, Discord);
return; return;
} }
const construct = { const construct = {
textChannel: msg.channel, textChannel: interaction.channel,
voiceChannel: voiceChannel, voiceChannel: voiceChannel,
connection: null, connection: null,
message: null,
audioPlayer: createAudioPlayer(), audioPlayer: createAudioPlayer(),
station: station station: station
}; };
client.radio.set(msg.guild.id, construct); client.radio.set(interaction.guild.id, construct);
try { try {
const connection = const connection =
@ -99,30 +160,31 @@ module.exports = {
joinVoiceChannel({ joinVoiceChannel({
channelId: voiceChannel.id, channelId: voiceChannel.id,
guildId: voiceChannel.guild.id, guildId: voiceChannel.guild.id,
adapterCreator: createDiscordJSAdapter(voiceChannel) adapterCreator: voiceChannel.guild.voiceAdapterCreator
}); });
construct.connection = connection; construct.connection = connection;
let date = new Date(); let date = new Date();
construct.startTime = date.getTime(); construct.startTime = date.getTime();
play(msg.guild, client, url); play(interaction, interaction.guild, client, url, Discord);
client.datastore.checkEntry(msg.guild.id); client.datastore.checkEntry(interaction.guild.id);
construct.currentGuild = client.datastore.getEntry(msg.guild.id); construct.currentGuild = client.datastore.getEntry(interaction.guild.id);
if (!construct.currentGuild.statistics[construct.station.name]) { if (!construct.currentGuild.statistics[construct.station.name]) {
construct.currentGuild.statistics[construct.station.name] = {}; construct.currentGuild.statistics[construct.station.name] = {};
construct.currentGuild.statistics[construct.station.name].time = 0; construct.currentGuild.statistics[construct.station.name].time = 0;
construct.currentGuild.statistics[construct.station.name].used = 0; construct.currentGuild.statistics[construct.station.name].used = 0;
client.datastore.updateEntry(msg.guild, construct.currentGuild); client.datastore.updateEntry(interaction.guild, construct.currentGuild);
} }
} catch (error) { } catch (error) {
console.log(error); console.log(error);
client.radio.delete(msg.guild.id); client.radio.delete(interaction.guild.id);
return msg.channel.send(client.messageEmojis["error"] + `An error occured: ${error}`); return interaction.reply(client.messageEmojis["error"] + `An error occured: ${error}`);
} }
} }
}; };
function play(guild, client, url) {
async function play(interaction, guild, client, url, Discord) {
let message = {}; let message = {};
const radio = client.radio.get(guild.id); const radio = client.radio.get(guild.id);
const resource = createAudioResource(url); const resource = createAudioResource(url);
@ -130,24 +192,85 @@ function play(guild, client, url) {
radio.audioPlayer.play(resource); radio.audioPlayer.play(resource);
resource.playStream resource.playStream
.on("readable", () => { .on("readable", () => {
console.log("Stream started"); client.funcs.logger('Radio', 'Stream started' + " / " + guild.id + " / " + radio.station.name);
}) })
.on("finish", () => { .on("finish", () => {
console.log("Stream finished"); client.funcs.logger('Radio', 'Stream finished' + " / " + guild.id);
client.funcs.statisticsUpdate(client, guild, radio); client.funcs.statisticsUpdate(client, guild, radio);
radio.connection.destroy(); radio.connection?.destroy();
radio.audioPlayer?.stop();
client.radio.delete(guild.id); client.radio.delete(guild.id);
return; return;
}) })
.on("error", error => { .on("error", error => {
client.funcs.logger('Radio', 'Stream errored');
console.error(error); console.error(error);
radio.connection.destroy(); radio.connection?.destroy();
radio.audioPlayer?.stop();
client.radio.delete(guild.id); client.radio.delete(guild.id);
return radio.textChannel.send(client.messages.errorPlaying); return interaction.reply(client.messages.errorPlaying);
}); });
message.nowplayingDescription = client.messages.nowplayingDescription.replace("%radio.station.name%", radio.station.name);
message.nowplayingDescription = message.nowplayingDescription.replace("%radio.station.owner%", radio.station.owner);
message.nowplayingDescription = message.nowplayingDescription.replace("%client.funcs.msToTime(completed)%", "");
message.nowplayingDescription = message.nowplayingDescription.replace("**", "");
message.nowplayingDescription = message.nowplayingDescription.replace("**", "");
const embed = new Discord.MessageEmbed()
.setTitle(client.user.username)
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["play"].replace(/[^0-9]+/g, ''))
.setColor(client.config.embedColor)
.addField(client.messages.nowplayingTitle, message.nowplayingDescription, true)
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
const buttons = new Discord.MessageActionRow()
.addComponents(
new Discord.MessageButton()
.setCustomId('list')
.setEmoji(client.messageEmojis["list"])
.setStyle('SECONDARY')
)
.addComponents(
new Discord.MessageButton()
.setCustomId('prev')
.setEmoji(client.messageEmojis["prev"])
.setStyle('SECONDARY')
.setDisabled(true)
)
.addComponents(
new Discord.MessageButton()
.setCustomId('stop')
.setEmoji(client.messageEmojis["stop"])
.setStyle('SECONDARY')
)
.addComponents(
new Discord.MessageButton()
.setCustomId('next')
.setEmoji(client.messageEmojis["next"])
.setStyle('SECONDARY')
.setDisabled(true)
)
.addComponents(
new Discord.MessageButton()
.setCustomId('statistics')
.setEmoji(client.messageEmojis["statistics"])
.setStyle('SECONDARY')
);
if(!radio.message){
radio.message = await radio.textChannel.send({ embeds: [embed], components: [buttons] });
} else {
radio.message.edit({ embeds: [embed], components: [buttons] });
}
message.play = client.messages.play.replace("%radio.station.name%", radio.station.name); message.play = client.messages.play.replace("%radio.station.name%", radio.station.name);
radio.textChannel.send(client.messageEmojis["play"] + message.play);
interaction.reply({
content: client.messageEmojis["play"] + message.play,
ephemeral: true
});
} }
function searchStation(key, client) { function searchStation(key, client) {
@ -155,6 +278,15 @@ function searchStation(key, client) {
let foundStations = []; let foundStations = [];
if (!key) return false; if (!key) return false;
if (key == "radio") return false; if (key == "radio") return false;
client.stations
.filter(
x => x.name.toUpperCase().includes(key.toUpperCase()) || x === key
)
.forEach(x =>
foundStations.push({ station: x, name: x.name, probability: 100 })
);
if (key.startsWith("radio ")) key = key.slice(6); if (key.startsWith("radio ")) key = key.slice(6);
const probabilityIncrement = 100 / key.split(" ").length / 2; const probabilityIncrement = 100 / key.split(" ").length / 2;
for (let i = 0; i < key.split(" ").length; i++) { for (let i = 0; i < key.split(" ").length; i++) {

View File

@ -2,19 +2,19 @@ module.exports = {
name: 'statistics', name: 'statistics',
alias: 'stats', alias: 'stats',
usage: '', usage: '',
description: 'Show usage statistics.', description: 'Show statistics',
permission: 'none', permission: 'none',
category: 'info', category: 'info',
execute(msg, args, client, Discord, command) { execute(interaction, client, Discord, command) {
let message = {}; let message = {};
let stations = client.stations; let stations = client.stations;
let currentGuild = client.datastore.getEntry(msg.guild.id); let currentGuild = client.datastore.getEntry(interaction.guild.id);
let statistics = ""; let statistics = "";
if(!client.stations) { if(!client.stations) {
message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild); message.errorToGetPlaylist = client.messages.errorToGetPlaylist.replace("%client.config.supportGuild%", client.config.supportGuild);
return msg.channel.send(client.messageEmojis["error"] + message.errorToGetPlaylist); return interaction.reply(client.messageEmojis["error"] + message.errorToGetPlaylist);
} }
if(!currentGuild || currentGuild && !currentGuild.statistics){ if(!currentGuild || currentGuild && !currentGuild.statistics){
statistics = "You have not listened any radio station"; statistics = "You have not listened any radio station";
@ -22,7 +22,7 @@ module.exports = {
Object.keys(stations).forEach(function(station) { Object.keys(stations).forEach(function(station) {
if(currentGuild.statistics[stations[station].name] && currentGuild.statistics[stations[station].name].time && parseInt(currentGuild.statistics[stations[station].name].time) > 0 && currentGuild.statistics[stations[station].name].used && parseInt(currentGuild.statistics[stations[station].name].used) > 0){ if(currentGuild.statistics[stations[station].name] && currentGuild.statistics[stations[station].name].time && parseInt(currentGuild.statistics[stations[station].name].time) > 0 && currentGuild.statistics[stations[station].name].used && parseInt(currentGuild.statistics[stations[station].name].used) > 0){
statistics += `**${parseInt(station) + 1}** ` + stations[station].name + " \n"; statistics += `**${parseInt(station) + 1}** ` + stations[station].name + " \n";
statistics += "Time: " + client.funcs.msToTime(currentGuild.statistics[stations[station].name].time, "dd:hh:mm:ss") + "\n"; statistics += "Time: " + client.funcs.msToTime(currentGuild.statistics[stations[station].name].time) + "\n";
statistics += "Used: " + currentGuild.statistics[stations[station].name].used + "\n"; statistics += "Used: " + currentGuild.statistics[stations[station].name].used + "\n";
} }
}); });
@ -34,6 +34,10 @@ module.exports = {
.setColor(client.config.embedColor) .setColor(client.config.embedColor)
.setDescription(statistics) .setDescription(statistics)
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '')); .setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
return msg.channel.send({ embeds: [embed] });
interaction.reply({
embeds: [embed],
ephemeral: true
});
} }
}; };

View File

@ -1,27 +1,31 @@
module.exports = { module.exports = {
name: 'status', name: 'status',
alias: 'none', alias: 'st',
usage: '', usage: '',
description: 'Bot Status', description: 'Bot Status',
permission: 'none', permission: 'none',
category: 'info', category: 'info',
async execute(msg, args, client, Discord, command) { async execute(interaction, client, Discord, command) {
let message = {}; let message = {};
message.statusTitle = client.messages.statusTitle.replace("%client.user.username%", client.user.username); message.statusTitle = client.messages.statusTitle.replace("%client.user.username%", client.user.username);
let uptime = client.funcs.msToTime(client.uptime, "dd:hh:mm:ss"); let uptime = client.funcs.msToTime(client.uptime);
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setTitle(message.statusTitle) .setTitle(message.statusTitle)
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, '')) .setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["logo"].replace(/[^0-9]+/g, ''))
.setColor(client.config.embedColor) .setColor(client.config.embedColor)
.addField(client.messages.statusField1, Date.now() - msg.createdTimestamp + "ms", true) .addField(client.messages.statusField1, Date.now() - interaction.createdTimestamp + "ms", true)
.addField(client.messages.statusField2, client.ws.ping + "ms", true) .addField(client.messages.statusField2, client.ws.ping + "ms", true)
.addField(client.messages.statusField3, uptime, true) .addField(client.messages.statusField3, uptime, true)
.addField(client.messages.statusField4, client.config.version, true) .addField(client.messages.statusField4, client.config.version, true)
.addField(client.messages.statusField5, client.config.hostedBy, true) .addField(client.messages.statusField5, client.config.hostedBy, true)
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, '')); .setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
msg.channel.send({ embeds: [embed] });
interaction.reply({
embeds: [embed],
ephemeral: true
});
} }
}; };

View File

@ -1,18 +1,41 @@
module.exports = { module.exports = {
name: 'stop', name: 'stop',
description: 'Stop command.', description: 'Stop radio',
alias: 's', alias: 's',
usage: '', usage: '',
permission: 'none', permission: 'none',
category: 'radio', category: 'radio',
execute(msg, args, client, Discord, command) { async execute(interaction, client, Discord, command) {
const radio = client.radio.get(msg.guild.id); const radio = client.radio.get(interaction.guild.id);
if (client.funcs.check(client, msg, command)) { if (client.funcs.check(client, interaction, command)) {
client.funcs.statisticsUpdate(client, msg.guild, radio); client.funcs.statisticsUpdate(client, interaction.guild, radio);
radio.connection?.destroy(); radio.connection?.destroy();
radio.audioPlayer?.stop(); radio.audioPlayer?.stop();
client.radio.delete(msg.guild.id); client.funcs.logger('Radio', 'Stream stopped' + " / " + interaction.guild.id);
msg.channel.send(client.messageEmojis["stop"] + client.messages.stop);
} const embed = new Discord.MessageEmbed()
} .setTitle(client.user.username)
.setThumbnail("https://cdn.discordapp.com/emojis/" + client.messageEmojis["stop"].replace(/[^0-9]+/g, ''))
.setColor(client.config.embedColor)
.addField(client.messages.nowplayingTitle, "-", true)
.setFooter(client.messages.footerText, "https://cdn.discordapp.com/emojis/" + client.messageEmojis["eximiabots"].replace(/[^0-9]+/g, ''));
if(!radio.message){
radio.message = await radio.textChannel.send({ embeds: [embed], components: [] });
} else {
radio.message.edit({ embeds: [embed], components: [] });
}
setTimeout(function() {
radio.message.delete();
}, 5000);
client.radio.delete(interaction.guild.id);
interaction.reply({
content: client.messageEmojis["stop"] + client.messages.stop,
ephemeral: true
});
}
}
}; };

View File

@ -9,7 +9,9 @@ module.exports = {
stop: "<:RadioXStop:688541155377414168>", stop: "<:RadioXStop:688541155377414168>",
statistics: "<:RadioXStatistics:694954485507686421>", statistics: "<:RadioXStatistics:694954485507686421>",
maintenance: "<:RadioXMaintenance:695043843057254493>", maintenance: "<:RadioXMaintenance:695043843057254493>",
error: "<:RadioXError:688541155792781320>" error: "<:RadioXError:688541155792781320>",
prev: "<:RadioXPrev:882153637370023957>",
next: "<:RadioXNext:882153637474893834>"
}; };
let fallbackEmojis = { let fallbackEmojis = {
@ -20,7 +22,9 @@ module.exports = {
stop: "⏹️", stop: "⏹️",
statistics: "📊", statistics: "📊",
maintenance: "🛠️", maintenance: "🛠️",
error: "❌" error: "❌",
prev: "⏪",
next: "⏩"
}; };
client.messageEmojis = {}; client.messageEmojis = {};

View File

@ -0,0 +1,35 @@
import Discord from "discord.js";
module.exports = {
name: 'interactionCreate',
async execute(client, interaction) {
/*if (!interaction.isCommand()) return;*/
const permissions = interaction.channel.permissionsFor(interaction.client.user);
if (!permissions.has('EMBED_LINKS')) return interaction.send(client.messages.noPermsEmbed);
if(interaction.isCommand()){
const commandName = interaction.commandName;
const command = client.commands.get(commandName);
if (!command) return;
try {
command.execute(interaction, client, Discord, command);
} catch (error) {
interaction.reply(client.messages.runningCommandFailed);
console.error(error);
}
} else if (interaction.isSelectMenu() || interaction.isButton()){
const commandName = interaction.customId;
const command = client.commands.get(commandName);
if (!command) return;
try {
command.execute(interaction, client, Discord, command);
} catch (error) {
interaction.reply(client.messages.runningCommandFailed);
console.error(error);
}
}
}
}

View File

@ -1,27 +0,0 @@
module.exports = {
name: 'message',
async execute(client, msg, Discord) {
if (msg.author.bot || !msg.guild) return;
let prefix = client.config.prefix;
if(msg.mentions.members.first()){
if(msg.mentions.members.first().user.id === client.user.id){
prefix = "<@!" + client.user.id + "> ";
}
}
const args = msg.content.slice(prefix.length).split(' ');
if (!msg.content.startsWith(prefix)) return;
if (!args[0]) return;
const commandName = args[0].toLowerCase();
if (commandName === 'none') return;
const command = client.commands.get(commandName) || client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName)) || client.commandAliases.get(commandName);
if (!command && msg.content !== `${prefix}`) return;
const permissions = msg.channel.permissionsFor(msg.client.user);
if (!permissions.has('EMBED_LINKS')) return msg.channel.send(client.messages.noPermsEmbed);
try {
command.execute(msg, args, client, Discord, command);
} catch (error) {
msg.reply(client.messages.runningCommandFailed);
console.error(error);
}
}
}

View File

@ -2,38 +2,59 @@ const fetch = require('node-fetch');
module.exports = { module.exports = {
name: 'ready', name: 'ready',
async execute(client, Discord) { async execute(client) {
console.log('RadioX'); console.log('RadioX ' + client.config.version);
console.log('Internet Radio to your Discord guild'); console.log('Internet Radio to your Discord guild');
console.log('(c)2020-2021 EximiaBots by Warén Group'); console.log('(c)2020-2021 EximiaBots by Warén Group');
console.log('');
/*DEVELOPERS*/
client.funcs.logger('Developers', 'List');
client.developers = ""; client.developers = "";
let user = ""; let user = "";
for (let i = 0; i < client.config.devId.length; i++) { for (let i = 0; i < client.config.devId.length; i++) {
user = await client.users.fetch(client.config.devId[i]); user = await client.users.fetch(client.config.devId[i]);
console.log(" - " + user.tag);
if (i == client.config.devId.length - 1) { if (i == client.config.devId.length - 1) {
client.developers += user.tag; client.developers += user.tag;
} else { } else {
client.developers += user.tag + " & "; client.developers += user.tag + " & ";
} }
} }
console.log("\n");
/*STATIONS*/
try { try {
client.funcs.logger('Stations', 'Started fetching list ' + client.config.stationslistUrl);
client.stations = await fetch(client.config.stationslistUrl) client.stations = await fetch(client.config.stationslistUrl)
.then(client.funcs.checkFetchStatus) .then(client.funcs.checkFetchStatus)
.then(response => response.json()); .then(response => response.json());
client.funcs.logger('Stations', 'List');
client.stations.forEach(station => {
console.log(" - " + station.name);
});
console.log("\n");
client.funcs.logger('Stations', 'Successfully fetched list');
} catch (error) { } catch (error) {
console.error(error); client.funcs.logger('Stations', 'Fetching list failed');
console.error(error + "\n");
} }
setInterval(async () => { setInterval(async () => {
try { try {
client.funcs.logger('Stations', 'Started fetching list ' + client.config.stationslistUrl);
client.stations = await fetch(client.config.stationslistUrl) client.stations = await fetch(client.config.stationslistUrl)
.then(client.funcs.checkFetchStatus) .then(client.funcs.checkFetchStatus)
.then(response => response.json()); .then(response => response.json());
client.funcs.logger('Stations', 'Successfully fetched list');
} catch (error) { } catch (error) {
console.error(error); client.funcs.logger('Stations', 'Fetching list failed');
//console.error(error);
} }
}, 3600000); }, 3600000);
@ -41,8 +62,26 @@ module.exports = {
client.user.setStatus('dnd'); client.user.setStatus('dnd');
} }
/*GUILDS*/
client.funcs.logger('Guilds', 'Started fetching list');
client.funcs.logger('Guilds', 'List');
let guilds = await client.guilds.fetch();
guilds.forEach(guild => {
console.log(" - " + guild.id + ": " + guild.name);
});
console.log("\n");
client.funcs.logger('Guilds', 'Successfully fetched list');
/*STATISTICS*/
client.datastore.calculateGlobal(client); client.datastore.calculateGlobal(client);
/*EMOJIS*/
require(`../emojis.js`).execute(client); require(`../emojis.js`).execute(client);
/*COMMANDS*/
require(`../commands.js`).execute(client);
} }
} }

View File

@ -2,7 +2,6 @@ const {
getVoiceConnection, getVoiceConnection,
joinVoiceChannel joinVoiceChannel
} = require("@discordjs/voice"); } = require("@discordjs/voice");
const { createDiscordJSAdapter } = require("../utils/adapter");
module.exports = { module.exports = {
name: "voiceStateUpdate", name: "voiceStateUpdate",
@ -16,7 +15,9 @@ module.exports = {
if (newState.channel === null) { if (newState.channel === null) {
client.funcs.statisticsUpdate(client, newState.guild, radio); client.funcs.statisticsUpdate(client, newState.guild, radio);
radio.connection?.destroy();
radio.audioPlayer?.stop(); radio.audioPlayer?.stop();
client.funcs.logger('Radio', 'Stream stopped' + " / " + newState.guild.id);
return client.radio.delete(newState.guild.id); return client.radio.delete(newState.guild.id);
} }
@ -28,7 +29,7 @@ module.exports = {
radio.connection = joinVoiceChannel({ radio.connection = joinVoiceChannel({
channelId: oldState.channel.id, channelId: oldState.channel.id,
guildId: oldState.channel.guild.id, guildId: oldState.channel.guild.id,
adapterCreator: createDiscordJSAdapter(oldState.channel) adapterCreator: oldState.channel.guild.voiceAdapterCreator
}) })
//radio.connection = await oldState.channel.join() //radio.connection = await oldState.channel.join()
), ),
@ -38,6 +39,7 @@ module.exports = {
client.funcs.statisticsUpdate(client, newState.guild, radio); client.funcs.statisticsUpdate(client, newState.guild, radio);
radio.connection?.destroy(); radio.connection?.destroy();
radio.audioPlayer?.stop(); radio.audioPlayer?.stop();
client.funcs.logger('Radio', 'Stream stopped' + " / " + newState.guild.id);
client.radio.delete(oldState.guild.id); client.radio.delete(oldState.guild.id);
} }
return; return;
@ -56,9 +58,10 @@ module.exports = {
client.funcs.statisticsUpdate(client, newState.guild, radio); client.funcs.statisticsUpdate(client, newState.guild, radio);
radio.connection?.destroy(); radio.connection?.destroy();
radio.audioPlayer?.stop(); radio.audioPlayer?.stop();
client.funcs.logger('Radio', 'Stream stopped' + " / " + newState.guild.id);
client.radio.delete(newState.guild.id); client.radio.delete(newState.guild.id);
} }
}, 120000); }, 60000);
} }
}, },
}; };

View File

@ -1,19 +1,28 @@
module.exports = function (client, msg, command) { module.exports = function (client, interaction, command) {
let message = {}; let message = {};
const radio = client.radio.get(msg.guild.id); const radio = client.radio.get(interaction.guild.id);
const permissions = msg.channel.permissionsFor(msg.author); const permissions = interaction.channel.permissionsFor(interaction.user);
if (!radio) { if (!radio) {
msg.channel.send(client.messageEmojis["error"] + client.messages.notPlaying); interaction.reply({
content: client.messageEmojis["error"] + client.messages.notPlaying,
ephemeral: true
});
return false; return false;
} }
if (msg.member.voice.channel !== radio.voiceChannel) { if (interaction.member.voice.channel !== radio.voiceChannel) {
msg.channel.send(client.messageEmojis["error"] + client.messages.wrongVoiceChannel); interaction.reply({
content: client.messageEmojis["error"] + client.messages.wrongVoiceChannel,
ephemeral: true
});
return false; return false;
} }
if(!command.permission == 'none'){ if(!command.permission == 'none'){
if (!permissions.has(command.permission)) { if (!permissions.has(command.permission)) {
message.noPerms = client.messages.noPerms.replace("%command.permission%", command.permission); message.noPerms = client.messages.noPerms.replace("%command.permission%", command.permission);
msg.channel.send(client.messageEmojis["error"] + message.noPerms); interaction.reply({
content: client.messageEmojis["error"] + message.noPerms,
ephemeral: true
});
return false; return false;
} else return true; } else return true;
} else return true; } else return true;

View File

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

View File

@ -1,17 +1,12 @@
module.exports = function msToTime(duration, format) { module.exports = function msToTime(duration) {
var seconds = Math.floor((duration / 1000) % 60), let seconds = Math.floor((duration / 1000) % 60),
minutes = Math.floor((duration / (1000 * 60)) % 60), minutes = Math.floor((duration / (1000 * 60)) % 60),
hours = Math.floor((duration / (1000 * 60 * 60)) % 24), hours = Math.floor((duration / (1000 * 60 * 60)) % 24),
days = Math.floor((duration / (1000 * 60 * 60 * 24))); days = Math.floor((duration / (1000 * 60 * 60 * 24)));
days = (days < 10) ? "0" + days : days; return +days > 0
hours = (hours < 10) ? "0" + hours : hours; ? `${days}:${+hours < 10 ? `0${hours}` : hours}:${+minutes < 10 ? `0${minutes}` : minutes}:${+seconds < 10 ? `0${seconds}` : seconds}`
minutes = (minutes < 10) ? "0" + minutes : minutes; : +hours > 0
seconds = (seconds < 10) ? "0" + seconds : seconds; ? `${+hours < 10 ? `0${hours}` : hours}:${+minutes < 10 ? `0${minutes}` : minutes}:${+seconds < 10 ? `0${seconds}` : seconds}`
: `${+minutes < 10 ? `0${minutes}` : minutes}:${+seconds < 10 ? `0${seconds}` : seconds}`;
if (format === "hh:mm:ss") {
return `${hours}:${minutes}:${seconds}`;
} else if (format === "dd:hh:mm:ss") {
return `${days}:${hours}:${minutes}:${seconds}`;
}
} }

View File

@ -7,13 +7,13 @@ module.exports = {
bugTitle: "Found a bug with %client.user.username%?", bugTitle: "Found a bug with %client.user.username%?",
bugDescription: "Join the support server \n %client.config.supportGuild%", bugDescription: "Join the support server \n %client.config.supportGuild%",
helpTitle: "%client.user.username% help:", helpTitle: "%client.user.username% help:",
helpDescription: "%commands% \n %client.config.prefix%help <command> to see more information about a command.", helpDescription: "%commands%",
helpCommandTitle: "%client.config.prefix%%command.name% %command.usage%", helpCommandTitle: "%client.config.prefix%%command.name% %command.usage%",
helpCommandDescription: "%command.description% \n Command Alias: %command.alias%", helpCommandDescription: "%command.description% \n Command Alias: %command.alias%",
inviteTitle: "Invite %client.user.username% to your Discord server!", inviteTitle: "Invite %client.user.username% to your Discord server!",
listTitle: "Radio Stations", listTitle: "Radio Stations",
nowplayingTitle: "Now Playing", nowplayingTitle: "Now Playing",
nowplayingDescription: "**%radio.station.name%** \n Owner: %radio.station.owner% \n %client.funcs.msToTime(completed, \"hh:mm:ss\")%", nowplayingDescription: "**%radio.station.name%** \n Owner: %radio.station.owner% \n %client.funcs.msToTime(completed)%",
noVoiceChannel: "You need to be in a voice channel to play radio!", noVoiceChannel: "You need to be in a voice channel to play radio!",
noQuery: "You need to use a number or search for a supported station!", noQuery: "You need to use a number or search for a supported station!",
noPermsConnect: "I cannot connect to your voice channel.", noPermsConnect: "I cannot connect to your voice channel.",

View File

@ -1,70 +0,0 @@
import { DiscordGatewayAdapterCreator, DiscordGatewayAdapterLibraryMethods } from '@discordjs/voice';
import { VoiceChannel, Snowflake, Client, Constants, WebSocketShard, Guild, StageChannel } from 'discord.js';
import { GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData } from 'discord-api-types/v9';
const adapters = new Map<Snowflake, DiscordGatewayAdapterLibraryMethods>();
const trackedClients = new Set<Client>();
/**
* Tracks a Discord.js client, listening to VOICE_SERVER_UPDATE and VOICE_STATE_UPDATE events.
* @param client - The Discord.js Client to track
*/
function trackClient(client: Client) {
if (trackedClients.has(client)) return;
trackedClients.add(client);
client.ws.on(Constants.WSEvents.VOICE_SERVER_UPDATE, (payload: GatewayVoiceServerUpdateDispatchData) => {
adapters.get(payload.guild_id)?.onVoiceServerUpdate(payload);
});
client.ws.on(Constants.WSEvents.VOICE_STATE_UPDATE, (payload: GatewayVoiceStateUpdateDispatchData) => {
if (payload.guild_id && payload.session_id && payload.user_id === client.user?.id) {
adapters.get(payload.guild_id)?.onVoiceStateUpdate(payload);
}
});
}
const trackedGuilds = new Map<WebSocketShard, Set<Snowflake>>();
function cleanupGuilds(shard: WebSocketShard) {
const guilds = trackedGuilds.get(shard);
if (guilds) {
for (const guildID of guilds.values()) {
adapters.get(guildID)?.destroy();
}
}
}
function trackGuild(guild: Guild) {
let guilds = trackedGuilds.get(guild.shard);
if (!guilds) {
const cleanup = () => cleanupGuilds(guild.shard);
guild.shard.on('close', cleanup);
guild.shard.on('destroyed', cleanup);
guilds = new Set();
trackedGuilds.set(guild.shard, guilds);
}
guilds.add(guild.id);
}
/**
* Creates an adapter for a Voice Channel
* @param channel - The channel to create the adapter for
*/
export function createDiscordJSAdapter(channel: VoiceChannel | StageChannel): DiscordGatewayAdapterCreator {
return (methods) => {
adapters.set(channel.guild.id, methods);
trackClient(channel.client);
trackGuild(channel.guild);
return {
sendPayload(data) {
if (channel.guild.shard.status === Constants.Status.READY) {
channel.guild.shard.send(data);
return true;
}
return false;
},
destroy() {
return adapters.delete(channel.guild.id);
},
};
};
}

View File

@ -21,6 +21,7 @@ module.exports = {
//Settings //Settings
prefix: process.env.RADIOX_PREFIX || "rx-", prefix: process.env.RADIOX_PREFIX || "rx-",
version: process.env.RADIOX_VERSION || process.env.npm_package_version version: process.env.RADIOX_VERSION || process.env.npm_package_version,
debug: process.env.DEBUG_MODE || false
} }