Documentation
¶
Index ¶
- func InteractiveSetup(ctx context.Context) error
- type SimplexAdapter
- func (a *SimplexAdapter) AddReaction(ctx context.Context, chatID, messageID, emoji string) error
- func (a *SimplexAdapter) Connect(ctx context.Context, isReconnect bool) (bool, error)
- func (a *SimplexAdapter) Disconnect(ctx context.Context) error
- func (a *SimplexAdapter) GetChatInfo(ctx context.Context, chatID string) (map[string]any, error)
- func (a *SimplexAdapter) ListChannels(ctx context.Context) (any, error)
- func (a *SimplexAdapter) Send(ctx context.Context, chatID, content, replyTo string, metadata map[string]any) (gateway.SendResult, error)
- func (a *SimplexAdapter) SendDocument(ctx context.Context, chatID, filePath, caption, fileName, replyTo string, ...) (gateway.SendResult, error)
- func (a *SimplexAdapter) SendImage(ctx context.Context, chatID, imageURL, caption, replyTo string, ...) (gateway.SendResult, error)
- func (a *SimplexAdapter) SendImageFile(ctx context.Context, chatID, imagePath, caption, replyTo string, ...) (gateway.SendResult, error)
- func (a *SimplexAdapter) SendTyping(ctx context.Context, chatID string, metadata map[string]any) error
- func (a *SimplexAdapter) SendVideo(ctx context.Context, chatID, videoPath, caption, replyTo string, ...) (gateway.SendResult, error)
- func (a *SimplexAdapter) SendVoice(ctx context.Context, chatID, audioPath, caption, replyTo string, ...) (gateway.SendResult, error)
- func (a *SimplexAdapter) TextBatchKey(ctx context.Context, event *gateway.MessageEvent) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InteractiveSetup ¶
SimpleX Chat wizard of icebath gateway setup writing the daemon settings to the home .env
Types ¶
type SimplexAdapter ¶
type SimplexAdapter struct {
*gateway.BasePlatformAdapter
// contains filtered or unexported fields
}
SimpleX Chat adapter over the simplex-chat daemon WebSocket API
func NewSimplexAdapter ¶
func NewSimplexAdapter(ctx context.Context, config *gateway.PlatformConfig) (*SimplexAdapter, error)
Adapter for a platform config reading the daemon URL from extra and the accept and group policy from env then extra
func (*SimplexAdapter) AddReaction ¶
func (a *SimplexAdapter) AddReaction(ctx context.Context, chatID, messageID, emoji string) error
Adds an emoji reaction to a chat item, SimpleX answering chatCmdError for a reaction it does not allow
func (*SimplexAdapter) Connect ¶
Probes the daemon, then starts the listener and the idle monitor and marks the adapter connected
func (*SimplexAdapter) Disconnect ¶
func (a *SimplexAdapter) Disconnect(ctx context.Context) error
Stops both tasks, closes the socket, cancels pending batches and replies and marks the adapter disconnected
func (*SimplexAdapter) GetChatInfo ¶
Chat info of a group or direct chat id
func (*SimplexAdapter) ListChannels ¶
func (a *SimplexAdapter) ListChannels(ctx context.Context) (any, error)
Contacts and groups of the daemon for the channel directory, nil while the socket is down or the daemon is silent
func (*SimplexAdapter) Send ¶
func (a *SimplexAdapter) Send(ctx context.Context, chatID, content, replyTo string, metadata map[string]any) (gateway.SendResult, error)
Sends the text without waiting for a reply, then every MEDIA tag path as a voice note or a document
func (*SimplexAdapter) SendDocument ¶
func (a *SimplexAdapter) SendDocument(ctx context.Context, chatID, filePath, caption, fileName, replyTo string, metadata, extra map[string]any) (gateway.SendResult, error)
Sends a local file as a file message
func (*SimplexAdapter) SendImage ¶
func (a *SimplexAdapter) SendImage(ctx context.Context, chatID, imageURL, caption, replyTo string, metadata map[string]any) (gateway.SendResult, error)
Sends an image from a file URL or a downloaded web URL with an inline thumbnail
func (*SimplexAdapter) SendImageFile ¶
func (a *SimplexAdapter) SendImageFile(ctx context.Context, chatID, imagePath, caption, replyTo string, metadata, extra map[string]any) (gateway.SendResult, error)
Sends a local image through the file URL path of the image send
func (*SimplexAdapter) SendTyping ¶
func (a *SimplexAdapter) SendTyping(ctx context.Context, chatID string, metadata map[string]any) error
SimpleX has no typing indicator
func (*SimplexAdapter) SendVideo ¶
func (a *SimplexAdapter) SendVideo(ctx context.Context, chatID, videoPath, caption, replyTo string, metadata, extra map[string]any) (gateway.SendResult, error)
Sends a video as a file attachment
func (*SimplexAdapter) SendVoice ¶
func (a *SimplexAdapter) SendVoice(ctx context.Context, chatID, audioPath, caption, replyTo string, metadata, extra map[string]any) (gateway.SendResult, error)
Sends an audio file as an inline voice note carrying the duration the caller passed
func (*SimplexAdapter) TextBatchKey ¶
func (a *SimplexAdapter) TextBatchKey(ctx context.Context, event *gateway.MessageEvent) (string, error)
Batch key of a text event, the platform value and the chat id