n8n-nodes-onebot-api
Version:
OneBot node for n8n workflow, now you can send message to your QQ friend or group. This version includes optimized group and private chat operations and enhanced permission grading. OneBot 节点用于 n8n 工作流,现在您可以向您的 QQ 朋友或群组发送消息。此版本包括优化的群聊和私聊操作以及增强的权限分级。
31 lines • 1.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.executeBotOperation = void 0;
const GenericFunctions_1 = require("./GenericFunctions");
async function executeBotOperation(index) {
const operation = this.getNodeParameter('operation', index);
let responseData = {};
let body = {};
let query = {};
let method = 'GET';
let endpoint = '';
switch (operation) {
case 'get_login_info':
endpoint = 'get_login_info';
method = 'GET';
break;
default:
throw new Error(`未知的机器人操作: ${operation}`);
}
if (method === 'GET') {
console.log(`执行机器人操作: ${operation}, 端点: ${endpoint}, 查询参数:`, JSON.stringify(query));
responseData = await GenericFunctions_1.apiRequest.call(this, method, endpoint, undefined, query);
}
else {
console.log(`执行机器人操作: ${operation}, 端点: ${endpoint}, 请求体:`, JSON.stringify(body));
responseData = await GenericFunctions_1.apiRequest.call(this, method, endpoint, body);
}
return responseData;
}
exports.executeBotOperation = executeBotOperation;
//# sourceMappingURL=BotActions.js.map