добавил отображение логинов, сборка в докере

This commit is contained in:
taz
2025-08-13 18:36:56 +02:00
parent d80277c4f1
commit c4962a32fd
7 changed files with 90 additions and 43 deletions
+10
View File
@@ -1,11 +1,21 @@
package main
import (
"strconv"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
"github.com/bwmarrin/discordgo"
"github.com/SevereCloud/vksdk/v2/api"
)
// Получить имя пользователя VK по id
func (b *Bridge) GetVKUserName(userID int) (string, error) {
resp, err := b.VK.UsersGet(api.Params{"user_ids": userID})
if err != nil || len(resp) == 0 {
return strconv.Itoa(userID), err
}
return resp[0].FirstName + " " + resp[0].LastName, nil
}
// Структура для хранения клиентов
type Bridge struct {
Telegram *tgbotapi.BotAPI