Skip to content

Feature: attach files to bot messages #1

@pipiroska

Description

@pipiroska

Summary

The bot can already read files attached to user messages ( collects attachment URLs and injects them into the prompt). However the bot currently has no way to send files as Discord attachments in its own messages.

Motivation

Useful when the agent produces output that is best consumed as a file (logs, generated code, data exports, images, etc.). Pasting large blobs inline degrades readability.

Proposed changes

1. LiveMessagePayload — add optional file support

interface LiveMessagePayload {
  content?: string;
  embeds?: EmbedBuilder[];
  files?: (AttachmentBuilder | string)[]; // new
}

2. LiveDiscordRunRenderer — expose attachFile(path)

Queue a local file path (or AttachmentBuilder) for the next flush.

3. Message targets — forward files on send/edit

createChannelLiveMessageTarget and createInteractionLiveMessageTarget should include files in the payload when calling send / edit.

4. Tool exposure

Provide a built-in or skill-level tool so the agent can call something like:

attachFile({ path: '/tmp/result.csv', filename: 'result.csv' })

…and it will be delivered with the next bot reply.

Notes

  • Discord does not support editing a message to add attachments after the fact; files must be included on the initial send or a follow-up message.
  • File size limit: 8 MB (25 MB with Nitro / boosted server).
  • Related code: src/core/live-discord-renderer.ts, src/discord/message-helpers.ts

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