tools.discord_upload_file module

Upload a file to a Discord channel, thread, or DM.

Handles all known Discord upload failure states including DM resolution, file size limits (per guild boost tier), archived/locked threads, forum/voice channels, rate limits, and transient network errors.

async tools.discord_upload_file.run(channel_id=None, user_id=None, content=None, filename=None, filepath=None, ctx=None)[source]

Execute this tool and return the result.

Parameters:
  • channel_id (str | None) – Discord/Matrix channel identifier.

  • user_id (str | None) – Unique identifier for the user.

  • content (str | None) – Content data.

  • filename (str | None) – The filename value.

  • filepath (str | None) – The filepath value.

  • ctx (ToolContext | None) – Tool execution context providing access to bot internals.

Returns:

Result string.

Return type:

str