Skip to content

Commit

Permalink
Enable condition for sending forwarded messages
Browse files Browse the repository at this point in the history
  • Loading branch information
vicr123 committed Dec 8, 2024
1 parent 752f827 commit 92d6b1a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -595,14 +595,15 @@ public virtual async Task<Result<IMessage>> CreateMessageAsync
&& !embeds.HasValue
&& !stickerIDs.HasValue
&& !components.HasValue
&& !poll.HasValue;
&& !poll.HasValue
&& (!messageReference.HasValue || messageReference.Value.Type != MessageReferenceType.Forward);

if (hasAtLeastOnePayload)
{
return new InvalidOperationError
(
$"At least one of {nameof(content)}, {nameof(attachments)}, {nameof(embeds)}, {nameof(components)}, "
+ $"or {nameof(stickerIDs)} is required."
+ $"{nameof(stickerIDs)}, or {nameof(messageReference)} with {nameof(messageReference.Value.Type)} = {nameof(MessageReferenceType.Forward)} is required."
);
}

Expand Down

0 comments on commit 92d6b1a

Please sign in to comment.