mirror of
https://github.com/Jerryplusy/crystelf-plugin.git
synced 2025-07-03 21:59:19 +00:00
fix:api路径错误
This commit is contained in:
parent
38c3a6c232
commit
862e081780
@ -55,9 +55,9 @@ export default class ReportBots extends plugin {
|
||||
message: msg.toString(),
|
||||
};
|
||||
const url = configControl.get('coreConfig')?.coreUrl;
|
||||
const returnData = await axios.post(url, sendData);
|
||||
if (returnData?.success) {
|
||||
return await e.reply(`操作成功:${returnData?.data.toString()}`);
|
||||
const returnData = await axios.post(`${url}/api/bot/broadcast`, sendData);
|
||||
if (returnData?.data?.success) {
|
||||
return await e.reply(`操作成功:${returnData?.data.data?.toString()}`);
|
||||
} else {
|
||||
return await e.reply(`广播出现错误,请检查日志..`);
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ class Handler {
|
||||
['error', this.handleError.bind(this)],
|
||||
['getGroupInfo', this.handleGetGroupInfo.bind(this)],
|
||||
['sendMessage', this.handleSendMessage.bind(this)],
|
||||
['broadcastMessage', this.broadcastMessage.bind(this)],
|
||||
['reportBots', this.reportBots.bind(this)],
|
||||
]);
|
||||
}
|
||||
@ -81,23 +80,12 @@ class Handler {
|
||||
*/
|
||||
// TODO 测试可用性
|
||||
async handleSendMessage(client, msg) {
|
||||
const botId = msg.data?.botId;
|
||||
const groupId = msg.data?.groupId;
|
||||
const message = msg.data?.message;
|
||||
const botId = Number(msg.data?.botId);
|
||||
const groupId = Number(msg.data?.groupId);
|
||||
const message = msg.data?.message?.toString();
|
||||
await botControl.sendMessage(botId, message, groupId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 广播消息,感觉没啥用,用core的广播代替了
|
||||
* @param client
|
||||
* @param msg
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async broadcastMessage(client, msg) {
|
||||
const message = msg.data?.message;
|
||||
await botControl.broadcastMessage(message);
|
||||
}
|
||||
|
||||
async reportBots(client, msg) {
|
||||
await botControl.reportBots();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user