mirror of https://github.com/tucnak/telebot
middleware: implement auto callback respond
parent
d89e904397
commit
79ace6bc54
@ -0,0 +1,14 @@
|
||||
package middleware
|
||||
|
||||
import tele "gopkg.in/tucnak/telebot.v3"
|
||||
|
||||
func Respond() tele.MiddlewareFunc {
|
||||
return func(next tele.HandlerFunc) tele.HandlerFunc {
|
||||
return func(c tele.Context) error {
|
||||
if c.Callback() != nil {
|
||||
defer c.Respond()
|
||||
}
|
||||
return next(c)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue