Add missing check to Content value to prevent NRE on empty message.
Also made `ModifyInteractionFollowupMessageAsync`'s check consistent with `CreateInteractionFollowupMessageAsync`
if (args.Content.IsSpecified && args.Content.Value.Length > DiscordConfig.MaxMessageSize)
if (args.Content.IsSpecified && args.Content.Value?.Length > DiscordConfig.MaxMessageSize)
throw new ArgumentException(message: $"Message content is too long, length must be less or equal to {DiscordConfig.MaxMessageSize}.", paramName: nameof(args.Content));
throw new ArgumentException(message: $"Message content is too long, length must be less or equal to {DiscordConfig.MaxMessageSize}.", paramName: nameof(args.Content));
options = RequestOptions.CreateOrClone(options);
options = RequestOptions.CreateOrClone(options);
@@ -1368,9 +1367,8 @@ namespace Discord.API
Preconditions.NotNull(args, nameof(args));
Preconditions.NotNull(args, nameof(args));
Preconditions.NotEqual(id, 0, nameof(id));
Preconditions.NotEqual(id, 0, nameof(id));
if (args.Content.IsSpecified)
if (args.Content.Value.Length > DiscordConfig.MaxMessageSize)
throw new ArgumentException(message: $"Message content is too long, length must be less or equal to {DiscordConfig.MaxMessageSize}.", paramName: nameof(args.Content));
if (args.Content.IsSpecified && args.Content.Value?.Length > DiscordConfig.MaxMessageSize)
throw new ArgumentException(message: $"Message content is too long, length must be less or equal to {DiscordConfig.MaxMessageSize}.", paramName: nameof(args.Content));
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.