Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
totanvix committed Nov 28, 2023
1 parent 5a03144 commit 5a6f0f2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 48 deletions.
9 changes: 8 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,12 @@

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "root",
"initializeCommand": "git config --global alias.co checkout && git config --global alias.br branch && git config --global alias.ci commit && git config --global alias.st status"
"initializeCommand": "git config --global alias.co checkout && git config --global alias.br branch && git config --global alias.ci commit && git config --global alias.st status",
"customizations": {
"vscode": {
"extensions": [
"rangav.vscode-thunder-client"
]
}
}
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[Zeril Bot](https://t.me/zerill_bot) is my practice using Go

## Development

## Lesson Learned
* Go and things in Go
* Vercel Serverless Function
Expand Down
3 changes: 3 additions & 0 deletions api/hook/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package hook

import (
"encoding/json"
"fmt"
"net/http"
"zeril-bot/utils/bot"
"zeril-bot/utils/structs"
Expand All @@ -15,6 +16,8 @@ func Handler(w http.ResponseWriter, r *http.Request) {
panic(err)
}

fmt.Println("Handler")
fmt.Println(data)
telegram := telegram.New(&http.Client{}, telegram.BASE_URL)

bot := bot.NewBot(telegram, data)
Expand Down
3 changes: 0 additions & 3 deletions api/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package api
import (
"net/http"
"zeril-bot/api/hook"
"zeril-bot/api/trip"
"zeril-bot/api/url"
"zeril-bot/utils/middleware"

Expand All @@ -24,8 +23,6 @@ func Handler(wri http.ResponseWriter, req *http.Request) {
})
r.Post("/api/hook", hook.Handler)
r.Get("/url", url.Handler)
r.Get("/trip", trip.Handler)
r.Post("/trip", trip.Handler)

r.ServeHTTP(wri, req)
}
44 changes: 0 additions & 44 deletions api/trip/index.go

This file was deleted.

4 changes: 4 additions & 0 deletions utils/bot/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package bot

import (
"errors"
"fmt"
"log"
"strings"
"time"
Expand Down Expand Up @@ -88,6 +89,9 @@ func (b Bot) resolveCommand() error {

data := b.getTelegramData()

fmt.Println("resolveCommand")
fmt.Println(data)

switch data.Command {
case "/start", "/start@zerill_bot":
err = b.sendStartMessage(data)
Expand Down

0 comments on commit 5a6f0f2

Please sign in to comment.