Skip to content

Commit

Permalink
fix: player/player.go: use strings.CutPrefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dasciam committed Jan 8, 2025
1 parent 26ca0c5 commit e613df4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server/player/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,11 @@ func (p *Player) ExecuteCommand(commandLine string) {
}
args := strings.Split(commandLine, " ")

name := args[0]
if name == "" {
name, ok := strings.CutPrefix(args[0], "/")
if !ok {
return
}
name = name[1:]


command, ok := cmd.ByAlias(name)
if !ok {
o := &cmd.Output{}
Expand Down

0 comments on commit e613df4

Please sign in to comment.