botTest

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleErr

func HandleErr(t *testing.T, err error)

Types

type MockBot

type MockBot struct {
	LastSentWhat    interface{}
	AllLastSentWhat []interface{}
}

func (*MockBot) Handle

func (b *MockBot) Handle(endpoint interface{}, handler tb.HandlerFunc, mw ...tb.MiddlewareFunc)

func (*MockBot) Me

func (b *MockBot) Me() *tb.User

func (*MockBot) Reset

func (b *MockBot) Reset()

func (*MockBot) Respond

func (b *MockBot) Respond(c *tb.Callback, resp ...*tb.CallbackResponse) error

func (*MockBot) Send

func (b *MockBot) Send(to tb.Recipient, what interface{}, options ...interface{}) (*tb.Message, error)

func (*MockBot) SendSilent

func (b *MockBot) SendSilent(logFn func(level helpers.Level, m *tb.Message, format string, v ...interface{}), to tb.Recipient, what interface{}, options ...interface{}) (*tb.Message, error)

func (*MockBot) Start

func (b *MockBot) Start()

type MockContext

type MockContext struct {
	M *tb.Message
}

func (*MockContext) Accept

func (c *MockContext) Accept(errorMessage ...string) error

func (*MockContext) Answer

func (c *MockContext) Answer(resp *tb.QueryResponse) error

func (*MockContext) Args

func (c *MockContext) Args() []string

func (*MockContext) Bot

func (c *MockContext) Bot() *tb.Bot

func (*MockContext) Callback

func (c *MockContext) Callback() *tb.Callback

func (*MockContext) Chat

func (c *MockContext) Chat() *tb.Chat

func (*MockContext) ChatJoinRequest

func (c *MockContext) ChatJoinRequest() *tb.ChatJoinRequest

func (*MockContext) ChatMember

func (c *MockContext) ChatMember() *tb.ChatMemberUpdate

func (*MockContext) Data

func (c *MockContext) Data() string

func (*MockContext) Delete

func (c *MockContext) Delete() error

func (*MockContext) DeleteAfter

func (c *MockContext) DeleteAfter(d time.Duration) *time.Timer

func (*MockContext) Edit

func (c *MockContext) Edit(what interface{}, opts ...interface{}) error

func (*MockContext) EditCaption

func (c *MockContext) EditCaption(caption string, opts ...interface{}) error

func (*MockContext) EditOrReply

func (c *MockContext) EditOrReply(what interface{}, opts ...interface{}) error

func (*MockContext) EditOrSend

func (c *MockContext) EditOrSend(what interface{}, opts ...interface{}) error

func (*MockContext) Entities

func (c *MockContext) Entities() tb.Entities

func (*MockContext) Forward

func (c *MockContext) Forward(msg tb.Editable, opts ...interface{}) error

func (*MockContext) ForwardTo

func (c *MockContext) ForwardTo(to tb.Recipient, opts ...interface{}) error

func (*MockContext) Get

func (c *MockContext) Get(key string) interface{}

func (*MockContext) InlineResult

func (c *MockContext) InlineResult() *tb.InlineResult

func (*MockContext) Message

func (c *MockContext) Message() *tb.Message

func (*MockContext) Migration

func (c *MockContext) Migration() (int64, int64)

func (*MockContext) Notify

func (c *MockContext) Notify(action tb.ChatAction) error

func (*MockContext) Poll

func (c *MockContext) Poll() *tb.Poll

func (*MockContext) PollAnswer

func (c *MockContext) PollAnswer() *tb.PollAnswer

func (*MockContext) PreCheckoutQuery

func (c *MockContext) PreCheckoutQuery() *tb.PreCheckoutQuery

func (*MockContext) Query

func (c *MockContext) Query() *tb.Query

func (*MockContext) Recipient

func (c *MockContext) Recipient() tb.Recipient

func (*MockContext) Reply

func (c *MockContext) Reply(what interface{}, opts ...interface{}) error

func (*MockContext) Respond

func (c *MockContext) Respond(resp ...*tb.CallbackResponse) error

func (*MockContext) Send

func (c *MockContext) Send(what interface{}, opts ...interface{}) error

func (*MockContext) SendAlbum

func (c *MockContext) SendAlbum(a tb.Album, opts ...interface{}) error

func (*MockContext) Sender

func (c *MockContext) Sender() *tb.User

func (*MockContext) Set

func (c *MockContext) Set(key string, val interface{})

func (*MockContext) Ship

func (c *MockContext) Ship(what ...interface{}) error

func (*MockContext) ShippingQuery

func (c *MockContext) ShippingQuery() *tb.ShippingQuery

func (*MockContext) Text

func (c *MockContext) Text() string

func (*MockContext) Update

func (c *MockContext) Update() tb.Update

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL