MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / MusicBotPlugin

Class MusicBotPlugin

music_bot/music_bot.ts:222–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220
221 description: string = `\n多音源音乐搜索\n${help_text}`;
222 cmdHandlers: Record<
223 string,
224 (msg: Api.Message, trigger?: Api.Message) => Promise<void>
225 > = {
226 music_bot: async (msg: Api.Message, trigger?: Api.Message) => {
227 const text = msg.message || "";
228 const parts = text.trim().split(/\s+/);
229 const action = parts[1] || "";
230 const keyword = getRemarkFromMsg(msg, 1);
231 await searchAndSendMusic(msg, action, keyword, bots.default);
232 },
233 mbs: async (msg: Api.Message, trigger?: Api.Message) => {
234 const action = "search";
235 const keyword = getRemarkFromMsg(msg, 0);
236 await searchAndSendMusic(msg, action, keyword, bots.default);
237 },
238 mbkw: async (msg: Api.Message, trigger?: Api.Message) => {
239 const action = "kuwo";
240 const keyword = getRemarkFromMsg(msg, 0);
241 await searchAndSendMusic(msg, action, keyword, bots.default);
242 },
243 mbkg: async (msg: Api.Message, trigger?: Api.Message) => {
244 const action = "kugou";
245 const keyword = getRemarkFromMsg(msg, 0);
246 await searchAndSendMusic(msg, action, keyword, bots.default);
247 },
248 mbqq: async (msg: Api.Message, trigger?: Api.Message) => {
249 const action = "qq";
250 const keyword = getRemarkFromMsg(msg, 0);
251 await searchAndSendMusic(msg, action, keyword, bots.default);
252 },
253 mbne: async (msg: Api.Message, trigger?: Api.Message) => {
254 const action = "netease";
255 const keyword = getRemarkFromMsg(msg, 0);
256 await searchAndSendMusic(msg, action, keyword, bots.default);
257 },
258 mbvk: async (msg: Api.Message, trigger?: Api.Message) => {
259 const action = "vk";
260 const keyword = getRemarkFromMsg(msg, 0);
261 await searchAndSendMusic(msg, action, keyword, bots.vk);
262 },
263 mbym: async (msg: Api.Message, trigger?: Api.Message) => {
264 const action = "ym";
265 const keywordBase = getRemarkFromMsg(msg, 0);
266 const keyword = keywordBase ? `${keywordBase} lyric】` : "";
267 await searchAndSendMusic(msg, action, keyword, bots.ym, keywordBase);
268 },
269 };
270}
271
272export default new MusicBotPlugin();

Callers

nothing calls this directly

Calls 2

searchAndSendMusicFunction · 0.85
getRemarkFromMsgFunction · 0.70

Tested by

no test coverage detected