mirror of
https://github.com/iyear/tdl
synced 2025-01-08 11:57:55 +08:00
18 lines
310 B
Go
18 lines
310 B
Go
package dcpool
|
|
|
|
import (
|
|
"github.com/gotd/td/telegram"
|
|
"github.com/gotd/td/tg"
|
|
)
|
|
|
|
func chainMiddlewares(invoker tg.Invoker, chain ...telegram.Middleware) tg.Invoker {
|
|
if len(chain) == 0 {
|
|
return invoker
|
|
}
|
|
for i := len(chain) - 1; i >= 0; i-- {
|
|
invoker = chain[i].Handle(invoker)
|
|
}
|
|
|
|
return invoker
|
|
}
|