/// <summary> /// Constructs the <see cref="ConfirmationUserWaitContext"/>. /// </summary> /// <param name="context">The underlying command context.</param> public ConfirmationUserWaitContext(DiscordBotCommandContext context, string name, TimeSpan duration, string confirmation) : base(context, name ?? "Confirmation", duration) { Type = ConfirmationType.Repeat; Confirmation = confirmation ?? throw new ArgumentNullException(nameof(confirmation)); HookEvents(); }
/// <summary> /// Constructs the <see cref="ConfirmationUserWaitContext"/>. /// </summary> /// <param name="context">The underlying command context.</param> public ConfirmationUserWaitContext(DiscordBotCommandContext context, string name, TimeSpan duration, ConfirmationType type, string confirmation = null) : base(context, name ?? "Confirmation", duration) { Type = type; switch (Type) { case ConfirmationType.Yes: Confirmation = "yes"; break; case ConfirmationType.Digit4: Random rng = Services.GetService <Random>(); Confirmation = rng.Next(10000).ToString(); break; case ConfirmationType.Repeat: Confirmation = confirmation ?? throw new ArgumentNullException(nameof(confirmation)); break; } HookEvents(); }