Open Lifelong-Study opened 4 years ago
share how to get supergroup_id
import "github.com/fatih/structs"
// Code
chat, err := client.GetChat(chatID)
if err != nil {
panic(err)
}
if chat.Type.GetChatTypeEnum() == tdlib.ChatTypeSupergroupType {
Map := structs.Map(chat)
Type := Map["Type"].(map[string]interface {})
SupergroupID := Type["SupergroupID"].(int32)
IsChannel := Type["IsChannel"].(bool)
log.Printf("%s: %v, %d", chat.Title, IsChannel, SupergroupID)
group, err := client.GetSupergroup(SupergroupID)
if err != nil {
panic(err)
}
log.Print(group.Username)
}
Hello guys, I want get supergroup info, but I don't know how to get the supergroup_id form *tdlib.Chat
My develop language is: Golang