test
This commit is contained in:
parent
097734886f
commit
88461c28c6
22
main.go
22
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{}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user