# Module `callbacks`

These are the callbacks that are available to register.

## Functions

channel_act (channel, from, message) | This callback is triggered whenever a user performs a CTCP ACTION in a channel.
channel_msg (channel, from, message) | This callback is triggered whenever a user sends a message to a channel.
channel_notice (channel, from, message) | This callback is triggered whenever a user sends a notice to a channel.
connect () | This callback is triggered when the connection has completed.
ctcp_error (from, to, message) | This callback is triggered when a CTCP command resulted in an error (for example, if the remote client doesn't implement that CTCP command).
dcc_send (from, to, filename, address, port, filesize) | This callback is triggered when a user offers to send you a file using DCC SEND.
deop (channel, from, to) | This callback is triggered whenever somebody loses ops.
devoice (channel, from, to) | This callback is triggered whenever somebody loses voice.
invite (from, channel) | This callback is triggered whenever an invite to a channel is received.
join (channel, from) | This callback is triggered when a user joins a channel.
kick (channel, to, from) | This callback is triggered when a user is kicked from a channel.
me_join (channel) | This callback is triggered after a join() command completes.
nick_change (from, old_nick) | This callback is triggered when a user changes their nick.
op (channel, from, to) | This callback is triggered when a user is opped.
part (channel, from, message) | This callback is triggered when a user leaves a channel.
private_act (from, message) | This callback is triggered when a user sends a CTCP ACTION in a private message.
private_msg (from, message) | This callback is triggered when a user sends a private message.
private_notice (from, message) | This callback is triggered when a user sends a private notice.
quit (from, message) | This callback is triggered when a user quits.
topic_change (channel) | This callback is triggered when a user changes the topic in a channel.
voice (channel, from, to) | This callback is triggered when a user is voiced.

## Functions

channel_act (channel, from, message)
  This callback is triggered whenever a user performs a CTCP ACTION in a channel.

  ### Parameters

  - channel: Channel object for where the action was performed
  - from: User who performed the action
  - message: The action which was performed
channel_msg (channel, from, message)
  This callback is triggered whenever a user sends a message to a channel.

  ### Parameters

  - channel: Channel object for where the message was sent
  - from: User who sent the message
  - message: The message which was sent
channel_notice (channel, from, message)
  This callback is triggered whenever a user sends a notice to a channel.

  ### Parameters

  - channel: Channel object for where the notice was sent
  - from: User who sent the message
  - message: The notice which was sent
connect ()
  This callback is triggered when the connection has completed.
ctcp_error (from, to, message)
  This callback is triggered when a CTCP command resulted in an error (for example, if the remote client doesn't implement that CTCP command).

  ### Parameters

  - from: User who sent the error response
  - to: Who the response was sent to (either you or a channel you are in)
  - message: A description of the error
dcc_send (from, to, filename, address, port, filesize)
  This callback is triggered when a user offers to send you a file using DCC SEND. It allows you to determine whether or not you want to accept the file.

  ### Parameters

  - from: User offering the file
  - to: User who is being offered the file (likely yourself)
  - filename: Name of the file being offered
  - address: IP address of the user offering the file
  - port: Port to connect to at that address
  - filesize: Size of the file being offered

  ### Return value:

  True to accept the file, false to reject it
deop (channel, from, to)
  This callback is triggered whenever somebody loses ops.

  ### Parameters

  - channel: Channel object for where the user lost ops
  - from: User who removed the ops
  - to: User who lost ops
devoice (channel, from, to)
  This callback is triggered whenever somebody loses voice.

  ### Parameters

  - channel: Channel object for where the user lost voice
  - from: User who removed the voice
  - to: User who lost voice
invite (from, channel)
  This callback is triggered whenever an invite to a channel is received.

  ### Parameters

  - from: User who sent the invite
  - channel: Channel name that the invite was to
join (channel, from)
  This callback is triggered when a user joins a channel.

  ### Parameters

  - channel: Channel object for where there was a join
  - from: User who joined
kick (channel, to, from)
  This callback is triggered when a user is kicked from a channel.

  ### Parameters

  - channel: Channel object for where there was a kick
  - to: User who was kicked
  - from: User who did the kicking
me_join (channel)
  This callback is triggered after a join() command completes.

  ### Parameters

  - channel: Channel object for the joined channel
nick_change (from, old_nick)
  This callback is triggered when a user changes their nick.

  ### Parameters

  - from: User who changed their nick
  - old_nick: The previous nick of that user
op (channel, from, to)
  This callback is triggered when a user is opped.

  ### Parameters

  - channel: Channel object for where the user was opped
  - from: User who gave the ops
  - to: User who was opped
part (channel, from, message)
  This callback is triggered when a user leaves a channel.

  ### Parameters

  - channel: Channel object for where the part occurred
  - from: User who left
  - message: Part message from the user
private_act (from, message)
  This callback is triggered when a user sends a CTCP ACTION in a private message.

  ### Parameters

  - from: User who sent the action
  - message: The action that was sent
private_msg (from, message)
  This callback is triggered when a user sends a private message.

  ### Parameters

  - from: User who sent the message
  - message: The message that was sent
private_notice (from, message)
  This callback is triggered when a user sends a private notice.

  ### Parameters

  - from: User who sent the notice
  - message: The notice that was sent
quit (from, message)
  This callback is triggered when a user quits.

  ### Parameters

  - from: User who quit
  - message: The user's quit message
topic_change (channel)
  This callback is triggered when a user changes the topic in a channel. The contents of the topic can be seen in the topic field of the channel object.

  ### Parameters

  - channel: Channel object for where the topic was changed.
voice (channel, from, to)
  This callback is triggered when a user is voiced.

  ### Parameters

  - channel: Channel object for where the user was voiced
  - from: User who gave the voice
  - to: User who was voiced