diff options
| author | Mishio595 <[email protected]> | 2018-09-16 11:37:51 -0600 |
|---|---|---|
| committer | Mishio595 <[email protected]> | 2018-09-16 11:37:51 -0600 |
| commit | 9fdff0acc0162299e704a4e4b9143e6dfffa02bc (patch) | |
| tree | 49897ea45537a5623ce5d92b08bbe161e793a09b /src/client/event_handler.rs | |
| parent | Don't log event deserialization failures in voice (diff) | |
| download | serenity-9fdff0acc0162299e704a4e4b9143e6dfffa02bc.tar.xz serenity-9fdff0acc0162299e704a4e4b9143e6dfffa02bc.zip | |
Old message is optionally passed with message_update event
Diffstat (limited to 'src/client/event_handler.rs')
| -rw-r--r-- | src/client/event_handler.rs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/client/event_handler.rs b/src/client/event_handler.rs index 32fdaa1..5af7314 100644 --- a/src/client/event_handler.rs +++ b/src/client/event_handler.rs @@ -212,6 +212,18 @@ pub trait EventHandler { /// Provides the channel's id and the deleted messages' ids. fn message_delete_bulk(&self, _ctx: Context, _channel_id: ChannelId, _multiple_deleted_messages_ids: Vec<MessageId>) {} + /// Dispatched when a message is updated. + /// + /// Provides the old message if available and the new message. + #[cfg(feature = "cache")] + fn message_update(&self, _ctx: Context, _old_if_available: Option<Message>, _new: Message) {} + + /// Dispatched when a message is updated. + /// + /// Provides the new data of the message. + #[cfg(not(feature = "cache"))] + fn message_update(&self, _ctx: Context, _new_data: MessageUpdateEvent) {} + /// Dispatched when a new reaction is attached to a message. /// /// Provides the reaction's data. @@ -227,11 +239,6 @@ pub trait EventHandler { /// Provides the channel's id and the message's id. fn reaction_remove_all(&self, _ctx: Context, _channel_id: ChannelId, _removed_from_message_id: MessageId) {} - /// Dispatched when a message is updated. - /// - /// Provides the new data of the message. - fn message_update(&self, _ctx: Context, _new_data: MessageUpdateEvent) {} - fn presence_replace(&self, _ctx: Context, _: Vec<Presence>) {} /// Dispatched when a user's presence is updated (e.g off -> on). |