refactor: cleanup redundant code

This commit is contained in:
Yiyang Kang 2023-03-20 21:45:59 +08:00
parent 9e7432a1a1
commit 89286b7e73
Signed by: kkyy
GPG key ID: 80FD317ECAF06CC3
3 changed files with 28 additions and 71 deletions

9
bot.go
View file

@ -117,3 +117,12 @@ func stickerFromID(id string) *tele.Sticker {
},
}
}
func setTyping(c tele.Context) chan error {
resultCh := make(chan error, 1)
go func() {
defer close(resultCh)
resultCh <- c.Bot().Notify(c.Chat(), tele.Typing)
}()
return resultCh
}