Files
signalbot/doc.go
T
2026-11-20 15:40:03 +01:00

26 lines
1.1 KiB
Go

// Package signalbot sends and receives Signal text messages through a
// signal-cli-rest-api service (https://github.com/bbernhard/signal-cli-rest-api).
//
// signalbot is an unofficial client, not affiliated with Signal. The Signal
// protocol itself is handled by signal-cli inside the service container;
// this package is pure Go and only speaks HTTP and websocket to it.
//
// Basic usage:
//
// client, err := signalbot.New("http://signal-api:8080")
// if err != nil { ... }
//
// // Send to a group ("group.<base64>"), a phone number or an ACI UUID.
// err = client.Send(ctx, groupID, "Hello from signalbot")
//
// // Receive incoming text messages until ctx is cancelled.
// err = client.Listen(ctx, func(ctx context.Context, m signalbot.Message) {
// _ = m.Reply(ctx, "got it: "+m.Text)
// })
//
// The service must run with MODE=json-rpc (or json-rpc-native) and
// JSON_RPC_RECEIVE_MODE=manual, and Listen should run permanently, even if
// the application only publishes: receiving also processes the retry
// receipts that keep group members able to decrypt the bot's messages.
package signalbot