debug
This commit is contained in:
parent
babc0a4330
commit
2d1b92a3b3
@ -1,6 +1,7 @@
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/TicketsBot/GoPanel/database"
|
"github.com/TicketsBot/GoPanel/database"
|
||||||
"github.com/TicketsBot/GoPanel/utils"
|
"github.com/TicketsBot/GoPanel/utils"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
@ -15,7 +16,9 @@ type wrappedGuild struct {
|
|||||||
func GetGuilds(ctx *gin.Context) {
|
func GetGuilds(ctx *gin.Context) {
|
||||||
userId := ctx.Keys["userid"].(uint64)
|
userId := ctx.Keys["userid"].(uint64)
|
||||||
|
|
||||||
|
fmt.Println("getting guilds")
|
||||||
guilds, err := database.Client.UserGuilds.Get(userId)
|
guilds, err := database.Client.UserGuilds.Get(userId)
|
||||||
|
fmt.Println("got guilds")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.JSON(500, gin.H{
|
ctx.JSON(500, gin.H{
|
||||||
"success": false,
|
"success": false,
|
||||||
@ -37,8 +40,10 @@ func GetGuilds(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isAdmin := make(chan bool)
|
isAdmin := make(chan bool)
|
||||||
|
fmt.Println("getting admin")
|
||||||
go utils.IsAdmin(fakeGuild, userId, isAdmin)
|
go utils.IsAdmin(fakeGuild, userId, isAdmin)
|
||||||
if <-isAdmin {
|
if <-isAdmin {
|
||||||
|
fmt.Println("got admin")
|
||||||
adminGuilds = append(adminGuilds, wrappedGuild{
|
adminGuilds = append(adminGuilds, wrappedGuild{
|
||||||
Id: g.GuildId,
|
Id: g.GuildId,
|
||||||
Name: g.Name,
|
Name: g.Name,
|
||||||
|
@ -21,7 +21,7 @@ type Settings struct {
|
|||||||
|
|
||||||
func GetSettingsHandler(ctx *gin.Context) {
|
func GetSettingsHandler(ctx *gin.Context) {
|
||||||
guildId := ctx.Keys["guildid"].(uint64)
|
guildId := ctx.Keys["guildid"].(uint64)
|
||||||
|
ctx.Done()
|
||||||
var prefix, welcomeMessage string
|
var prefix, welcomeMessage string
|
||||||
var ticketLimit uint8
|
var ticketLimit uint8
|
||||||
var category, archiveChannel uint64
|
var category, archiveChannel uint64
|
||||||
|
3
go.mod
3
go.mod
@ -14,17 +14,14 @@ require (
|
|||||||
github.com/gin-gonic/contrib v0.0.0-20191209060500-d6e26eeaa607
|
github.com/gin-gonic/contrib v0.0.0-20191209060500-d6e26eeaa607
|
||||||
github.com/gin-gonic/gin v1.6.2
|
github.com/gin-gonic/gin v1.6.2
|
||||||
github.com/go-redis/redis v6.15.7+incompatible
|
github.com/go-redis/redis v6.15.7+incompatible
|
||||||
github.com/go-sql-driver/mysql v1.5.0
|
|
||||||
github.com/gofrs/uuid v3.3.0+incompatible
|
github.com/gofrs/uuid v3.3.0+incompatible
|
||||||
github.com/gorilla/sessions v1.2.0 // indirect
|
github.com/gorilla/sessions v1.2.0 // indirect
|
||||||
github.com/gorilla/websocket v1.4.2
|
github.com/gorilla/websocket v1.4.2
|
||||||
github.com/jackc/pgx/v4 v4.6.0
|
github.com/jackc/pgx/v4 v4.6.0
|
||||||
github.com/jinzhu/gorm v1.9.12
|
|
||||||
github.com/pasztorpisti/qs v0.0.0-20171216220353-8d6c33ee906c
|
github.com/pasztorpisti/qs v0.0.0-20171216220353-8d6c33ee906c
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/robfig/go-cache v0.0.0-20130306151617-9fc39e0dbf62
|
github.com/robfig/go-cache v0.0.0-20130306151617-9fc39e0dbf62
|
||||||
github.com/rxdn/gdl v0.0.0-20200511170555-8ab2206d70df
|
github.com/rxdn/gdl v0.0.0-20200511170555-8ab2206d70df
|
||||||
github.com/satori/go.uuid v1.2.0
|
|
||||||
github.com/sirupsen/logrus v1.5.0
|
github.com/sirupsen/logrus v1.5.0
|
||||||
github.com/ulule/limiter/v3 v3.5.0
|
github.com/ulule/limiter/v3 v3.5.0
|
||||||
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
|
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user