tools.stream_to_channel module

Live-stream command output (stdout/stderr) into a Discord channel.

Runs a command via an existing SSH connection or locally, reads output incrementally, and pipes it into a Discord text channel by editing a message in-place. When a message fills up (~1900 chars) a new one is started, producing a scrolling-terminal effect.

Requires the UNSANDBOXED_EXEC privilege.