Skip to content

feat(discord): include recent channel messages as context on @mention #178

@TerrysPOV

Description

@TerrysPOV

Problem

When the bot is @mentioned, it only sees the message that mentioned it. References like "implement the feature discussed above" or "fix the error from my last message" have no context to work from.

Proposed solution

Add an opt-in config key discord.mentionContextMessages (default: 0 = disabled):

{
  "discord": {
    "mentionContextMessages": 10
  }
}

When set, fetch the last N messages from the channel via GET /channels/{id}/messages before constructing the prompt, and prepend them as context. Filtered to text messages only (skip bot messages, attachments).

No change when set to 0 — existing behaviour preserved by default.

Source

Requested by @yinweisu in #14 (Mega-Post).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions