Update go-mcm

Signed-off-by: Etzelia <etzelia@hotmail.com>
rate-insult
Etzelia 2020-06-11 01:16:04 -05:00
parent d09db4ddce
commit 704373c5cd
No known key found for this signature in database
GPG Key ID: 708511AE7ABC5314
3 changed files with 11 additions and 7 deletions

View File

@ -36,17 +36,17 @@ func init() {
} }
var nickname string var nickname string
var accepted bool var accepted *bool
if len(players) > 0 { if len(players) > 0 {
nickname = players[0].Username nickname = players[0].Username
if len(apps) == 0 { if len(apps) == 0 {
apps, err = models.Application(models.NewDjangoBuilder().Exact(django.ApplicationID, fmt.Sprintf("%d", players[0].ApplicationID))) apps, err = models.Application(models.NewDjangoBuilder().Eq(django.ApplicationID, players[0].ApplicationID))
if len(apps) == 0 { if len(apps) == 0 {
return errors.New("something hecked up, please contact staff") return errors.New("something went wrong, please contact staff")
} }
} }
} else if len(apps) > 0 { } else if len(apps) > 0 {
if accepted { if apps[0].Accepted != nil && *apps[0].Accepted {
return errors.New("please join the server and then re-try this command") return errors.New("please join the server and then re-try this command")
} }
} else { } else {
@ -54,8 +54,10 @@ func init() {
} }
accepted = apps[0].Accepted accepted = apps[0].Accepted
if !accepted { if accepted == nil {
return errors.New("sorry, your application was denied or is still in review") return errors.New("your application is still being reviewed, hang tight")
} else if !*accepted {
return errors.New("your application was denied, good luck finding a new server")
} }
// Accepted // Accepted

2
go.mod
View File

@ -7,7 +7,7 @@ require (
github.com/bwmarrin/discordgo v0.20.3 github.com/bwmarrin/discordgo v0.20.3
github.com/urfave/cli/v2 v2.2.0 // indirect github.com/urfave/cli/v2 v2.2.0 // indirect
go.etcd.io/bbolt v1.3.4 go.etcd.io/bbolt v1.3.4
go.etztech.xyz/go-mcm v1.2.0 go.etztech.xyz/go-mcm v1.3.0
go.etztech.xyz/inspiro v0.0.0-20200606185551-edfdf9da2359 go.etztech.xyz/inspiro v0.0.0-20200606185551-edfdf9da2359
go.jolheiser.com/beaver v1.0.2 go.jolheiser.com/beaver v1.0.2
) )

2
go.sum
View File

@ -18,6 +18,8 @@ go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg=
go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.etztech.xyz/go-mcm v1.2.0 h1:QEOv6oAjy9ICP3AOcwItNT88wBjOZHK7UKseZEcZh0k= go.etztech.xyz/go-mcm v1.2.0 h1:QEOv6oAjy9ICP3AOcwItNT88wBjOZHK7UKseZEcZh0k=
go.etztech.xyz/go-mcm v1.2.0/go.mod h1:Hz2YULB3sN/aQA8cPSm2d6LM3E3qTMspzfRCIAD/1dc= go.etztech.xyz/go-mcm v1.2.0/go.mod h1:Hz2YULB3sN/aQA8cPSm2d6LM3E3qTMspzfRCIAD/1dc=
go.etztech.xyz/go-mcm v1.3.0 h1:ULhLEHRJZYh+hIgHfp7IuqpOn6H7kkrVxnnfzyZLQM0=
go.etztech.xyz/go-mcm v1.3.0/go.mod h1:Hz2YULB3sN/aQA8cPSm2d6LM3E3qTMspzfRCIAD/1dc=
go.etztech.xyz/inspiro v0.0.0-20200606185551-edfdf9da2359 h1:j/ZeoAj185wHfCSYD52Kt/69i3Bzk1MXN4Qh1yP6+P4= go.etztech.xyz/inspiro v0.0.0-20200606185551-edfdf9da2359 h1:j/ZeoAj185wHfCSYD52Kt/69i3Bzk1MXN4Qh1yP6+P4=
go.etztech.xyz/inspiro v0.0.0-20200606185551-edfdf9da2359/go.mod h1:+fC1WzJm/oS4UEgqr1jPouWerxBys52lTTDA94/5bf8= go.etztech.xyz/inspiro v0.0.0-20200606185551-edfdf9da2359/go.mod h1:+fC1WzJm/oS4UEgqr1jPouWerxBys52lTTDA94/5bf8=
go.jolheiser.com/beaver v1.0.2 h1:KA2D6iO8MQhZi1nZYi/Chak/f1Cxfrs6b1XO623+Khk= go.jolheiser.com/beaver v1.0.2 h1:KA2D6iO8MQhZi1nZYi/Chak/f1Cxfrs6b1XO623+Khk=