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
notifyposts 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 asContentand the file downloaded intoMedia. - Discord passed attachments as links, and
ProcessWithVoiceneeds the audio itself. Image, audio and voice attachments are now downloaded intoMedia.Data, and a Discord voice message's audio isMediaTypeVoice. ProcessWithVoicefailed 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.comis 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
@everyoneor<!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.Commandsregisters commands onConnect, in the guild whenGuildIDis set and globally otherwise. Invocations are acknowledged at once and reach the sameOnMessagehandlers as text. - HTTP Interactions Endpoint:
WebhookHandler(publicKey)receives commands over HTTPS, verifying Discord's Ed25519 signature. - Media:
OutgoingMessage.Mediais sent as attachments (withData) or embeds (image URLs); received attachments map toIncomingMessage.Mediawithout downloading them. - Message events: edits, deletions and reactions arrive through
OnEvent.
See Discord.
Fixes¶
- Discord
GuildIDis 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/sqlitefrom 1.54.0 to 1.57.0 - Bump
github.com/slack-go/slackfrom 0.27.0 to 0.29.0 - Bump
github.com/grokify/mogofrom 0.74.6 to 0.74.7 - Bump
github.com/ergochat/irc-gofrom 0.6.0 to 0.7.0 - Bump
google.golang.org/protobuffrom 1.36.11 to 1.36.12 - Bump
go.mau.fi/whatsmeowand indirect dependencies to latest
Upgrade Guide¶
go get github.com/plexusone/[email protected]
- A Discord bot with
GuildIDset no longer handles messages from other guilds. LeaveGuildIDempty 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
ContentandMedia; setMaxMediaBytes: -1to 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.