Add readme and fix imports
This commit is contained in:
parent
cc45fb5209
commit
9804f85677
6 changed files with 14 additions and 5 deletions
|
@ -1,3 +1,5 @@
|
||||||
# Bot API for Telegram bots
|
# Bot API for Telegram bots
|
||||||
|
|
||||||
Should work if you can put the time to figure out how it works (check client_test.go or better yet, [clessy](https://github.com/hamcha/clessy))
|
Should work if you can put the time to figure out how it works (check client_test.go or better yet, [clessy](https://github.com/hamcha/clessy))
|
||||||
|
|
||||||
|
(Yes this needs proper docs and everything but I'm kinda busy doing other stuff)
|
7
broker-data/config.json.sample
Normal file
7
broker-data/config.json.sample
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"BindServer" : ":7313",
|
||||||
|
"BindClients": "127.0.0.1:7314",
|
||||||
|
"Token" : "Bot token here",
|
||||||
|
"BaseURL" : "https://my.bot.host",
|
||||||
|
"WebhookURL" : "/secret_url_here"
|
||||||
|
}
|
|
@ -3,7 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/hamcha/clessy/tg"
|
"github.com/hamcha/tg"
|
||||||
)
|
)
|
||||||
|
|
||||||
func executeClientCommand(action tg.ClientCommand, client net.Conn) {
|
func executeClientCommand(action tg.ClientCommand, client net.Conn) {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/hamcha/clessy/tg"
|
"github.com/hamcha/tg"
|
||||||
)
|
)
|
||||||
|
|
||||||
var clients []net.Conn
|
var clients []net.Conn
|
||||||
|
|
|
@ -14,7 +14,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/hamcha/clessy/tg"
|
"github.com/hamcha/tg"
|
||||||
)
|
)
|
||||||
|
|
||||||
// APIEndpoint is Telegram's current Bot API base url endpoint
|
// APIEndpoint is Telegram's current Bot API base url endpoint
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/hamcha/clessy/tg"
|
"github.com/hamcha/tg"
|
||||||
)
|
)
|
||||||
|
|
||||||
func webhook(rw http.ResponseWriter, req *http.Request) {
|
func webhook(rw http.ResponseWriter, req *http.Request) {
|
||||||
|
|
Loading…
Reference in a new issue