v0.0.0-...-f571ccf Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2021 License: MIT Imports: 11 Imported by: 0




View Source
const (
	// ThreadRelation uses hardcoded value of element clients, should be replaced to m.thread after the MSC3440 release,
	// ref:
	ThreadRelation = "io.element.thread"

	// TypingTimeout in milliseconds, used to avoid stuck typing status
	TypingTimeout = 5_000


This section is empty.


This section is empty.


type Bot

type Bot struct {
	// contains filtered or unexported fields

Bot represents matrix bot

func NewBot

func NewBot(cfg *Config) (*Bot, error)

NewBot creates a new matrix bot

func (*Bot) Start

func (b *Bot) Start() error

Start performs matrix /sync

func (*Bot) Stop

func (b *Bot) Stop()

Stop the bot

func (*Bot) WithStore

func (b *Bot) WithStore() error

WithStore adds persistent storage to the bot. Right now it uses account data store, but will be changed in future

type Config

type Config struct {
	// Homeserver url
	Homeserver string
	// Login is a localpart (honoroit - OK, - wrong)
	Login string
	// Password for login/password auth only
	Password string
	// Token for access token auth only (not implemented yet)
	Token string
	// RoomID where threads will be created
	RoomID string
	// LogLevel for logger
	LogLevel string

	// Text messages
	Text *Text

Config represents matrix config

type Text

type Text struct {
	// Greetings message sent to customer on first contact
	Greetings string
	// Error message sent to customer if something goes wrong
	Error string
	// EmptyRoom message sent to backoffice/threads room when customer left his room
	EmptyRoom string
	// Done message sent to customer when request marked as done in the threads room
	Done string

Text messages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL