various improvements
This commit is contained in:
parent
d5272262da
commit
1a6953900c
14 changed files with 71 additions and 49 deletions
|
@ -1,12 +1,18 @@
|
|||
package botIO
|
||||
|
||||
import tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
||||
import (
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
|
||||
)
|
||||
|
||||
func GetUserByID(userToGet tgbotapi.ChatConfigWithUser, bot *tgbotapi.BotAPI) (error bool, member tgbotapi.ChatMember) {
|
||||
|
||||
member, err := bot.GetChatMember(tgbotapi.GetChatMemberConfig{ChatConfigWithUser: userToGet})
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Unable to get info for user")
|
||||
return true, member
|
||||
}
|
||||
log.Debug().Interface("member",member).Msg("Got Info for user")
|
||||
return false, member
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue