mirror of
https://github.com/mgerb/go-discord-bot
synced 2026-01-11 01:22:48 +00:00
client: updated everything, deprecated pubg stuff
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package bothandlers
|
||||
|
||||
/***** DEPRECATED *****/
|
||||
/**
|
||||
* DEPRECATED
|
||||
* this was used to fetch a giphy image
|
||||
* no longer used
|
||||
*/
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
|
||||
@@ -31,11 +31,7 @@ type configFile struct {
|
||||
ServerAddr string `json:"server_addr"`
|
||||
JWTKey string `json:"jwt_key"`
|
||||
|
||||
Pubg struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
APIKey string `json:"api_key"`
|
||||
Players []string `json:"players"`
|
||||
} `json:"pubg"`
|
||||
Logging bool `json:"logging"`
|
||||
}
|
||||
|
||||
type configFlags struct {
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package pubg
|
||||
|
||||
/**
|
||||
* DEPRECATED
|
||||
* I no longer have a use for this so I'm ripping it out
|
||||
*/
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"github.com/mgerb/go-discord-bot/server/config"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/handlers"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/middleware"
|
||||
"github.com/mgerb/go-discord-bot/server/webserver/pubg"
|
||||
)
|
||||
|
||||
func getRouter() *gin.Engine {
|
||||
@@ -17,11 +16,10 @@ func getRouter() *gin.Engine {
|
||||
router.Static("/public/clips", config.Config.ClipsPath)
|
||||
|
||||
router.NoRoute(func(c *gin.Context) {
|
||||
c.File("./dist/index.html")
|
||||
c.File("./dist/static/index.html")
|
||||
})
|
||||
|
||||
api := router.Group("/api")
|
||||
api.GET("/stats/pubg", pubg.Handler)
|
||||
api.GET("/ytdownloader", handlers.Downloader)
|
||||
api.GET("/soundlist", handlers.SoundList)
|
||||
api.GET("/cliplist", handlers.ClipList)
|
||||
@@ -37,11 +35,6 @@ func getRouter() *gin.Engine {
|
||||
// Start -
|
||||
func Start() {
|
||||
|
||||
// start gathering pubg data from the api
|
||||
if config.Config.Pubg.Enabled {
|
||||
pubg.Start(config.Config.Pubg.APIKey, config.Config.Pubg.Players)
|
||||
}
|
||||
|
||||
router := getRouter()
|
||||
router.Run(config.Config.ServerAddr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user