public GuildEvent(EventType type, string message, string imageUrl = null) { if (Check.NotNull(imageUrl)) { ExtensionType?url = EnumUtils.GetUrlExtension(imageUrl); if (url.HasValue) { if (url.Value != ExtensionType.Image) { throw new ArgumentException("The specified URL given is not an image file."); } } } Type = type; Message = message; ImageUrl = imageUrl; }
public AttachmentData(IAttachment attachment, string name) { Name = name; Extension = EnumUtils.GetUrlExtension(attachment.Filename) ?? ExtensionType.Empty; Url = attachment.Url; }