From 69e93622b39c36852f19fb89a7e8147b075e67b6 Mon Sep 17 00:00:00 2001 From: Watn3y Date: Sat, 18 Mar 2023 23:48:45 +0100 Subject: [PATCH] add getinto function --- botIO/getinfo.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 botIO/getinfo.go 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 +}