diff --git a/go.mod b/go.mod index b43b45f..a1346f0 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module ridi -go 1.17 +go 1.13 diff --git a/main.go b/main.go index d0a9251..402ef8e 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ import ( "fmt" "html" "io" + "io/ioutil" "mime/multipart" "net/http" "net/url" @@ -29,7 +30,7 @@ func handleMessage(client *http.Client, botToken string, message *Message) error if len(split) == 2 { command.Stdin = strings.NewReader(split[1]) } - stdout, err := os.CreateTemp("", "ridi*") + stdout, err := ioutil.TempFile("", "ridi*") if err != nil { return fmt.Errorf("failed to create temporary file: %s", err) } diff --git a/utils.go b/utils.go index 30230b8..d92a062 100644 --- a/utils.go +++ b/utils.go @@ -3,13 +3,13 @@ package main import ( "encoding/json" "fmt" - "io" + "io/ioutil" "net/http" ) func parseBody(resp *http.Response) (json.RawMessage, error) { defer resp.Body.Close() - bytes, err := io.ReadAll(resp.Body) + bytes, err := ioutil.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("failed to read response body: %s", err) }