This commit is contained in:
shoopea 2020-06-21 19:42:41 +02:00
parent 097734886f
commit 88461c28c6

14
main.go
View File

@ -16,13 +16,15 @@ type Client struct {
CompanyID uint8 CompanyID uint8
} }
func main() {
var ( var (
bot *tb.Bot
clients map[uint32]*Client clients map[uint32]*Client
paused bool = true paused bool = true
forcePaused bool = true forcePaused bool = true
) )
func main() {
clients = make(map[uint32]*Client) clients = make(map[uint32]*Client)
conn, err := net.Dial("tcp", "poop.siteop.biz:3977") conn, err := net.Dial("tcp", "poop.siteop.biz:3977")
@ -38,12 +40,20 @@ func main() {
} }
_, err = conn.Write(p.Bytes()) _, err = conn.Write(p.Bytes())
failError(err, "conn.Write") failError(err, "conn.Write")
logInfoDebug("Authentication sent (%v)", p.Bytes())
r := bufio.NewReader(conn) r := bufio.NewReader(conn)
b := make([]byte, 0xFFFF) b := make([]byte, 0xFFFF)
read := 0 read := 0
n := 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 { for {
p := Packet{} p := Packet{}