From 88461c28c605bdd66e539d30ebc3138c40558d72 Mon Sep 17 00:00:00 2001 From: shoopea Date: Sun, 21 Jun 2020 19:42:41 +0200 Subject: [PATCH] test --- main.go | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 028eee1..4185319 100644 --- a/main.go +++ b/main.go @@ -16,12 +16,14 @@ type Client struct { CompanyID uint8 } +var ( + bot *tb.Bot + clients map[uint32]*Client + paused bool = true + forcePaused bool = true +) + func main() { - var ( - clients map[uint32]*Client - paused bool = true - forcePaused bool = true - ) clients = make(map[uint32]*Client) @@ -38,12 +40,20 @@ func main() { } _, err = conn.Write(p.Bytes()) failError(err, "conn.Write") - logInfoDebug("Authentication sent (%v)", p.Bytes()) r := bufio.NewReader(conn) b := make([]byte, 0xFFFF) read := 0 n := 0 + // Registering bot + bot, err = tb.NewBot(tb.Settings{ + Token: "954090437:AAEMYeUWGluKZRwXi_K3-T23ZVpFoqQAmu0", + URL: "https://api.telegram.org", + Poller: &tb.LongPoller{Timeout: 10 * time.Second}, + }) + failError(err, "Registering bot") + logInfoDebug("Connected to Telegram") + for { p := Packet{}