Trait EventHandler

Source
pub trait EventHandler: Send + Sync {
Show 36 methods // Provided methods fn ready<'life0, 'async_trait>( &'life0 self, _ctx: Context, _ready: Ready, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn message_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _message: Message, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn direct_message_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _message: DirectMessage, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn group_message_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _message: GroupMessage, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn c2c_message_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _message: C2CMessage, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn message_delete<'life0, 'async_trait>( &'life0 self, _ctx: Context, _message: Message, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _guild: Guild, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_update<'life0, 'async_trait>( &'life0 self, _ctx: Context, _guild: Guild, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_delete<'life0, 'async_trait>( &'life0 self, _ctx: Context, _guild: Guild, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn channel_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _channel: Channel, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn channel_update<'life0, 'async_trait>( &'life0 self, _ctx: Context, _channel: Channel, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn channel_delete<'life0, 'async_trait>( &'life0 self, _ctx: Context, _channel: Channel, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_member_add<'life0, 'async_trait>( &'life0 self, _ctx: Context, _member: Member, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_member_update<'life0, 'async_trait>( &'life0 self, _ctx: Context, _member: Member, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn guild_member_remove<'life0, 'async_trait>( &'life0 self, _ctx: Context, _member: Member, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn message_audit_pass<'life0, 'async_trait>( &'life0 self, _ctx: Context, _audit: MessageAudit, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn message_audit_reject<'life0, 'async_trait>( &'life0 self, _ctx: Context, _audit: MessageAudit, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn friend_add<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: C2CManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn friend_del<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: C2CManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn c2c_msg_reject<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: C2CManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn c2c_msg_receive<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: C2CManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn group_add_robot<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: GroupManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn group_del_robot<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: GroupManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn group_msg_reject<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: GroupManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn group_msg_receive<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: GroupManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn audio_or_live_channel_member_enter<'life0, 'async_trait>( &'life0 self, _ctx: Context, _audio: PublicAudio, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn audio_or_live_channel_member_exit<'life0, 'async_trait>( &'life0 self, _ctx: Context, _audio: PublicAudio, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn open_forum_thread_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _thread: OpenThread, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn open_forum_thread_update<'life0, 'async_trait>( &'life0 self, _ctx: Context, _thread: OpenThread, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn open_forum_thread_delete<'life0, 'async_trait>( &'life0 self, _ctx: Context, _thread: OpenThread, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn open_forum_post_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _thread: OpenThread, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn open_forum_post_delete<'life0, 'async_trait>( &'life0 self, _ctx: Context, _thread: OpenThread, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn open_forum_reply_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _thread: OpenThread, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn open_forum_reply_delete<'life0, 'async_trait>( &'life0 self, _ctx: Context, _thread: OpenThread, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn unknown_event<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: GatewayEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn error<'life0, 'async_trait>( &'life0 self, _error: BotError, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}
Expand description

Event handler trait for processing gateway events.

Provided Methods§

Source

fn ready<'life0, 'async_trait>( &'life0 self, _ctx: Context, _ready: Ready, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when the bot is ready and connected.

Source

fn message_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _message: Message, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a message is created (@ mentions).

Source

fn direct_message_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _message: DirectMessage, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a direct message is created.

Source

fn group_message_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _message: GroupMessage, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a group message is created.

Source

fn c2c_message_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _message: C2CMessage, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a C2C message is created.

Source

fn message_delete<'life0, 'async_trait>( &'life0 self, _ctx: Context, _message: Message, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a message is deleted.

Source

fn guild_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _guild: Guild, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a guild is created (bot joins).

Source

fn guild_update<'life0, 'async_trait>( &'life0 self, _ctx: Context, _guild: Guild, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a guild is updated.

Source

fn guild_delete<'life0, 'async_trait>( &'life0 self, _ctx: Context, _guild: Guild, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a guild is deleted (bot leaves).

Source

fn channel_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _channel: Channel, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a channel is created.

Source

fn channel_update<'life0, 'async_trait>( &'life0 self, _ctx: Context, _channel: Channel, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a channel is updated.

Source

fn channel_delete<'life0, 'async_trait>( &'life0 self, _ctx: Context, _channel: Channel, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a channel is deleted.

Source

fn guild_member_add<'life0, 'async_trait>( &'life0 self, _ctx: Context, _member: Member, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a guild member is added.

Source

fn guild_member_update<'life0, 'async_trait>( &'life0 self, _ctx: Context, _member: Member, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a guild member is updated.

Source

fn guild_member_remove<'life0, 'async_trait>( &'life0 self, _ctx: Context, _member: Member, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a guild member is removed.

Source

fn message_audit_pass<'life0, 'async_trait>( &'life0 self, _ctx: Context, _audit: MessageAudit, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a message audit passes.

Source

fn message_audit_reject<'life0, 'async_trait>( &'life0 self, _ctx: Context, _audit: MessageAudit, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a message audit is rejected.

Source

fn friend_add<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: C2CManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a friend is added.

Source

fn friend_del<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: C2CManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a friend is deleted.

Source

fn c2c_msg_reject<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: C2CManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when C2C message is rejected.

Source

fn c2c_msg_receive<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: C2CManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when C2C message is received.

Source

fn group_add_robot<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: GroupManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when robot is added to group.

Source

fn group_del_robot<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: GroupManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when robot is deleted from group.

Source

fn group_msg_reject<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: GroupManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when group message is rejected.

Source

fn group_msg_receive<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: GroupManageEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when group message is received.

Source

fn audio_or_live_channel_member_enter<'life0, 'async_trait>( &'life0 self, _ctx: Context, _audio: PublicAudio, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a user enters an audio or live channel.

Source

fn audio_or_live_channel_member_exit<'life0, 'async_trait>( &'life0 self, _ctx: Context, _audio: PublicAudio, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when a user exits an audio or live channel.

Source

fn open_forum_thread_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _thread: OpenThread, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when an open forum thread is created.

Source

fn open_forum_thread_update<'life0, 'async_trait>( &'life0 self, _ctx: Context, _thread: OpenThread, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when an open forum thread is updated.

Source

fn open_forum_thread_delete<'life0, 'async_trait>( &'life0 self, _ctx: Context, _thread: OpenThread, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when an open forum thread is deleted.

Source

fn open_forum_post_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _thread: OpenThread, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when an open forum post is created.

Source

fn open_forum_post_delete<'life0, 'async_trait>( &'life0 self, _ctx: Context, _thread: OpenThread, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when an open forum post is deleted.

Source

fn open_forum_reply_create<'life0, 'async_trait>( &'life0 self, _ctx: Context, _thread: OpenThread, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when an open forum reply is created.

Source

fn open_forum_reply_delete<'life0, 'async_trait>( &'life0 self, _ctx: Context, _thread: OpenThread, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when an open forum reply is deleted.

Source

fn unknown_event<'life0, 'async_trait>( &'life0 self, _ctx: Context, _event: GatewayEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called for any unhandled events.

Source

fn error<'life0, 'async_trait>( &'life0 self, _error: BotError, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when an error occurs during event processing.

Implementors§