all repos — telebonk @ f327676a42240686c81c8898e99f2bd2896a9207

reposter from honk to telegram

remove unnecessary struct and tweak logging
la-ninpre leobrekalini@gmail.com
Thu, 10 Nov 2022 23:59:42 +0300
commit

f327676a42240686c81c8898e99f2bd2896a9207

parent

20171eaba4cfc881ed259b753b8d3d07079bc687

1 files changed, 5 insertions(+), 5 deletions(-)

jump to
M main.gomain.go

@@ -186,11 +186,9 @@ // A TelegramResponse is a response from Telegram API.

type TelegramResponse struct { Ok bool Description string - Result telegramResponseResult -} - -type telegramResponseResult struct { - MessageID int `json:"message_id"` + Result struct { + MessageID int `json:"message_id"` + } } // NewMess creates and populates a new Mess with default values.

@@ -354,6 +352,7 @@ // honk outputs junk like `{ "honks": [ ... ] }`, need to get into the list

var honkJunk map[string][]*Honk err = json.NewDecoder(resp.Body).Decode(&honkJunk) if err != nil { + log.Print("gethonks: ", resp.Status) return nil, err }

@@ -445,6 +444,7 @@

func main() { var retry = 5 + log.Print("starting telebonk") // info for { honks, err := getHonks(0) if err != nil {