mirror of
https://github.com/Xevion/banner.git
synced 2025-12-08 16:06:31 -06:00
Fix global var redeclaration
This commit is contained in:
5
main.go
5
main.go
@@ -58,13 +58,14 @@ func main() {
|
|||||||
}
|
}
|
||||||
baseURL = os.Getenv("BANNER_BASE_URL")
|
baseURL = os.Getenv("BANNER_BASE_URL")
|
||||||
|
|
||||||
cookies, err := cookiejar.New(nil)
|
var err error
|
||||||
|
cookies, err = cookiejar.New(nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Err(err).Msg("Cannot create cookie jar")
|
log.Err(err).Msg("Cannot create cookie jar")
|
||||||
}
|
}
|
||||||
|
|
||||||
client = http.Client{Jar: cookies}
|
client = http.Client{Jar: cookies}
|
||||||
setup(cookies)
|
setup(&cookies)
|
||||||
|
|
||||||
session, err = discordgo.New("Bot " + os.Getenv("BOT_TOKEN"))
|
session, err = discordgo.New("Bot " + os.Getenv("BOT_TOKEN"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http/cookiejar"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
log "github.com/rs/zerolog/log"
|
log "github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func setup(cookies *cookiejar.Jar) {
|
func setup(cookies *http.CookieJar) {
|
||||||
// Makes the initial requests that sets up the session cookies for the rest of the application
|
// Makes the initial requests that sets up the session cookies for the rest of the application
|
||||||
log.Info().Msg("Setting up session...")
|
log.Info().Msg("Setting up session...")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user