tucnak/telebot

context: implement `ParseArgs`

demget opened this issue · 0 comments

b.Handle("/ban", func(c tele.Context) error {
  var (
    userID   int64
    interval string
  )
  if err := c.ParseArgs(&userID, &interval); err != nil {
    return err
  }
  if err := db.BanUser(userID, interval); err != nil {
    return err
  }
  return c.Send("Banned!")
})