2025-12-11 11:30:18 +08:00

22 lines
418 B
TypeScript

export function sendMsg(msg: string, target_id: string, bot_url: string): Promise<Response> {
const replyMessage = {
user_id: String(target_id),
message: [
{
type: "text",
data: {
text: msg
}
}
]
}
return fetch(bot_url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(replyMessage)
});
}