Documentation
¶
Overview ¶
Package telegram is a generated GoMock package.
Index ¶
- type InlineOption
- type MissingCommandError
- type MockTelegoBotApi
- func (m *MockTelegoBotApi) EXPECT() *MockTelegoBotApiMockRecorder
- func (m *MockTelegoBotApi) SendMessage(params *telego.SendMessageParams) (*telego.Message, error)
- func (m *MockTelegoBotApi) StopLongPolling()
- func (m *MockTelegoBotApi) UpdatesViaLongPolling(params *telego.GetUpdatesParams, options ...telego.LongPollingOption) (<-chan telego.Update, error)
- type MockTelegoBotApiMockRecorder
- type TelegoBotApi
- type TgBotResponse
- type TgClient
- type TgInteraction
- type TgUpdateHandler
- type UnprocessableMessageError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InlineOption ¶
type MissingCommandError ¶
type MissingCommandError struct{ Command string }
func (MissingCommandError) Error ¶
func (e MissingCommandError) Error() string
type MockTelegoBotApi ¶
type MockTelegoBotApi struct {
// contains filtered or unexported fields
}
MockTelegoBotApi is a mock of TelegoBotApi interface.
func NewMockTelegoBotApi ¶
func NewMockTelegoBotApi(ctrl *gomock.Controller) *MockTelegoBotApi
NewMockTelegoBotApi creates a new mock instance.
func (*MockTelegoBotApi) EXPECT ¶
func (m *MockTelegoBotApi) EXPECT() *MockTelegoBotApiMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTelegoBotApi) SendMessage ¶
func (m *MockTelegoBotApi) SendMessage(params *telego.SendMessageParams) (*telego.Message, error)
SendMessage mocks base method.
func (*MockTelegoBotApi) StopLongPolling ¶
func (m *MockTelegoBotApi) StopLongPolling()
StopLongPolling mocks base method.
func (*MockTelegoBotApi) UpdatesViaLongPolling ¶
func (m *MockTelegoBotApi) UpdatesViaLongPolling(params *telego.GetUpdatesParams, options ...telego.LongPollingOption) (<-chan telego.Update, error)
UpdatesViaLongPolling mocks base method.
type MockTelegoBotApiMockRecorder ¶
type MockTelegoBotApiMockRecorder struct {
// contains filtered or unexported fields
}
MockTelegoBotApiMockRecorder is the mock recorder for MockTelegoBotApi.
func (*MockTelegoBotApiMockRecorder) SendMessage ¶
func (mr *MockTelegoBotApiMockRecorder) SendMessage(params any) *gomock.Call
SendMessage indicates an expected call of SendMessage.
func (*MockTelegoBotApiMockRecorder) StopLongPolling ¶
func (mr *MockTelegoBotApiMockRecorder) StopLongPolling() *gomock.Call
StopLongPolling indicates an expected call of StopLongPolling.
func (*MockTelegoBotApiMockRecorder) UpdatesViaLongPolling ¶
func (mr *MockTelegoBotApiMockRecorder) UpdatesViaLongPolling(params any, options ...any) *gomock.Call
UpdatesViaLongPolling indicates an expected call of UpdatesViaLongPolling.
type TelegoBotApi ¶
type TelegoBotApi interface {
UpdatesViaLongPolling(params *telego.GetUpdatesParams, options ...telego.LongPollingOption) (<-chan telego.Update, error)
StopLongPolling()
SendMessage(params *telego.SendMessageParams) (*telego.Message, error)
}
type TgBotResponse ¶
type TgBotResponse struct {
// bot text response, if any
ResponseText string
// inline response options, if any
InlineOptions []InlineOption
}
represents adapter for relevant data to create telego.SendMessageParams from bot
func (TgBotResponse) IsInline ¶
func (tgbr TgBotResponse) IsInline() bool
type TgClient ¶
type TgClient struct {
// contains filtered or unexported fields
}
func NewTgClient ¶
func NewTgClient(token string, cmdHandlers map[string]TgUpdateHandler) (*TgClient, error)
func (*TgClient) OpenUpdatesChannel ¶
func (*TgClient) ProcessUpdate ¶
func (*TgClient) StopUpdates ¶
func (tgClient *TgClient) StopUpdates()
type TgInteraction ¶
type TgInteraction struct {
// raw text of the received update
RawText string
// parsed command in the update (without leading /)
Cmd string
// args passed with command, if any
CmdArgs []string
// inline selection data
InlineSelectionData string
// message that triggered the inline selection prompt
InlineSelectionTrigger string
}
represents adapter for relevant data of telego.Update
func (TgInteraction) IsCommand ¶
func (tgi TgInteraction) IsCommand() bool
func (TgInteraction) IsInline ¶
func (tgi TgInteraction) IsInline() bool
type UnprocessableMessageError ¶
type UnprocessableMessageError struct{}
func (UnprocessableMessageError) Error ¶
func (e UnprocessableMessageError) Error() string