Bounds check system name in new system command
This commit is contained in:
parent
a0fc9d3826
commit
0de284cd36
@ -25,7 +25,11 @@ namespace PluralKit.Bot
|
||||
{
|
||||
ctx.CheckNoSystem();
|
||||
|
||||
var system = await _data.CreateSystem(ctx.RemainderOrNull());
|
||||
var systemName = ctx.RemainderOrNull();
|
||||
if (systemName != null && systemName.Length > Limits.MaxSystemNameLength)
|
||||
throw Errors.SystemNameTooLongError(systemName.Length);
|
||||
|
||||
var system = await _data.CreateSystem(systemName);
|
||||
await _data.AddAccount(system, ctx.Author.Id);
|
||||
await ctx.Reply($"{Emojis.Success} Your system has been created. Type `pk;system` to view it, and type `pk;system help` for more information about commands you can use now. Now that you have that set up, check out the getting started guide on setting up members and proxies: <https://pluralkit.me/start>");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user