Skip to content

[Bug] 🐛 TG 无法发送至指定话题 #25

@Harry-zklcdc

Description

@Harry-zklcdc

版本信息

Koishi 4.16.8
@myrtus/koishi-plugin-forward 3.9.1

配置文件

image
image
image

日志文件

2024-02-14 16:56:49 [E] forward Error: Telegram API error 400. Bad Request: chat not found
    at _Internal.<computed> [as sendMessage] (koishi/node_modules/@satorijs/adapter-telegram/lib/index.js:88:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _TelegramMessageEncoder.flush (koishi/node_modules/@satorijs/adapter-telegram/lib/index.js:465:22)
    at async _TelegramMessageEncoder.send (koishi/node_modules/@satorijs/core/lib/index.cjs:571:5)
    at async _TelegramBot.sendMessage (koishi/node_modules/@satorijs/core/lib/index.cjs:336:22)
    at async Proxy.<anonymous> (koishi/node_modules/@myrtus/koishi-plugin-forward/lib/core.js:164:40)

猜测可能下面这行代码导致

const messageIds = await bot.sendMessage(target.channelId, payload, target.guildId)

Koishi 的 bot.sendMessage 方法不支持 guildId 了,文档:https://koishi.chat/zh-CN/api/resources/message.html#bot-getmessage

可能需要特殊判断,使用 telegram 适配器内部方法 internal.sendMessage() 代替

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions