forked from TeamInklings/Octobot
Limit string argument length to avoid "embed description too long" errors (#174)
This PR fixes an error that would appear if a string that's way too long
was passed as a command argument by limiting the string's length

This commit is contained in:
parent
cf7007f269
commit
0ba357e4c7
5 changed files with 19 additions and 7 deletions
|
@ -1,4 +1,5 @@
|
|||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text;
|
||||
using JetBrains.Annotations;
|
||||
using Octobot.Data;
|
||||
|
@ -119,7 +120,8 @@ public class RemindCommandGroup : CommandGroup
|
|||
public async Task<Result> ExecuteReminderAsync(
|
||||
[Description("After what period of time mention the reminder")]
|
||||
TimeSpan @in,
|
||||
[Description("Reminder text")] string text)
|
||||
[Description("Reminder text")] [MaxLength(512)]
|
||||
string text)
|
||||
{
|
||||
if (!_context.TryGetContextIDs(out var guildId, out var channelId, out var executorId))
|
||||
{
|
||||
|
|
Reference in a new issue