aboutsummaryrefslogtreecommitdiff
path: root/src/model/channel/attachment.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/channel/attachment.rs')
-rw-r--r--src/model/channel/attachment.rs23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/model/channel/attachment.rs b/src/model/channel/attachment.rs
index b6ce53d..17e3076 100644
--- a/src/model/channel/attachment.rs
+++ b/src/model/channel/attachment.rs
@@ -1,7 +1,28 @@
use hyper::Client as HyperClient;
use std::io::Read;
use ::internal::prelude::*;
-use ::model::Attachment;
+
+/// A file uploaded with a message. Not to be confused with [`Embed`]s.
+///
+/// [`Embed`]: struct.Embed.html
+#[derive(Clone, Debug, Deserialize)]
+pub struct Attachment {
+ /// The unique ID given to this attachment.
+ pub id: String,
+ /// The filename of the file that was uploaded. This is equivalent to what
+ /// the uploader had their file named.
+ pub filename: String,
+ /// If the attachment is an image, then the height of the image is provided.
+ pub height: Option<u64>,
+ /// The proxy URL.
+ pub proxy_url: String,
+ /// The size of the file in bytes.
+ pub size: u64,
+ /// The URL of the uploaded attachment.
+ pub url: String,
+ /// If the attachment is an image, then the widfth of the image is provided.
+ pub width: Option<u64>,
+}
impl Attachment {
/// If this attachment is an image, then a tuple of the width and height