diff --git a/botIO/getinfo.go b/botIO/getinfo.go new file mode 100644 index 0000000..a24c81a --- /dev/null +++ b/botIO/getinfo.go @@ -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 +}