mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
37 lines
860 B
JavaScript
37 lines
860 B
JavaScript
/**
|
|
* 将只有 text 类型的数组转换为原生的 {Bot.makeForwardMsg}
|
|
* @param e
|
|
* @param textArray {string[]}
|
|
*/
|
|
export function textArrayToMakeForward(e, textArray) {
|
|
return textArray.map(item => {
|
|
return {
|
|
message: { type: "text", text: item },
|
|
nickname: e.sender.card || e.user_id,
|
|
user_id: e.user_id,
|
|
};
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 发送群组音乐卡片
|
|
* @param e
|
|
* @param platformType 音乐平台
|
|
* @param musicId 音乐id
|
|
*/
|
|
|
|
export async function sendMusicCard(e, platformType, musicId) {
|
|
await e.bot.sendApi('send_group_msg', {
|
|
group_id: e.group.group_id,
|
|
message: [
|
|
{
|
|
type: 'music',
|
|
data: {
|
|
type: platformType,
|
|
id: musicId
|
|
}
|
|
}
|
|
]
|
|
});
|
|
}
|