-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Baibot reacts not only for !command and baibot, but also for any string contain baibot #21
Comments
This depends on the Matrix client that is used. baibot tries to determine if it's been mentioned by inspecting the If you send a message like this: {
"type": "m.room.message",
"content": {
"msgtype": "m.text",
"body": "https://github.com/etkecc/baibot/issues",
"m.mentions": {}
}
} .. which contains an The spec says that:
Older Matrix clients (which do not support the user mentions spec at all) do not include a They would send a message that looks like this: {
"type": "m.room.message",
"content": {
"msgtype": "m.text",
"body": "https://github.com/etkecc/baibot/issues"
}
} In such cases, baibot does not know if the message aims to mention it or not, and it falls back to doing string-matching ("is my full user id (e.g. One such client is Element iOS. Perhaps the old Element Android is behaving similarly. We'd love to drop this string-matching fallback and only rely on proper mentions (as supported by newer clients), but.. old clients are still very common. Without this string-matching fallback, old clients would not be able to mention the bot at all. Perhaps the string matching logic could be made smarter, but that's difficult too. The way people mention the bot varies:
Trying to improve string-matching should somehow account for all these use cases and will likely break some of them. I don't know if it's worth messing with it. Alternatively, we can try to strip certain well-known false-positive-triggering sequences (e.g. Another potential solution is to wait for the issue to auto-resolve itself as people migrate to better Matrix clients (like Element X, Fluffychat, ..). For completeness, I'll also mention a workaround that anyone can apply right now. As mentioned above, the bot does string matching against its full Matrix ID (e.g. This is configurable, however, via the |
We are using latest Element Web and Desktop Client. About the m.mention, you are right (not that I thought you are not right, I meant I just checked it to see it for myself), Element did not add m.mentions to the event. |
Element Web/Desktop should be adding a Only old Element on iOS and Android lacks support for it. Element X supports threads in the sense that it can display threaded messages and you can long-press -> "Reply in thread" to continue the thread. However, it doesn't render threads like old Element did (having a separate "thread view"). I find the new behavior good enough for usage with baibot. If you use many threads at the same time, it can get confusing, but.. I personally don't use it that way. |
doesn't seems so:
Element version: 1.11.83 |
ah, got it, with labs "Rich text editor" enabled in Element, it does not include m.mentions in events. |
Ah, thanks for finding that out! A quick check in the element-hq/element-web did not show any currently open issues for the "Rich text editor" lacking proper mentions support, except this issue (but I'm not sure if it's talking about the same problem). |
yeah, not sure if it makes much of sense to open an issue: "Issues 3.4k" ;-) Anyway, created element-hq/element-web#28383 |
Baibot reacts not only for !command and @baibot, but also for any string containing "baibot"
Is this intentionally and configurable?
for example pasting URLs like https://github.com/etkecc/baibot/issues in the chat room triggers baibot.
May not happen that often for "baibot" but if "accidently" use a more common string as bot name, like "bot" or "ai", it may trigger the bot far too often.
The text was updated successfully, but these errors were encountered: