Skip to content

Commit

Permalink
Make SendMessage send messages correctly
Browse files Browse the repository at this point in the history
telegram.SendMessages was improperly converting an int to a string,
which was resulting in an invalid Unicode character rather than a string
containing a decimal number as intended.
  • Loading branch information
xordspar0 committed Feb 8, 2018
1 parent 8032a54 commit f58a478
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions telegram/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ func SetWebhook(address, token string) error {

func SendMessage(recipient int, messageBody, token string) error {
// Form request JSON.
reqMap := make(map[string]string)
reqMap["chat_id"] = string(recipient)
reqMap := make(map[string]interface{})
reqMap["chat_id"] = recipient
reqMap["text"] = messageBody
reqJson, err := json.Marshal(reqMap)
if err != nil {
Expand Down

0 comments on commit f58a478

Please sign in to comment.