mirror of https://github.com/tucnak/telebot
Implement bot Handle and Start functions tests
parent
32de86819c
commit
fcff7569ac
@ -0,0 +1,18 @@
|
||||
package telebot
|
||||
|
||||
type testPoller struct {
|
||||
Message string
|
||||
}
|
||||
|
||||
func (p *testPoller) Poll(b *Bot, updates chan Update, stop chan struct{}) {
|
||||
updates <- Update{Message: &Message{Text: p.Message}}
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-stop:
|
||||
close(stop)
|
||||
return
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue