add server and update /help
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"student_bot/commands"
|
||||
@@ -101,6 +102,18 @@ func run() {
|
||||
log.Panicln(err)
|
||||
}
|
||||
|
||||
go func() {
|
||||
http.HandleFunc("/send_today_lessons_to_chat", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Add("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
_, _ = fmt.Fprintf(w, `{"result":"ok"}`)
|
||||
})
|
||||
|
||||
port := ":10001"
|
||||
log.Println("Server is start up! port", port)
|
||||
log.Fatal(http.ListenAndServe(port, nil))
|
||||
}()
|
||||
|
||||
log.Println("Bot is start up!")
|
||||
|
||||
for update := range updates {
|
||||
@@ -129,7 +142,7 @@ func run() {
|
||||
send(bot, tgbot.NewMessage(chatId, messages.StartMessage()))
|
||||
|
||||
case commands.Help:
|
||||
send(bot, tgbot.NewMessage(chatId, messages.HelpMessage()))
|
||||
send(bot, tgbot.NewMessage(chatId, messages.HelpMessage(chatId)))
|
||||
|
||||
case commands.Ping:
|
||||
send(bot, tgbot.NewMessage(chatId, messages.PongMessage()))
|
||||
|
||||
Reference in New Issue
Block a user