Documentation ¶
Index ¶
- func NewMessagef(chatID int64, format string, a ...any) tgbotapi.MessageConfig
- func NewMockBot() (MockBot, MockBotClient)
- func NewReplyf(to tgbotapi.Message, format string, a ...any) tgbotapi.MessageConfig
- type Bot
- type Config
- type MockBot
- type MockBotClient
- func (c MockBotClient) Recv(ctx context.Context, t *testing.T) tgbotapi.Chattable
- func (c MockBotClient) RecvMessage(ctx context.Context, t *testing.T) tgbotapi.MessageConfig
- func (c MockBotClient) RequireEmpty(t *testing.T)
- func (c MockBotClient) SendMessage(ctx context.Context, t *testing.T, msg tgbotapi.Message)
- func (c MockBotClient) SendUpdate(ctx context.Context, t *testing.T, u tgbotapi.Update)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMessagef ¶ added in v0.0.2
func NewMessagef(chatID int64, format string, a ...any) tgbotapi.MessageConfig
func NewMockBot ¶
func NewMockBot() (MockBot, MockBotClient)
Types ¶
type Bot ¶
type Config ¶
type Config struct { TokenFile string `yaml:"token_file" validate:"required,file"` // TODO: add webhook option Poll *struct { Timeout time.Duration `yaml:"timeout"` } `yaml:"poll" validate:"required"` }
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
type MockBot ¶
type MockBot struct {
// contains filtered or unexported fields
}
func (MockBot) Updates ¶
func (b MockBot) Updates() tgbotapi.UpdatesChannel
type MockBotClient ¶
type MockBotClient struct {
// contains filtered or unexported fields
}
func (MockBotClient) RecvMessage ¶
func (c MockBotClient) RecvMessage(ctx context.Context, t *testing.T) tgbotapi.MessageConfig
func (MockBotClient) RequireEmpty ¶
func (c MockBotClient) RequireEmpty(t *testing.T)
func (MockBotClient) SendMessage ¶
func (MockBotClient) SendUpdate ¶
Click to show internal directories.
Click to hide internal directories.