Documentation ¶
Overview ¶
Package matrix provides a maubot implementation for Matrix.
Index ¶
- func New(homeserver, user, password string) (maubot.Bot, error)
- type Bot
- func (bot *Bot) AddListener(listener chan maubot.Message)
- func (bot *Bot) Connect() error
- func (bot *Bot) Connected() bool
- func (bot *Bot) Disconnect() error
- func (bot *Bot) SendMessage(msg maubot.OutgoingMessage)
- func (bot *Bot) SendToListeners(message maubot.Message)
- func (bot *Bot) UID() string
- func (bot *Bot) Underlying() interface{}
- type Message
- func (msg *Message) Reply(message string)
- func (msg *Message) ReplyWithRef(message string)
- func (msg *Message) Room() string
- func (msg *Message) RoomID() string
- func (msg *Message) Sender() string
- func (msg *Message) SenderID() string
- func (msg *Message) Source() maubot.Bot
- func (msg *Message) Text() string
- func (msg *Message) Underlying() interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) Disconnect ¶
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) 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) ReplyWithRef ¶
ReplyWithRef sends a message to the room the message came from with a reference to the original message or the sender.
func (*Message) Source ¶
func (msg *Message) Source() maubot.Bot
Source returns the Matrix Bot parent of this message.
func (*Message) Underlying ¶
func (msg *Message) Underlying() interface{}
Underlying returns the underlying mautrix event object