public ArchonCommandException(ArchonCommand source, Exception subExc, int?expireTimeMilliseconds = null) { Command = source; Message = $"**[{subExc.GetType().FullName} thrown!]** {subExc.Message}"; Expires = expireTimeMilliseconds != null; if (Expires) { ExpireTimeMilliseconds = expireTimeMilliseconds.Value; } }
/// <summary> /// Create a new <see cref="ArchonCommandException"/> with the specified <see cref="ArchonCommand"/> <paramref name="source"/>, error message, and optional expire time in milliseconds (which deletes the message sent in the <see cref="DiscordChannel"/> the command was executed in, if applicable.) /// </summary> /// <param name="source">The <see cref="ArchonCommand"/> that threw this error. Should always be <see cref="this"/></param> /// <param name="errMsg">The error message to accompany which describes why this exception was thrown.</param> /// <param name="expireTimeMilliseconds">The amount of milliseconds until the message sent is deleted. This does nothing if this command was executed from the console.</param> public ArchonCommandException(ArchonCommand source, string errMsg, int?expireTimeMilliseconds = null) { Command = source; Message = errMsg; Expires = expireTimeMilliseconds != null; if (Expires) { ExpireTimeMilliseconds = expireTimeMilliseconds.Value; } }