用bot.sendmessage向QQ频道推送消息错误

尝试使用bot.sendmessage向QQ频道推送消息,从QQ首先返回以下主要错误

[response] { message: '400: Bad Request', code: 10001 }
AxiosError: Request failed with status code 401
[response] { message: 'get guild id failed', code: 11263 }
AxiosError: Request failed with status code 400

查官方openapi发现,10001代表账号异常,11263代表ErrorCheckGuildAuth 检查频道权限失败
这是tx没有给bot主动推送消息的权限吗?需要申请吗

3 个赞

主动推送消息的权限需要频道主授予机器人

2 个赞

已经给了的,这个很确定
使用的是

export function apply(ctx: Context, config: Config) {
    let now_bot = ctx.bots[`${'qqguild'}:${botID}`]
    now_bot.sendMessage('114514', '全体目光向我看齐')
  })
3 个赞

主动消息有上限建议使用被动先测试

3 个赞

被动消息都没问题了的

2 个赞

公域的话 默认每天单个子频道20条消息 你可以修改成99

2 个赞

私域机器人,况且现在我一条主动消息没发过

2 个赞