This commit is contained in:
parent
1fbe5ca7bf
commit
fb5f508fdf
@ -11,7 +11,7 @@ import (
|
||||
"github.com/gorcon/rcon"
|
||||
)
|
||||
|
||||
var listplayersCommand = &disgoman.Command{
|
||||
var ListplayersCommand = &disgoman.Command{
|
||||
Name: "request",
|
||||
Aliases: nil,
|
||||
Description: "Submit a request for the guild staff",
|
||||
@ -44,7 +44,18 @@ func listplayersCommandFunc(ctx disgoman.Context, args []string) {
|
||||
for _, server := range servers {
|
||||
go listplayers(ctx, server)
|
||||
}
|
||||
return
|
||||
}
|
||||
serverName := strings.Join(args, " ")
|
||||
server, err := services.ServerService.ServerByName(serverName, guild)
|
||||
if err != nil {
|
||||
discord_utils.SendErrorMessage(ctx,
|
||||
fmt.Sprintf("Could not find **%s** in this guild.", serverName),
|
||||
err,
|
||||
)
|
||||
return
|
||||
}
|
||||
listplayers(ctx, server)
|
||||
}
|
||||
|
||||
func listplayers(ctx disgoman.Context, server geeksbot.Server) {
|
||||
|
||||
@ -2,6 +2,7 @@ package exts
|
||||
|
||||
import (
|
||||
"github.com/dustinpianalto/disgoman"
|
||||
"github.com/dustinpianalto/geeksbot/internal/exts/arcon"
|
||||
"github.com/dustinpianalto/geeksbot/internal/exts/guild"
|
||||
"github.com/dustinpianalto/geeksbot/internal/exts/requests"
|
||||
"github.com/dustinpianalto/geeksbot/internal/exts/utils"
|
||||
@ -36,4 +37,5 @@ func AddCommandHandlers(g *disgoman.CommandManager) {
|
||||
_ = g.AddCommand(requests.ListCommand)
|
||||
_ = g.AddCommand(requests.ViewCommand)
|
||||
_ = g.AddCommand(requests.CommentCommand)
|
||||
_ = g.AddCommand(arcon.ListplayersCommand)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user