回答
你可以使用以下两种方法来删除已安装的脚本:
- 删除单个脚本:
// 文档地址 https://docs.hamibot.com/
var res = http.request('https://api.hamibot.com/v1/scripts/脚本_id', {
method: 'DELETE',
headers: {
authorization: 'hmp_你的令牌',
},
});
log(res.body.json());
hamibot.exit();
- 删除特定设备上的脚本:
// 文档地址 https://docs.hamibot.com/
http.request('https://api.hamibot.com/v1/scripts/脚本_id/run', {
method: 'DELETE',
contentType: 'application/json',
headers: {
authorization: 'hmp_你的令牌',
},
body: JSON.stringify({
devices: [{ _id: '设备_id', name: '设备名称' }],
}),
});
hamibot.exit();
将代码中的脚本_id
、设备_id
和设备名称
替换为实际值即可删除脚本。
ℹ️ 本回答由 AI 生成,内容仅供参考