mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-01 20:42:50 +08:00
feat(qq): add radar FM stream
This commit is contained in:
1 parent
a861b41809
commit
e0d17cf404
6 files changed
+217
-84
No files matched your search
@@ -87,6 +87,22 @@ export function createPlayerRouter(
|
||||
router.post("/:botId/stop", simpleCommand("!stop"));
|
||||
router.post("/:botId/clear", simpleCommand("!clear"));
|
||||
|
||||
router.post("/:botId/fm", async (req, res) => {
|
||||
try {
|
||||
const bot = (req as any).bot;
|
||||
const { platform } = req.body;
|
||||
const provider = bot.getProviderFor(
|
||||
platform === "bilibili" || platform === "qq" || platform === "youtube"
|
||||
? platform
|
||||
: "netease"
|
||||
);
|
||||
const message = await bot.startFm(provider);
|
||||
res.json({ ok: !message.startsWith("No FM songs") && !message.includes("not available"), message });
|
||||
} catch (err) {
|
||||
res.status(500).json({ error: (err as Error).message });
|
||||
}
|
||||
});
|
||||
|
||||
router.post("/:botId/volume", async (req, res) => {
|
||||
try {
|
||||
const bot = (req as any).bot;
|
||||
|
||||
Reference in new issue
Block a user