matrixbot

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PushEntries

func PushEntries(feed *model.Feed, entries model.Entries, matrixBaseURL, matrixUsername, matrixPassword, matrixRoomID string) error

PushEntry pushes entries to matrix chat using integration settings provided

Types

type Client added in v2.0.48

type Client struct {
	// contains filtered or unexported fields
}

func NewClient added in v2.0.48

func NewClient(matrixBaseURL string) *Client

func (*Client) Login added in v2.0.48

func (c *Client) Login(homeServerURL, matrixUsername, matrixPassword string) (*LoginResponse, error)

Specs https://spec.matrix.org/v1.8/client-server-api/#post_matrixclientv3login

func (*Client) SendFormattedTextMessage added in v2.0.48

func (c *Client) SendFormattedTextMessage(homeServerURL, accessToken, roomID, textMessage, formattedMessage string) (*RoomEventResponse, error)

Specs https://spec.matrix.org/v1.8/client-server-api/#put_matrixclientv3roomsroomidsendeventtypetxnid

type DiscoveryEndpointResponse added in v2.0.48

type DiscoveryEndpointResponse struct {
	HomeServerInformation     HomeServerInformation     `json:"m.homeserver"`
	IdentityServerInformation IdentityServerInformation `json:"m.identity_server"`
}

type HomeServerInformation added in v2.0.48

type HomeServerInformation struct {
	BaseURL string `json:"base_url"`
}

type IdentityServerInformation added in v2.0.48

type IdentityServerInformation struct {
	BaseURL string `json:"base_url"`
}

type LoginRequest added in v2.0.48

type LoginRequest struct {
	Type       string         `json:"type"`
	Identifier UserIdentifier `json:"identifier"`
	Password   string         `json:"password"`
}

type LoginResponse added in v2.0.48

type LoginResponse struct {
	UserID      string `json:"user_id"`
	AccessToken string `json:"access_token"`
	DeviceID    string `json:"device_id"`
	HomeServer  string `json:"home_server"`
}

type RoomEventResponse added in v2.0.48

type RoomEventResponse struct {
	EventID string `json:"event_id"`
}

type TextMessageEventRequest added in v2.0.48

type TextMessageEventRequest struct {
	MsgType       string `json:"msgtype"`
	Body          string `json:"body"`
	Format        string `json:"format"`
	FormattedBody string `json:"formatted_body"`
}

type UserIdentifier added in v2.0.48

type UserIdentifier struct {
	Type string `json:"type"`
	User string `json:"user"`
}

Jump to

Keyboard shortcuts

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