Functions | |
int | irc_cmd_join (irc_session_t *session, const char *channel, const char *key) |
Joins the new IRC channel. | |
int | irc_cmd_part (irc_session_t *session, const char *channel) |
Leaves the IRC channel. | |
int | irc_cmd_invite (irc_session_t *session, const char *nick, const char *channel) |
Invites a user to invite-only channel. | |
int | irc_cmd_names (irc_session_t *session, const char *channel) |
Obtains a list of users who're in channel. | |
int | irc_cmd_list (irc_session_t *session, const char *channel) |
Obtains a list of active server channels with their topics. | |
int | irc_cmd_topic (irc_session_t *session, const char *channel, const char *topic) |
Views or changes the channel topic. | |
int | irc_cmd_channel_mode (irc_session_t *session, const char *channel, const char *mode) |
Views or changes the channel mode. | |
int | irc_cmd_kick (irc_session_t *session, const char *nick, const char *channel, const char *reason) |
Kick some lazy ass out of channel. |
int irc_cmd_channel_mode | ( | irc_session_t * | session, | |
const char * | channel, | |||
const char * | mode | |||
) |
Views or changes the channel mode.
session | An initiated and connected session. | |
channel | A channel name to invite to. Must not be NULL. | |
mode | A channel mode, described below. If NULL, the channel mode is not changed, just the old mode is returned. |
Channel mode is represended by the letters combination. Every letter has its own meaning in channel modes. Most channel mode letters are boolean (i.e. could only be set or reset), but a few channel mode letters accept a parameter. All channel options are set by adding a plus sign before the letter, and reset by adding a minus sign before the letter.
Here is the list of 'standard' channel modes:
Note that the actual list of channel modes depends on the IRC server, and can be bigger. If you know the popular channel modes, which aren't mentioned here - please contact me at tim@krasnogorsk.ru
Possible error responces for this command from the RFC1459:
And the mode information is given using following reply codes:
int irc_cmd_invite | ( | irc_session_t * | session, | |
const char * | nick, | |||
const char * | channel | |||
) |
Invites a user to invite-only channel.
session | An initiated and connected session. | |
nick | A nick to invite. Must not be NULL. | |
channel | A channel name to invite to. Must not be NULL. |
Possible error responces for this command from the RFC1459:
And on success one of the following replies returned:
int irc_cmd_join | ( | irc_session_t * | session, | |
const char * | channel, | |||
const char * | key | |||
) |
Joins the new IRC channel.
session | An initiated and connected session. | |
channel | A channel name to join to. Must not be NULL. | |
key | Channel password. May be NULL. |
If join is successful, the irc_callbacks_t::event_join is called (with origin == your nickname), then you are sent the channel's topic (using LIBIRC_RFC_RPL_TOPIC) and the list of users who are on the channel (using LIBIRC_RFC_RPL_NAMREPLY), which includes the user joining - namely you.
Possible error responces for this command from the RFC1459:
And on success the following replies returned:
int irc_cmd_kick | ( | irc_session_t * | session, | |
const char * | nick, | |||
const char * | channel, | |||
const char * | reason | |||
) |
Kick some lazy ass out of channel.
session | An initiated and connected session. | |
nick | A nick to kick. Must not be NULL. | |
channel | A channel to kick this nick out of. Must not be NULL. | |
reason | A reason to kick. May be NULL. |
Possible error responces for this command from the RFC1459:
On success the irc_callbacks_t::event_kick event will be generated.
int irc_cmd_list | ( | irc_session_t * | session, | |
const char * | channel | |||
) |
Obtains a list of active server channels with their topics.
session | An initiated and connected session. | |
channel | A channel name(s) to list. May be NULL, in which case all the channels will be listed. It is possible to specify more than a single channel, but several channel names should be separated by a comma. |
Possible error responces for this command from the RFC1459:
And the channel list is returned using the following reply codes:
int irc_cmd_names | ( | irc_session_t * | session, | |
const char * | channel | |||
) |
Obtains a list of users who're in channel.
session | An initiated and connected session. | |
channel | A channel name(s) to obtain user list. Must not be NULL. It is possible to specify more than a single channel, but several channel names should be separated by a comma. |
The channel names are returned by irc_callbacks_t::event_numeric using the following reply codes:
int irc_cmd_part | ( | irc_session_t * | session, | |
const char * | channel | |||
) |
Leaves the IRC channel.
session | An initiated and connected session. | |
channel | A channel name to leave. Must not be NULL. |
Possible error responces for this command from the RFC1459:
int irc_cmd_topic | ( | irc_session_t * | session, | |
const char * | channel, | |||
const char * | topic | |||
) |
Views or changes the channel topic.
session | An initiated and connected session. | |
channel | A channel name to invite to. Must not be NULL. | |
topic | A new topic to change. If NULL, the old topic will be returned, and topic won't changed. |
If the command succeed, the IRC server will generate a RPL_NOTOPIC or RPL_TOPIC message, containing either old or changed topic. Also the IRC server can (but not have to) generate the non-RFC RPL_TOPIC_EXTRA message, containing the nick of person, who's changed the topic, and the time of latest topic change.
Possible error responces for this command from the RFC1459:
And the topic information is returned using one of following reply codes: