最新gewe机器人开发教程

随着人工智能和自动化技术的快速发展,微信机器人已经成为越来越多人的选择。它们可以帮助我们自动回复 消息、管理群组、发送定时消息等,极大地提高了我们的工作效率。而GeWe框架,作为一款开源的微信机器人框架,为 开发者提供了便捷的开发体验。接下来,让我们一步步打造属于自己的微信机器人。

发送文字消息

请求参数

Header 参数

export interface ApifoxModel {
    "X-GEWE-TOKEN": string;
    [property: string]: any;
}

Body 参数application/json

export interface ApifoxModel {
    /**
     * 设备ID
     */
    appId: string;
    /**
     * @的好友,多个英文逗号分隔。群主或管理员@全部的人,则填写'notify@all'
     */
    ats?: string;
    /**
     * 消息内容
     */
    content: string;
    /**
     * 好友/群的ID
     */
    toWxid: string;
    [property: string]: any;
}

示例

{
    "appId": "",
    "toWxid": "34757816141@chatroom",
    "ats": "wxid_phyyedw9xap22",
    "content": "@猿猴 我在测试艾特内容"
}

示例代码

curl --location --request POST 'http://api.geweapi.com/gewe/v2/api/message/postText' \
--header 'X-GEWE-TOKEN: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "appId": "",
    "toWxid": "34757816141@chatroom",
    "ats": "wxid_phyyedw9xap22",
    "content": "@猿猴 我在测试艾特内容"
}'

返回响应

成功(200)

HTTP 状态码: 200 内容格式: JSON application/json

数据结构

export interface ApifoxModel {
    data: Data;
    msg: string;
    ret: number;
    [property: string]: any;
}

export interface Data {
    /**
     * 发送时间
     */
    createTime: number;
    /**
     * 消息ID
     */
    msgId: number;
    /**
     * 消息ID
     */
    newMsgId: number;
    /**
     * 接收人的wxid
     */
    toWxid: string;
    /**
     * 消息类型
     */
    type: number;
    [property: string]: any;
}

示例

{
    "ret": 200,
    "msg": "操作成功",
    "data": {
        "toWxid": "34757816141@chatroom",
        "createTime": 1703841160,
        "msgId": 0,
        "newMsgId": 3768973957878705021,
        "type": 1
    }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值