Documentation
¶
Overview ¶
Package telegramtest is a stand-in for the Telegram Bot API, for tests and preview stands: nothing in the suite ever talks to api.telegram.org.
Index ¶
- type Bot
- func (b *Bot) Answers() []string
- func (b *Bot) Calls() []string
- func (b *Bot) Close()
- func (b *Bot) Messages() []Sent
- func (b *Bot) Pending() int
- func (b *Bot) Press(chatID, msgID int64, data string)
- func (b *Bot) RateLimit(n, retryAfter int)
- func (b *Bot) RefuseURLButtons()
- func (b *Bot) Reply(chatID int64, replyTo int64, text string)
- func (b *Bot) Say(chatID int64, firstName, text string)
- func (b *Bot) SayIn(chatID int64, chatType, firstName, text string, replyTo int64)
- func (b *Bot) SayOld(chatID int64, text string, age time.Duration)
- func (b *Bot) Sent() []Sent
- func (b *Bot) URL() string
- type Sent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
Bot is a fake Bot API serving one bot.
func (*Bot) RefuseURLButtons ¶
func (b *Bot) RefuseURLButtons()
RefuseURLButtons makes a message with a URL button fail as Telegram fails one whose address it will not open.
type Sent ¶
type Sent struct {
Method string
ChatID string
Text string
ParseMode string
MessageID int64
// ReplyTo is the message a sent one is threaded under; for an edit or a
// reaction, the message it changes.
ReplyTo int64
// Buttons are the inline buttons' callback data (or "url:" + the URL),
// row by row flattened.
Buttons []string
// ForceReply says the message asked for a reply.
ForceReply bool
Emoji string
// Photo is a sendPhoto's file; Text is then its caption.
Photo []byte
At time.Time
}
Sent is one call the fake received that changes the chat: a message, an edit of its buttons, or a reaction.