matrix

package
v0.0.0-...-622823b Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package matrix provides a maubot implementation for Matrix.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(homeserver, user, password string) (maubot.Bot, error)

New creates an instance of the maubot.Bot implementation for Matrix.

Types

type Bot

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

Bot is an implementation of maubot.Bot for Telegram.

func (*Bot) AddListener

func (bot *Bot) AddListener(listener chan maubot.Message)

AddListener adds a message listener

func (*Bot) Connect

func (bot *Bot) Connect() error

Connect connects to the Matrix homeserver.

func (*Bot) Connected

func (bot *Bot) Connected() bool

Connected returns whether or not the message listener is active.

func (*Bot) Disconnect

func (bot *Bot) Disconnect() error

Disconnect stops listening for messages. It may or may not actually disconnect.

func (*Bot) SendMessage

func (bot *Bot) SendMessage(msg maubot.OutgoingMessage)

SendMessage sends a message to the given channel or user.

func (*Bot) SendToListeners

func (bot *Bot) SendToListeners(message maubot.Message)

SendToListeners sends the given message to all listener channels.

func (*Bot) UID

func (bot *Bot) UID() string

UID returns the unique ID for this instance.

func (*Bot) Underlying

func (bot *Bot) Underlying() interface{}

Underlying returns the telebot bot object.

type Message

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

Message is an implementation of maubot.Message for Matrix messages.

func (*Message) Reply

func (msg *Message) Reply(message string)

Reply sends a message to the room the message came from.

func (*Message) ReplyWithRef

func (msg *Message) ReplyWithRef(message string)

ReplyWithRef sends a message to the room the message came from with a reference to the original message or the sender.

func (*Message) Room

func (msg *Message) Room() string

Room returns the display name of the current channel or user.

func (*Message) RoomID

func (msg *Message) RoomID() string

RoomID returns the ID of the current channel or user.

func (*Message) Sender

func (msg *Message) Sender() string

Sender returns the preferred displayname of the sender

func (*Message) SenderID

func (msg *Message) SenderID() string

SenderID returns the ID of the sender.

func (*Message) Source

func (msg *Message) Source() maubot.Bot

Source returns the Matrix Bot parent of this message.

func (*Message) Text

func (msg *Message) Text() string

Text returns the text in the message

func (*Message) Underlying

func (msg *Message) Underlying() interface{}

Underlying returns the underlying mautrix event object

Jump to

Keyboard shortcuts

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