matrixbot

package module
v0.0.0-...-a9b4b13 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

README

Quality Gate Status Build Status Go Report Card

matrixbot

matrixbot is a golang library for matrix bots

Status

In development

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInitialEvent

func GetInitialEvent(c Config, token string, txtmsg string) int

GetInitialEvent gets the first event id

func JoinRoom

func JoinRoom(server string, roomID string, token string)

JoinRoom lets your bot join a room

func ListenAndAct

func ListenAndAct(actionFunc actFunc)

ListenAndAct listens for incoming text messages and reacts with a function

func SendTXTToRoom

func SendTXTToRoom()

SendTXTToRoom sends a text message

Types

type AuthResponse

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

AuthResponse is a struct that holds authentication information

func GetTokenJSON

func GetTokenJSON(server string, username string, passwd string) AuthResponse

GetTokenJSON gets a session json object

type Config

type Config struct {
	Server   string
	User     string
	Password string
	RoomID   string
}

func ReadConfig

func ReadConfig(confFile string) Config

ReadConfig reads the configuration of a toml file into a Config struct

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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