Files
Hubert Chen a09d6e40df separate user and channel saved message
edit sticker download callback data prefix
2025-09-01 09:01:24 +08:00

33 lines
778 B
Go

package common
import (
"strings"
"trbot/utils/type/message_utils"
)
var ResultCategorys = InlineCategorys{
"gif": message_utils.Animation,
"text": message_utils.Text,
"audio": message_utils.Audio,
"document": message_utils.Document,
"photo": message_utils.Photo,
"sticker": message_utils.Sticker,
"video": message_utils.Video,
"videonote": message_utils.VideoNote,
"voice": message_utils.Voice,
}
type InlineCategorys map[string]message_utils.Type
func (ic InlineCategorys) StrList() (list []string) {
for key := range ic {
list = append(list, key)
}
return list
}
func (ic InlineCategorys) GetCategory(str string) (result message_utils.Type, isExist bool) {
result, isExist = ResultCategorys[strings.ToLower(str)]
return
}