matrix

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MaxRetries = 10

MaxRetries for operations

View Source
const Page = 100

Page is a amount of messages per page

View Source
const RetryDelay = 10 * time.Second

RetryDelay between retries

Variables

This section is empty.

Functions

func Exit

func Exit()

Exit / stop matrix client

func Init

func Init(hs, login, password string, roomID id.RoomID, alias id.RoomAlias, ignore string) error

Init matrix client

func IsRoom

func IsRoom(room string) (bool, error)

IsRoom checks if room is valid room alias or room ID. True = alias, False = room ID

func ResolveServer

func ResolveServer(homeserver string) (string, error)

ResolveServer resolves actual homeserver URL from possible delegated host

Types

type Message

type Message struct {
	// ID is a matrix event id of the message
	ID id.EventID
	// Replace is a matrix ID of old (replaced) event
	Replace id.EventID
	// ReplacedNote is a text note usable from template to mark replaced message as updated
	ReplacedNote string
	// Author is a matrix id of the sender
	Author id.UserID
	// Text is the message body in plaintext/markdown format
	Text string
	// HTML is the message body in html format
	HTML string
	// CreatedAt is a timestamp, format: 2006-01-02 15:04 UTC
	CreatedAt string
	// CreatedAtFull is a time.Time object
	CreatedAtFull time.Time
}

Message struct

func Messages

func Messages(limit int) ([]*Message, error)

Messages of the room Note on limit - the output slice may be less size than limit you sent in the following cases: * room contains less messages than limit * some room messages don't contain body/formatted body

Jump to

Keyboard shortcuts

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