mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 01:01:09 +02:00
docs(matrix-bot-common): document bot-to-bot loop prevention
Added documentation for the isBot() method and automatic bot message filtering that prevents infinite loops when multiple bots share a room. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
97264cd849
commit
43ac782892
1 changed files with 5 additions and 0 deletions
|
|
@ -67,6 +67,11 @@ export class MyBotService extends BaseMatrixService {
|
|||
- `sendNotice(roomId, message)` - Non-highlighted message
|
||||
- `downloadMedia(mxcUrl)` - Download from Matrix
|
||||
- `uploadMedia(buffer, contentType, filename)` - Upload to Matrix
|
||||
- `isBot(sender)` - Check if sender is a bot (prevents bot-to-bot loops)
|
||||
|
||||
**Bot-to-Bot Loop Prevention:**
|
||||
|
||||
The base class automatically ignores messages from other bots to prevent infinite message loops when multiple bots are in the same room. A sender is considered a bot if their Matrix ID localpart contains `-bot` or ends with `bot` (e.g., `@mana-bot:server`, `@todobot:server`).
|
||||
|
||||
### HealthController
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue