Hide owner commands from command endpoint
This commit is contained in:
parent
6d3fc46e34
commit
a8c91c0372
2 changed files with 3 additions and 4 deletions
|
@ -32,10 +32,10 @@ namespace Geekbot.net.WebApi.Controllers.Commands
|
|||
Name = cmd.Name,
|
||||
Summary = cmd.Summary,
|
||||
IsAdminCommand = param.Contains("admin") || param.Contains("owner"),
|
||||
Aliases = cmd.Aliases.ToArray(),
|
||||
Aliases = cmd.Aliases.ToList(),
|
||||
Params = cmdParamsObj
|
||||
}).ToList();
|
||||
return Ok(commandList);
|
||||
return Ok(commandList.FindAll(e => !e.Aliases[0].StartsWith("owner")));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,10 +6,9 @@ namespace Geekbot.net.WebApi.Controllers.Commands
|
|||
public class CommandDto
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Category { get; set; }
|
||||
public string Summary { get; set; }
|
||||
public bool IsAdminCommand { get; set; }
|
||||
public Array Aliases { get; set; }
|
||||
public List<string> Aliases { get; set; }
|
||||
public List<CommandParamDto> Params { get; set; }
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue