mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
fix me being dumb
This commit is contained in:
parent
69ac5c52ed
commit
719213b25e
1 changed files with 8 additions and 15 deletions
|
@ -4,7 +4,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
@ -22,11 +21,7 @@ func RandomNumber() string {
|
||||||
return string(responseData)
|
return string(responseData)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Number(num string) string {
|
func Number(number string) string {
|
||||||
number, err := strconv.Atoi(num)
|
|
||||||
if err != nil {
|
|
||||||
return "Given value is not a number."
|
|
||||||
} else {
|
|
||||||
response, err := http.Get(fmt.Sprint("http://numbersapi.com/" + string(number)))
|
response, err := http.Get(fmt.Sprint("http://numbersapi.com/" + string(number)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
|
@ -36,6 +31,4 @@ func Number(num string) string {
|
||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
}
|
}
|
||||||
return string(responseData)
|
return string(responseData)
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue