This commit is contained in:
Watn3y 2023-03-31 17:39:57 +02:00
parent f00e8e1509
commit d52bd7d692
2 changed files with 37 additions and 21 deletions

View file

@ -2,15 +2,11 @@ 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) {
func GetUserByID(userToGet tgbotapi.ChatConfigWithUser, bot *tgbotapi.BotAPI) (error bool, member tgbotapi.ChatMember) {
hi := tgbotapi.ChatConfigWithUser{
ChatID: chatid,
UserID: userid,
}
member, err := bot.GetChatMember(tgbotapi.GetChatMemberConfig{ChatConfigWithUser: hi})
member, err := bot.GetChatMember(tgbotapi.GetChatMemberConfig{ChatConfigWithUser: userToGet})
if err != nil {
return
return true, member
}
return member
return false, member
}