You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

AttachmentExtensions.cs 507 B

123456789101112131415
  1. namespace Discord
  2. {
  3. public static class AttachmentExtensions
  4. {
  5. /// <summary>
  6. /// The prefix applied to files to indicate that it is a spoiler.
  7. /// </summary>
  8. public const string SpoilerPrefix = "SPOILER_";
  9. /// <summary>
  10. /// Gets whether the message's attachments are spoilers or not.
  11. /// </summary>
  12. public static bool IsSpoiler(this IAttachment attachment)
  13. => attachment.Filename.StartsWith(SpoilerPrefix);
  14. }
  15. }