add getinto function

This commit is contained in:
Watn3y 2023-03-18 23:48:45 +01:00
parent 0d246cebbc
commit 69e93622b3

16
botIO/getinfo.go Normal file
View file

@ -0,0 +1,16 @@
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
}