mirror of
https://github.com/tucnak/telebot
synced 2024-11-11 01:10:39 +00:00
19 lines
266 B
Go
19 lines
266 B
Go
package telebot
|
|
|
|
type testPoller struct {
|
|
updates chan Update
|
|
}
|
|
|
|
func (p *testPoller) Poll(b *Bot, updates chan Update, stop chan struct{}) {
|
|
for {
|
|
select {
|
|
case upd := <-p.updates:
|
|
updates <- upd
|
|
case <-stop:
|
|
close(stop)
|
|
return
|
|
default:
|
|
}
|
|
}
|
|
}
|