Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
id committed Nov 16, 2018
1 parent 24b52f4 commit adfbcfc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions telegram/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,16 @@ func (c *client) Send() error {
}

u := fmt.Sprintf("https://api.telegram.org/bot%s/sendMessage", c.opt.Token)

fmt.Println("telegram url:", u)

for _, channel := range c.opt.Channel {
data := url.Values{}
data.Set("chat_id", channel)
data.Set("text", c.body)

fmt.Printf("payload: %+v\n", data)

resp, err := http.PostForm(u, data)
if err != nil {
return err
Expand Down

0 comments on commit adfbcfc

Please sign in to comment.