Add author_is_bot to MessageResponse so bots can filter bot messages #73

Open
opened 2026-04-26 16:46:28 +00:00 by icub3d · 0 comments
Owner

Migrated from GitHub issue icub3d/decentcom#114
Original Author: @icub3d
Original Date: 2026-04-23T23:57:10Z


Problem

MessageResponse (and by extension the bot SDK's MessageEvent) does not include an author_is_bot field. This means bots like modbot cannot distinguish messages sent by other bots from messages sent by users.

Currently modbot only ignores its own messages via evt.author_id == ctx.bot_user_id(). If another bot (e.g. welcomebot) sends a welcome message, modbot runs it through the spam detector. In practice this is low-risk today, but it will become a real issue as more bots are added.

Proposed fix

  1. server/src/messages/models.rs — add author_is_bot: bool to MessageResponse, populated by joining on the users table (or passing it through from the storage layer).
  2. tools/bot-sdk/src/events.rs — add author_is_bot: bool to MessageEvent.
  3. tools/bots/modbot/src/main.rs — add an early return when evt.author_is_bot is true, consistent with how MemberEvent::is_bot is handled in the welcomebot.

Labels

  • area:api
  • area:core
  • type:feature
**Migrated from GitHub issue icub3d/decentcom#114** **Original Author:** @icub3d **Original Date:** 2026-04-23T23:57:10Z --- ## Problem `MessageResponse` (and by extension the bot SDK's `MessageEvent`) does not include an `author_is_bot` field. This means bots like modbot cannot distinguish messages sent by other bots from messages sent by users. Currently modbot only ignores its own messages via `evt.author_id == ctx.bot_user_id()`. If another bot (e.g. welcomebot) sends a welcome message, modbot runs it through the spam detector. In practice this is low-risk today, but it will become a real issue as more bots are added. ## Proposed fix 1. **`server/src/messages/models.rs`** — add `author_is_bot: bool` to `MessageResponse`, populated by joining on the `users` table (or passing it through from the storage layer). 2. **`tools/bot-sdk/src/events.rs`** — add `author_is_bot: bool` to `MessageEvent`. 3. **`tools/bots/modbot/src/main.rs`** — add an early return when `evt.author_is_bot` is true, consistent with how `MemberEvent::is_bot` is handled in the welcomebot. ## Labels - `area:api` - `area:core` - `type:feature`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
icub3d/decentcom#73
No description provided.