mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Bounds check system name in new system command
This commit is contained in:
parent
a0fc9d3826
commit
0de284cd36
1 changed files with 5 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue