mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-11-10 03:40:19 +00:00
commit
aa116518b3
2
.github/workflows/typescript-build.yml
vendored
2
.github/workflows/typescript-build.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: install node v16
|
||||
uses: actions/setup-node@v2.4.1
|
||||
uses: actions/setup-node@v2.5.0
|
||||
with:
|
||||
node-version: 16
|
||||
- name: npm install
|
||||
|
921
package-lock.json
generated
921
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
24
package.json
24
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "eximiabots-radiox",
|
||||
"version": "0.3.12",
|
||||
"version": "0.3.13",
|
||||
"description": "Internet Radio to your Discord guild",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
@ -18,11 +18,11 @@
|
||||
"url": "https://github.com/warengroup/eximiabots-radiox/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@discordjs/builders": "^0.8.2",
|
||||
"@discordjs/builders": "^0.9.0",
|
||||
"@discordjs/opus": "^0.7.0",
|
||||
"@discordjs/rest": "^0.1.1-canary.0",
|
||||
"@discordjs/rest": "^0.2.0-canary.0",
|
||||
"@discordjs/voice": "^0.7.5",
|
||||
"discord-api-types": "^0.24.0",
|
||||
"discord-api-types": "^0.25.2",
|
||||
"discord.js": "^13.2.0",
|
||||
"dotenv": "^10.0.0",
|
||||
"libsodium-wrappers": "^0.7.9",
|
||||
@ -30,19 +30,19 @@
|
||||
"path": "^0.12.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.11.10",
|
||||
"@types/ws": "^8.2.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
||||
"@typescript-eslint/parser": "^5.4.0",
|
||||
"eslint": "^8.3.0",
|
||||
"@types/node": "^17.0.2",
|
||||
"@types/ws": "^8.2.2",
|
||||
"@typescript-eslint/eslint-plugin": "^5.8.0",
|
||||
"@typescript-eslint/parser": "^5.8.0",
|
||||
"eslint": "^8.5.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"nodemon": "^2.0.15",
|
||||
"prettier": "^2.5.0",
|
||||
"prettier": "^2.5.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-node": "^10.4.0",
|
||||
"tsc-watch": "^4.5.0",
|
||||
"typescript": "^4.5.2"
|
||||
"tsc-watch": "^4.6.0",
|
||||
"typescript": "^4.5.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.9.1",
|
||||
|
@ -70,17 +70,6 @@ module.exports = class {
|
||||
const url = station.stream[station.stream.default];
|
||||
const resource = createAudioResource(url);
|
||||
audioPlayer.play(resource);
|
||||
resource.playStream
|
||||
.on("readable", () => {
|
||||
this.logger('Streamer', station.name + " / " + "Readable");
|
||||
})
|
||||
.on("finish", () => {
|
||||
this.logger('Streamer', station.name + " / " + "Finished");
|
||||
})
|
||||
.on("error", error => {
|
||||
this.logger('Streamer', station.name + " / " + "Error" + "\n" + error);
|
||||
});
|
||||
|
||||
audioPlayer
|
||||
.on('playing', () => {
|
||||
this.logger('Streamer', station.name + " / " + "Playing");
|
||||
@ -88,6 +77,7 @@ module.exports = class {
|
||||
.on('idle', () => {
|
||||
this.logger('Streamer', station.name + " / " + "Idle");
|
||||
audioPlayer.removeAllListeners();
|
||||
if(this.mode == "manual" && audioPlayer.subscribers.length == 0) return;
|
||||
this.play(station);
|
||||
})
|
||||
.on('paused', () => {
|
||||
@ -117,15 +107,12 @@ module.exports = class {
|
||||
|
||||
listen(station) {
|
||||
let audioPlayer = this.map.get(station.name);
|
||||
if(!audioPlayer){
|
||||
audioPlayer = this.play(station);
|
||||
}
|
||||
if(!audioPlayer || this.mode == "manual" && audioPlayer.subscribers.length == 0) audioPlayer = this.play(station);
|
||||
return audioPlayer;
|
||||
}
|
||||
|
||||
leave(client) {
|
||||
if(!client.stations) return;
|
||||
|
||||
client.stations.forEach(station => {
|
||||
this.stop(station);
|
||||
});
|
||||
|
@ -60,6 +60,17 @@ module.exports = {
|
||||
Routes.applicationCommands(client.user.id),
|
||||
{ body: commands }
|
||||
);
|
||||
|
||||
let guilds = await client.guilds.fetch();
|
||||
guilds.forEach(async guild => {
|
||||
try {
|
||||
await rest.put(
|
||||
Routes.applicationGuildCommands(client.user.id, guild.id),
|
||||
{ body: [] }
|
||||
);
|
||||
} catch (DiscordAPIError) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
client.funcs.logger('Slash Commands', 'Successfully reloaded application (/) commands.' + "\n");
|
||||
|
@ -5,6 +5,7 @@ module.exports = {
|
||||
console.log(error.stack);
|
||||
console.log('');
|
||||
|
||||
if(error.name == "DiscordAPIError" && error.message == "Unknown interaction") return;
|
||||
process.emit('SIGINT');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user