aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIllia <[email protected]>2016-12-18 21:13:18 +0300
committerzeyla <[email protected]>2016-12-18 10:13:18 -0800
commita2cbeb6ece9ef56e2082b6eabbabe5fe536ab3ec (patch)
treeff6658654584e0affc0ccf4fa181db07e4603540
parentFix framework command cooldowns (diff)
downloadserenity-a2cbeb6ece9ef56e2082b6eabbabe5fe536ab3ec.tar.xz
serenity-a2cbeb6ece9ef56e2082b6eabbabe5fe536ab3ec.zip
Expose message webhook Ids
-rw-r--r--definitions/structs/message.yml4
-rw-r--r--src/model/channel.rs6
2 files changed, 10 insertions, 0 deletions
diff --git a/definitions/structs/message.yml b/definitions/structs/message.yml
index 2cd82a3..12e8f49 100644
--- a/definitions/structs/message.yml
+++ b/definitions/structs/message.yml
@@ -63,3 +63,7 @@ fields:
- name: tts
description: True if message was sent with /tts command.
type: bool
+ - name: webhook_id
+ description: An id of a webhook if message was sent using one.
+ optional: true
+ type: WebhookId
diff --git a/src/model/channel.rs b/src/model/channel.rs
index 2724f1e..d769016 100644
--- a/src/model/channel.rs
+++ b/src/model/channel.rs
@@ -420,6 +420,12 @@ impl Group {
}
impl Message {
+ /// True only if message was sent using a webhook.
+ #[cfg(feature="methods")]
+ pub fn is_webhook(&self) -> bool {
+ self.webhook_id.is_some()
+ }
+
/// Deletes the message.
///
/// **Note**: The logged in user must either be the author of the message or