一、安装starbot框架并设置回调地址:http://autMan地址:端口/sb/receive

就这个微信框架,目前免费的(支持微信3.9.10.16,后期会升级微信4.0),我为它写了咱奥特曼的适配器。适配器js附件在底部:
使用前需要先注册账号,注册地址http://starbot.chat/
二、安装适配器,从官方市场安装adapter_sb_http插件,重启autMan
适配器开发者可参照下面代码
下面代码存储为adapter_sb_http.js然后放到/plugin/adapters下面
//[param: {"required":true,"key":"im.sb.starbot_api","bool":false,"placeholder":"","name":"starbot接口","desc":"示例:http://192.168.31.77:10001/api/processor"}]
//[param: {"required":true,"key":"im.sb.starbot_token","bool":false,"placeholder":"","name":"Gewechat的uuid","desc":"示例:33926f9c42c04e4e8a9164bb5d38aad6"}]
const { WebSocket } = require('ws');
const axios = require('axios');
const middleware = require('./plugin/scripts/middleware.js');
// starbot的http接口地址
var port, imHttpApi, token
//接收数据
async function receiveAutData(websocketAut) {
  websocketAut.on('message', async (message) => {
    try {
      console.log(`Received from StarBot: ${message}`);
      const messageJson = JSON.parse(message);
      if ("data" in messageJson && "event" in messageJson) {
        var msg_data = messageJson.data;
        if (msg_data) {
          if (msg_data['messageSource'] === 1) {//自己的消息
            console.log("自己的消息不做处理");
            return;
          }
          const commsg = {
            bot_id: msg_data['robotId'],
            //user_name: "粉丝",
            im_type: "sb",
            message_id: msg_data['messageId'],
            content: msg_data["message"],
            raw_message: msg_data["message"]
          };
          if (msg_data["fromType"] === "group") {
            //msg_data["fromWxId"]去掉@chatroom
            commsg["chat_id"] = msg_data['fromWxId'].replace("@chatroom", "");
            commsg["user_id"] = msg_data['finalFromWxId'];
          } else {
            commsg["user_id"] = msg_data['fromWxId'];
          }
          var str = JSON.stringify(commsg);
          //console.log("整理好的消息内容:", str);
          await websocketAut.send(str);
        } else {
          console.log("data is null or undefined");
        }
      } else if ("aut_echo" in messageJson) {
        if (messageJson["aut_action"] === "reply_message" || messageJson["aut_action"] === "push_message") {
          //console.log("凹凸曼的回调消息:", messageJson);
          const autEcho = messageJson["aut_echo"];
          var send_content = messageJson['aut_params']['content'];
          //===========先处理内容,把图片和内容分开
          // 正则表达式匹配图片链接
          let final_text = send_content;
          let images = [];
          try {
            const regex = /\[CQ:image,file=.*?\]/g;
            const matches = send_content.match(regex);
            for (let index = 0; index < matches.length; index++) {
              const image = matches[index];
              final_text = final_text?.replace(image, '');
              var tmp = image?.replace("[CQ:image,file=", "").replace("]", "");
              if (tmp) {
                images.push(tmp);
              }
            }
          } catch (error) {
            console.log("提取图片出错:", error);
          }
          final_text = final_text?.replace(/\s*\n\s*\n/g, '\n');//去掉连续的空行
          let msgIds = [];
          //===============发送文本=======
          if (final_text?.length > 0) {
            const replyMessage = {
              type: "sendTextMessage",
              params:
              {
                robotId: messageJson["aut_params"]["bot_id"],
                wxId: messageJson["aut_params"]["user_id"],
                message: final_text
              }
            };
            if ("chat_id" in messageJson["aut_params"] && messageJson["aut_params"]["chat_id"] !== "") {
              replyMessage.params["wxId"] = messageJson["aut_params"]["chat_id"] + "@chatroom";
            }
            const messageId = await postData(replyMessage);
            if (messageId) {
              msgIds.push(messageId);
            }
          }
          //===============发送图片=======
          for (let index = 0; index < images.length; index++) {
            const image = images[index];
            const replyMessage = {
              type: "sendImageMessage",
              params:
              {
                robotId: messageJson["aut_params"]["bot_id"],
                wxId: messageJson["aut_params"]["user_id"],
                path: image
              }
            };
            if ("chat_id" in messageJson["aut_params"] && messageJson["aut_params"]["chat_id"] !== "") {
              replyMessage.params["wxId"] = messageJson["aut_params"]["chat_id"];
            }
            const messageId = await postData(replyMessage);
            console.log("发送图片的messageId:", messageId);
            if (messageId) {
              msgIds.push(messageId);
            }
          }
          //必须给autMan发送回执
          const echoMessage = {
            aut_echo: autEcho,
            aut_params: msgIds,
          };
          await websocketAut.send(JSON.stringify(echoMessage));
        } else if (messageJson["aut_action"] === "delete_message" && "aut_params" in messageJson && "message_id" in messageJson["aut_params"]) {
          const replyMessage = {
            type: "delete_msg",
            params: {
              message_id: messageJson["aut_params"]["message_id"]
            },
          };
          await postData(replyMessage);
        }
      }
    } catch (e) {
      console.log(`JSON解析错误: ${message}`);
    }
  });
}
//发送数据
async function postData(data) {
  try {
    const config = {
      headers: {
        'Authorization': token,
        'Content-Type': 'application/json'
      }
    };
    //如果data.params["wxId"]为纯数字,加上@chatroom
    if (data.params["wxId"] && !isNaN(data.params["wxId"])) {
      data.params["wxId"] = data.params["wxId"] + "@chatroom";
    }
    const response = await axios.post(`${imHttpApi}`, data, config);
    if (response?.data?.code === 200) {
      const messageId = response.data?.data?.instanceId;
      //console.log(`Messageid: ${messageId}`);
      return null;//这个微信暂时没有返回消息id,直接给null
    } else {
      console.log(`POST ${imHttpApi} failed with code ${response?.data?.code}${response?.data?.description}`);
      return null;
    }
  } catch (error) {
    console.log(`Error: Unexpected response format for ${imHttpApi}${error}`);
    return null;
  }
}
//主函数
async function main() {
  while (true) {
    port = await middleware.port();
    imHttpApi = await middleware.bucketGet("im.sb", "starbot_api");
    token = await middleware.bucketGet("im.sb", "starbot_token");
    if (imHttpApi && token && port) {
      break;
    } else {
      //等待5s
      await new Promise((resolve) => setTimeout(resolve, 5000));
    }
  }
  //autMan的websocket地址,请根据实际情况修改
  const uriAut = `ws://127.0.0.1:${port}/sb/adapter`;
  const websocketAut = new WebSocket(uriAut);
  websocketAut.on('open', () => {
    console.log('Connected to autMan');
  });
  websocketAut.on('close', () => {
    console.log('Connection closed');
  });
  websocketAut.on('error', (error) => {
    console.log(`Connection error: ${error}`);
  });
  await receiveAutData(websocketAut);
}
main();
三、设置参数
重启奥特曼后进入 本地开发->本地应用->adapter_sb_http->配参 

四、启用适配器,启用->保存->重启autMan
