-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🧩 Separate from the main processing.
- Loading branch information
Showing
2 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const { info } = require("log-symbols"); | ||
const express = require("express"); | ||
const app = express(); | ||
const port = 8080; | ||
|
||
module.exports = (client) => { | ||
app.get("/", (req, res) => { | ||
res.send("Copyright (c) 2020-2022 Maseshi(Chaiwat Suwannarat). All rights reserved.") | ||
}); | ||
|
||
app.listen(port, () => { | ||
console.log(info + " Remote monitoring is now available at http://localhost:" + port); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
module.exports = (client) => { | ||
client.music.on("playSong", (queue, song) => { | ||
queue.textChannel.send(client.translate.main.distube.playSong.playing_song.replace("%s1", song.name).replace("%s2", song.formattedDuration)); | ||
}); | ||
|
||
client.music.on("addSong", (queue, song) => { | ||
queue.textChannel.send(client.translate.main.distube.addSong.added_song.replace("%s1", song.name).replace("%s2", song.formattedDuration)); | ||
}); | ||
|
||
client.music.on("addList", (queue, playlist) => { | ||
const list = playlist.map((songs, index) => "**" + index + "**. " + songs.name); | ||
|
||
queue.textChannel.send({ | ||
"embeds": [ | ||
{ | ||
"title": playlist.name, | ||
"description": client.translate.main.distube.addList.timer_choose.replace("%s", list), | ||
"color": 16296490, | ||
"timestamp": new Date(), | ||
"footer": { | ||
"icon_url": queue.member.user.displayAvatarURL(), | ||
"text": queue.member.user.username | ||
} | ||
} | ||
] | ||
}); | ||
}); | ||
|
||
client.music.on("searchResult", (message, result) => { | ||
let index = 0; | ||
const search = result.map(song => "**" + (++index) + "**. " + song.name + " - `" + song.formattedDuration + "`").join("\n"); | ||
|
||
message.channel.send({ | ||
"embeds": [ | ||
{ | ||
"title": client.translate.main.distube.searchResult.searching.replace("%s", search), | ||
"description": client.translate.main.distube.addList.timer_choose.replace("%s", search), | ||
"color": 16296490, | ||
"timestamp": new Date(), | ||
"footer": { | ||
"icon_url": message.author.displayAvatarURL(), | ||
"text": message.author.username | ||
} | ||
} | ||
] | ||
}); | ||
client.music.options.searchSongs = false; | ||
}); | ||
|
||
client.music.on("searchCancel", (message, query) => { | ||
message.reply(client.translate.main.distube.searchCancel.search_cancelled); | ||
client.music.options.searchSongs = false; | ||
}); | ||
|
||
client.music.on("initQueue", (queue) => { | ||
queue.autoplay = false; | ||
queue.volume = 100; | ||
queue.filter = "clear"; | ||
queue.createdTimestamp = new Date(); | ||
}); | ||
|
||
client.music.on("empty", (queue) => { | ||
queue.textChannel.send(client.translate.main.distube.empty.no_user_in_channel); | ||
}); | ||
|
||
client.music.on("finish", (queue) => { | ||
queue.textChannel.send(client.translate.main.distube.finish.queue_is_empty); | ||
}); | ||
|
||
client.music.on("error", (channel, error) => { | ||
console.error(error); | ||
}); | ||
}; |