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"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
@ -22,11 +21,7 @@ func RandomNumber() string {
|
|||
return string(responseData)
|
||||
}
|
||||
|
||||
func Number(num string) string {
|
||||
number, err := strconv.Atoi(num)
|
||||
if err != nil {
|
||||
return "Given value is not a number."
|
||||
} else {
|
||||
func Number(number string) string {
|
||||
response, err := http.Get(fmt.Sprint("http://numbersapi.com/" + string(number)))
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
|
@ -37,5 +32,3 @@ func Number(num string) string {
|
|||
}
|
||||
return string(responseData)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue