bot

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run()

Run starts the bot, blocking until an interrupt or SIGTERM is received

Types

type StateEventPowerLevel

type StateEventPowerLevel struct {
	Type           string                      `json:"type"`
	Sender         string                      `json:"sender"`
	RoomID         string                      `json:"room_id"`
	EventID        string                      `json:"event_id"`
	OriginServerTS int64                       `json:"origin_server_ts"`
	Content        StateEventPowerLevelContent `json:"content"`
	Unsigned       struct {
		Age int `json:"age"`
	} `json:"unsigned"`
}

type StateEventPowerLevelContent

type StateEventPowerLevelContent struct {
	Ban           int            `json:"ban"`
	Events        map[string]int `json:"events"`
	EventsDefault int            `json:"events_default"`
	Invite        int            `json:"invite"`
	Kick          int            `json:"kick"`
	Notifications map[string]int `json:"notifications"`
	Redact        int            `json:"redact"`
	StateDefault  int            `json:"state_default"`
	Users         map[string]int `json:"users"`
	UsersDefault  int            `json:"users_default"`
}

func GetRoomPowerLevelState

func GetRoomPowerLevelState(matrixClient *mautrix.Client, roomId id.RoomID) (*StateEventPowerLevelContent, error)

GetRoomPowerLevelState returns the rooms current power levels from the state

type StateEventRoomName

type StateEventRoomName struct {
	Type           string                    `json:"type"`
	Sender         string                    `json:"sender"`
	RoomID         string                    `json:"room_id"`
	EventID        string                    `json:"event_id"`
	OriginServerTS int64                     `json:"origin_server_ts"`
	Content        StateEventRoomNameContent `json:"content"`
	Unsigned       struct {
		Age int `json:"age"`
	} `json:"unsigned"`
}

type StateEventRoomNameContent

type StateEventRoomNameContent struct {
	Name string
}

func GetRoomNameState

func GetRoomNameState(matrixClient *mautrix.Client, roomId id.RoomID) (*StateEventRoomNameContent, error)

Jump to

Keyboard shortcuts

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