Documentation ¶
Overview ¶
Package telegram provides a maubot implementation for Telegram.
Package telegram provides a maubot implementation for Telegram.
Index ¶
- func FormatMessage(message string) string
- func New(token 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{}
- type SimpleRecipient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatMessage ¶
FormatMessage formats a Markdown message into Telegram format
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 Telebot 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 TGBot parent of this message.
func (*Message) Underlying ¶
func (msg *Message) Underlying() interface{}
Underlying returns the underlying Telebot message object
type SimpleRecipient ¶
type SimpleRecipient struct {
Recipient string
}
SimpleRecipient is an implementation of the telebot Recipient interface.
func (SimpleRecipient) Destination ¶
func (sr SimpleRecipient) Destination() string
Destination returns the Recipient field.