Documentation
¶
Index ¶
- func CreateBirthdayNotificationsTable(t *testing.T, db *sql.DB)
- func NotMentioned(username string, year int, message *telebot.Message) bool
- func SetupTestDB(t *testing.T) *sql.DB
- type MockBotWrapper
- func (m *MockBotWrapper) Notify(to telebot.Recipient, action telebot.ChatAction) error
- func (m *MockBotWrapper) Reply(message *telebot.Message, what interface{}, options ...interface{}) (*telebot.Message, error)
- func (m *MockBotWrapper) Send(to telebot.Recipient, what interface{}, options ...interface{}) (*telebot.Message, error)
- func (m *MockBotWrapper) SendPoll(to telebot.Recipient, question string, options []string, isAnonymous bool, ...) (*telebot.Message, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBirthdayNotificationsTable ¶
CreateBirthdayNotificationsTable creates the birthday_notifications table in the test database
func NotMentioned ¶
NotMentioned is a test-friendly version of the notMentioned function that handles the sql.ErrNoRows case correctly
Types ¶
type MockBotWrapper ¶
type MockBotWrapper struct {
SendCalled bool
SendTo telebot.Recipient
SendWhat interface{}
SendOpts []interface{}
ReplyFunc func(message *telebot.Message, what interface{}, options ...interface{}) (*telebot.Message, error)
SendFunc func(to telebot.Recipient, what interface{}, options ...interface{}) (*telebot.Message, error)
SendPollCalled bool
SendPollTo telebot.Recipient
SendPollQuestion string
SendPollOptions []string
SendPollAnonymous bool
SendPollMultiple bool
SendPollFunc func(to telebot.Recipient, question string, options []string, isAnonymous bool, allowsMultipleAnswers bool) (*telebot.Message, error)
// Track notification calls
NotifyCalled bool
NotifyTo telebot.Recipient
NotifyAction telebot.ChatAction
// Me represents the bot's own user information
Me *telebot.User
}
MockBotWrapper implements registry.BotInterface for testing
func (*MockBotWrapper) Notify ¶ added in v0.2.4
func (m *MockBotWrapper) Notify(to telebot.Recipient, action telebot.ChatAction) error
Notify implements the Notify method for the mock bot
func (*MockBotWrapper) Reply ¶ added in v0.2.3
func (m *MockBotWrapper) Reply(message *telebot.Message, what interface{}, options ...interface{}) (*telebot.Message, error)
Reply implements the Reply method for the mock bot
Click to show internal directories.
Click to hide internal directories.