add getinto function
This commit is contained in:
parent
0d246cebbc
commit
69e93622b3
1 changed files with 16 additions and 0 deletions
16
botIO/getinfo.go
Normal file
16
botIO/getinfo.go
Normal 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
|
||||
}
|
Loading…
Reference in a new issue