bloaterbot/botIO/getinfo.go
2023-03-18 23:48:45 +01:00

16 lines
393 B
Go

package botIO
import tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
func GetUserByID(chatid int64, userid int64, bot *tgbotapi.BotAPI) (member tgbotapi.ChatMember) {
hi := tgbotapi.ChatConfigWithUser{
ChatID: chatid,
UserID: userid,
}
member, err := bot.GetChatMember(tgbotapi.GetChatMemberConfig{ChatConfigWithUser: hi})
if err != nil {
return
}
return member
}