-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
53 lines (44 loc) · 986 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package main
import (
"fmt"
_ "net/http"
_ "net/http/pprof"
)
func main() {
// tr := &http.Transport{
// MaxIdleConns: 10,
// IdleConnTimeout: 30 * time.Second,
// DisableCompression: true,
// }
// client := &http.Client{
// Transport: tr,
// }
// token := flag.String("token", "", "Telegram Bot Token")
// flag.Parse()
// if *token == "" {
// log.Fatal("Token must be provided!\n")
// }
// bot, err := NewBotApi(*token, client)
// if err != nil {
// fmt.Printf("%v\n", err)
// }
// fmt.Printf("Token: %v\nUser: %v\n", bot.Token, bot.self)
// config := UpdateConfig{
// limit: 5,
// }
// bot.gettingUpdates(config)
testTrReq()
}
func testTrReq() {
tr := NewTrClient()
TransmissionRPCServerName = "127.0.0.1"
params := TrRequest{
Method: "session-stats",
}
res, err := tr.makeRequest(params)
if err != nil {
fmt.Printf("Err -> %s\n", err)
}
fmt.Printf("Res -> %s\n", res.Result)
fmt.Printf("ARGS -> %s\n", res.Arguments)
}