Skip to content

Release Notes: v0.9.0

Release Date: 2026-11-28

Summary

This release adds notices, short messages such as operational alerts posted to a Slack or Discord incoming webhook without a bot, and brings slash commands, an HTTP interactions endpoint, media and message events to the Discord provider. Bots now answer image and voice messages on Telegram and Discord, which they ignored before.

Highlights

  • Notices: package notify posts alerts to a Slack or Discord incoming webhook, chosen by the URL
  • Discord slash commands, an HTTP interactions endpoint, media attachments and message events
  • Image and voice messages are answered on Telegram and Discord (#34)

Image and Voice Messages

A bot built on the router stayed silent when sent an image or a voice message on Telegram or Discord. Four things combined:

  • Telegram handled text only, so other messages never reached OnMessage. It now receives photos, voice notes, audio, video, video notes, animations, stickers and documents, with the caption as Content and the file downloaded into Media.
  • Discord passed attachments as links, and ProcessWithVoice needs the audio itself. Image, audio and voice attachments are now downloaded into Media.Data, and a Discord voice message's audio is MediaTypeVoice.
  • ProcessWithVoice failed on a voice attachment without data. It now treats one as other media.
  • Image-only messages reached a text-only agent as empty text. They now go to an agent that reads media, or get a short reply.

Both providers take MaxMediaBytes (default 20 MB; negative downloads none). An attachment over the limit, or one that fails to download, still arrives, without Data.

Agents That Read Media

An agent that implements MediaAgentProcessor receives the whole message, with its Media:

func (a *Agent) ProcessMessage(ctx context.Context, sessionID string, msg provider.IncomingMessage) (string, error) {
    for _, m := range msg.Media {
        if m.Type == provider.MediaTypeImage {
            // m.Data, m.MimeType: pass the image to a vision model
        }
    }
    return a.reply(ctx, sessionID, msg.Content)
}

A text-only agent's sender gets DefaultUnsupportedMediaReply ("Sorry, I can only read text messages.") or, from ProcessWithVoice, DefaultUnsupportedMediaReplyVoice. Router.SetUnsupportedMediaReply changes it; an empty string sends none.

New Features

Notices

import "github.com/plexusone/omnichat/notify"

n, err := notify.NewWebhook(os.Getenv("ALERT_WEBHOOK_URL"))
if err != nil {
    return err
}
err = n.Notify(ctx, notify.Notice{
    Title:  "Sign-in mail halted",
    Text:   "The hourly budget was used up.",
    Fields: []notify.Field{{Name: "Sent", Value: "20 of 20"}},
    Level:  notify.LevelCritical,
})
  • The URL's host picks the service: hooks.slack.com is Slack, discord.com/api/webhooks/… is Discord, and any other host receives a generic JSON form. Moving an alert between services changes only the URL.
  • Markup in a notice is escaped, so it cannot mention @everyone or <!channel>, and Discord mentions are disabled.
  • The URL is a credential: errors never include it. Only https is accepted, except http to a loopback address for tests.

See Notices.

Discord

  • Slash commands: Config.Commands registers commands on Connect, in the guild when GuildID is set and globally otherwise. Invocations are acknowledged at once and reach the same OnMessage handlers as text.
  • HTTP Interactions Endpoint: WebhookHandler(publicKey) receives commands over HTTPS, verifying Discord's Ed25519 signature.
  • Media: OutgoingMessage.Media is sent as attachments (with Data) or embeds (image URLs); received attachments map to IncomingMessage.Media without downloading them.
  • Message events: edits, deletions and reactions arrive through OnEvent.

See Discord.

Fixes

  • Discord GuildID is enforced. It was stored but not checked, so any guild the bot was in could reach it. Messages and commands from other guilds are now ignored; DMs pass.

Dependencies

  • Bump modernc.org/sqlite from 1.54.0 to 1.57.0
  • Bump github.com/slack-go/slack from 0.27.0 to 0.29.0
  • Bump github.com/grokify/mogo from 0.74.6 to 0.74.7
  • Bump github.com/ergochat/irc-go from 0.6.0 to 0.7.0
  • Bump google.golang.org/protobuf from 1.36.11 to 1.36.12
  • Bump go.mau.fi/whatsmeow and indirect dependencies to latest

Upgrade Guide

go get github.com/plexusone/[email protected]
  • A Discord bot with GuildID set no longer handles messages from other guilds. Leave GuildID empty to serve every guild the bot is in.
  • Telegram and Discord bots now receive media messages and download their attachments. A handler that assumed every message has text should check Content and Media; set MaxMediaBytes: -1 to keep attachments as links (Discord) or without data (Telegram).
  • A text-only agent's sender now gets a reply to a media-only message. Call SetUnsupportedMediaReply("") to keep the old silence.