Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Telegram 群聊报错 #1314

Closed
Ice-Hazymoon opened this issue Dec 19, 2023 · 5 comments
Closed

Bug: Telegram 群聊报错 #1314

Ice-Hazymoon opened this issue Dec 19, 2023 · 5 comments
Labels
bug BUG

Comments

@Ice-Hazymoon
Copy link

Describe the bug

session.argv undefined

image

 app TypeError: Cannot set properties of undefined (setting 'root')
                            at Proxy.<anonymous> (E:\Project\bot\node_modules\@koishijs\core\src\command\index.ts:71:22)    
                            at Proxy.emit (E:\Project\bot\node_modules\cordis\src\events.ts:99:16)
                            at _TelegramBot.dispatch (E:\Project\bot\node_modules\@satorijs\core\src\bot.ts:157:20)
                            at handleUpdate (E:\Project\bot\node_modules\@satorijs\adapter-telegram\src\utils.ts:105:7)     
                            at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Steps to reproduce

如题

Expected behavior

如题

Screenshots

No response

Versions

{
    "@koishijs/plugin-adapter-discord": "^4.1.7",
    "@koishijs/plugin-adapter-lark": "3.2.0",
    "@koishijs/plugin-adapter-line": "2.2.0",
    "@koishijs/plugin-adapter-mail": "^2.1.3",
    "@koishijs/plugin-adapter-slack": "^2.1.0",
    "@koishijs/plugin-adapter-telegram": "^4.2.0",
    "@koishijs/plugin-adapter-whatsapp": "^2.2.0",
    "@koishijs/plugin-admin": "^1.4.0",
    "@koishijs/plugin-auth": "^4.1.6",
    "@koishijs/plugin-bind": "^1.4.5",
    "@koishijs/plugin-commands": "^3.4.3",
    "@koishijs/plugin-config": "^2.7.0",
    "@koishijs/plugin-console": "^5.22.0",
    "@koishijs/plugin-database-mysql": "5.7.4",
    "@koishijs/plugin-dataview": "^2.3.1",
    "@koishijs/plugin-explorer": "^1.5.0",
    "@koishijs/plugin-hmr": "^1.2.6",
    "@koishijs/plugin-insight": "^3.4.4",
    "@koishijs/plugin-locales": "^2.5.1",
    "@koishijs/plugin-logger": "^2.6.1",
    "@koishijs/plugin-market": "2.7.1",
    "@koishijs/plugin-sandbox": "3.2.2",
    "@koishijs/plugin-server": "^3.1.3",
    "@koishijs/plugin-status": "^7.3.0",
    "koishi": "^4.16.1",
    "koishi-plugin-assets-local": "^3.2.0",
    "koishi-plugin-message-logger": "2.0.0",
    "@koishijs/client": "^5.22.0",
    "@koishijs/scripts": "^4.5.0",
  }

Additional context

No response

@Ice-Hazymoon Ice-Hazymoon added the bug BUG label Dec 19, 2023
@shigma
Copy link
Member

shigma commented Dec 19, 2023

方便给一下 session.content 完整内容吗?

@Ice-Hazymoon
Copy link
Author

我记得是空的,所以args解析出来也是空的

@shigma
Copy link
Member

shigma commented Dec 19, 2023

image

空的也能触发 bot command 吗?能看下输入内容吗?

@Ice-Hazymoon
Copy link
Author

内容应该是

/help@bot_name

session.content 是空的,但是 session.stripped.content 是有内容的,我不知道这俩参数有啥区别,我把 https://github.com/koishijs/koishi/blob/master/packages%2Fcore%2Fsrc%2Fcommand%2Findex.ts#L78-L84 这部分的内容加在了 interaction/command 函数里就不报错了,勉强能临时用用

@shigma
Copy link
Member

shigma commented Dec 20, 2023

Koishi 侧的修复已经完成了,下个版本实装。

Telegram 适配器的部分稍后补上。

如果更新 Koishi 后仍然有此问题,可以 reopen。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug BUG
Projects
None yet
Development

No branches or pull requests

2 participants