Skip to content

Commit

Permalink
Expose message webhook Ids
Browse files Browse the repository at this point in the history
  • Loading branch information
fwrs authored and zeyla committed Dec 18, 2016
1 parent fafa363 commit a2cbeb6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions definitions/structs/message.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions src/model/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a2cbeb6

Please sign in to comment.