Trait hiirc::Listener [] [src]

pub trait Listener {
    fn any(&mut self, irc: Arc<Irc>, event: &Event) { ... }
fn msg(&mut self, irc: Arc<Irc>, msg: &Message) { ... }
fn error_msg(&mut self, irc: Arc<Irc>, code: &Code, err: &Message) { ... }
fn close(&mut self, irc: Arc<Irc>, reason: &str) { ... }
fn disconnect(&mut self, irc: Arc<Irc>) { ... }
fn reconnecting(&mut self, irc: Arc<Irc>) { ... }
fn reconnect(&mut self, irc: Arc<Irc>) { ... }
fn welcome(&mut self, irc: Arc<Irc>) { ... }
fn channel_join(&mut self, irc: Arc<Irc>, channel: Arc<Channel>) { ... }
fn user_join(
        &mut self,
        irc: Arc<Irc>,
        channel: Arc<Channel>,
        user: Arc<ChannelUser>
    ) { ... }
fn user_part(
        &mut self,
        irc: Arc<Irc>,
        channel: Arc<Channel>,
        user: Arc<ChannelUser>
    ) { ... }
fn user_quit(&mut self, irc: Arc<Irc>, nickname: &str) { ... }
fn channel_msg(
        &mut self,
        irc: Arc<Irc>,
        channel: Arc<Channel>,
        sender: Arc<ChannelUser>,
        message: &str
    ) { ... }
fn channel_notice(
        &mut self,
        irc: Arc<Irc>,
        channel: Arc<Channel>,
        sender: Arc<ChannelUser>,
        message: &str
    ) { ... }
fn private_msg(&mut self, irc: Arc<Irc>, sender: &PrefixUser, message: &str) { ... }
fn private_notice(
        &mut self,
        irc: Arc<Irc>,
        sender: &PrefixUser,
        message: &str
    ) { ... }
fn topic(
        &mut self,
        irc: Arc<Irc>,
        channel: Arc<Channel>,
        topic: Option<Arc<String>>
    ) { ... }
fn topic_change(
        &mut self,
        irc: Arc<Irc>,
        channel: Arc<Channel>,
        topic: Option<Arc<String>>
    ) { ... }
fn nick_change(&mut self, irc: Arc<Irc>, oldnick: &str, newnick: &str) { ... }
fn kick(
        &mut self,
        irc: Arc<Irc>,
        channel: Arc<Channel>,
        user: Arc<ChannelUser>
    ) { ... }
fn ping(&mut self, irc: Arc<Irc>, server: &str) { ... }
fn pong(&mut self, irc: Arc<Irc>, server: &str) { ... }
fn user_mode_change(
        &mut self,
        irc: Arc<Irc>,
        channel: Arc<Channel>,
        user: Arc<ChannelUser>,
        old_status: ChannelUserStatus,
        new_status: ChannelUserStatus
    ) { ... } }

Implement this trait to handle events.

Provided Methods

Any event.

This includes everything sent by the irc server, i/o errors, disconnects, reconnects, etc.

Any message.

This is not to be confused with channel_msg or private_msg! Messages are a subset of events, they're what the irc server sends.

Any error message.

When the server sends an error message.

When the connection is closed.

It can happen if you manually close the connection, if you set the ReconnectionSettings to DoNotReconnect or if the maximun number of reconnection attempts is reached.

When the connection is broken.

When an attempt to reconnect is made.

When the connection is re-established.

When the server sends the welcome packet.

When the client sucessfully joins a channel.

When a user joins a channel we are listening on.

When a user parts a channel we are listening on.

When a user quits.

When a channel message is received.

When a channel notice is received.

When a private message is received.

When a private notice is received.

Reply to a get_topic command and when joining a channel.

Note that this event might be called before the channel's user list is populated. If a channel has no topic, this event will not be fired when you join a channel. It's safe to assume that a channel has no topic if this event is not fired when joining.

When the topic of is changed by someone.

If you use the set_topic method, you will get a topic_change event instead of a topic event.

When the nick of a user changes.

When a user gets kicked from a channel.

When the server sends a ping message.

When the server sends a pong message.

When the mode of a user in a channel changes.

Implementors