Module irccd.server
Server class.
The server class is usually passed through every Lua callbacks, on IRC events.
The server object will always use the same reference, you can use the server
as table key.
Functions
find (name) | Find an existing server by name. |
connect (params) | Connect to a server. |
Class Server
Server:getIdentity () | Get the identity used for this server. |
Server:getName () | Get the server name id. |
Server:getInfo () | Get the server information. |
Server:cnotice (channel, message) | Send a public notice on a channel. |
Server:join (channel, password) | Join a channel. |
Server:kick (nickname, channel, reason) | Kick someone from a channel. |
Server:me (target, message) | Invoke a CTCP Action. |
Server:mode (channel, mode) | Change the channel mode. |
Server:names (channel) | Get the list of names. |
Server:nick (nickname) | Change your nickname. |
Server:notice (nickname, message) | Send a private notice to a user. |
Server:part (channel, reason) | Leave a channel. |
Server:query (nickname, message) | Send a private message to the specified target. |
Server:say (target, message) | Send a message to a channel or a nickname. |
Server:topic (channel, topic) | Change the topic on the specified channel. |
Server:umode (mode) | Change your own user mode. |
Server:whois (target) | Get whois information from a user. |
Server metamethods
Server:__eq (other) | Test equality. |
Server:__tostring () | Convert object to string. |
Functions
- find (name)
-
Find an existing server by name.
Parameters:
- name the server's resource name
Returns:
- the server or nil if not found
- the error message
- connect (params)
-
Connect to a server.
- name (string): required, the server name
- host (string): required, the hostname
- port (int): required, the port number
- password (string): an optional password for the IRC server
- channels (table): list of string or name, password pairs of channels to join
- identity (table): an identity to use with fields:
- name (string): the identity name
- nickname (string): the nickname to use
- username (string): the username
- realname (string): the full name
Parameters:
- params the parameters
Returns:
- true on success or false
- the error message
See also:
Class Server
- Server:getIdentity ()
-
Get the identity used for this server.
Returns a table with the following fields:
- name (string): the identity name
- nickname (string): the nickname currently in use
- username (string): the username
- realname (string): the full name
- ctcpversion (string): the CTCP Version reply
Returns:
-
an identity table
- Server:getName ()
-
Get the server name id.
Returns:
-
the
name id
- Server:getInfo ()
-
Get the server information.
Returns a table with the server connection information with
the following fields:
- name (string): the server ident
- hostname (string): the hostname
- port (int): the port
- ssl (bool): true if using SSL
- sslVerify (bool): true if using SSL verification
Returns:
-
the information table
- Server:cnotice (channel, message)
-
Send a public notice on a channel.
Parameters:
- channel the target channel
- message the message
- Server:join (channel, password)
-
Join a channel.
Note: the channel must starts with a hash '#'.
Parameters:
- channel the channel to join
- password an optional password
- Server:kick (nickname, channel, reason)
-
Kick someone from a channel.
Parameters:
- nickname the person to kick
- channel from which channel
- reason an optional reason
- Server:me (target, message)
-
Invoke a CTCP Action.
Send a message as known as /me. The target may be a nick
or a channel.
Parameters:
- target a nick or a channel
- message the message to send
- Server:mode (channel, mode)
-
Change the channel mode.
Mode can contains additional parameters
if supported, such as: "+k secret".
Parameters:
- channel the channel target
- mode the mode
- Server:names (channel)
-
Get the list of names.
This function will generate the onNames event.
Parameters:
- channel the channel
See also:
- Server:nick (nickname)
-
Change your nickname.
Parameters:
- nickname the new nickname
- Server:notice (nickname, message)
-
Send a private notice to a user.
Parameters:
- nickname the target nickname
- message the notice message
- Server:part (channel, reason)
-
Leave a channel.
At the moment, is it not possible to leave a channel with a quit message.
Parameters:
- channel the channel to leave
- reason an optional reason
- Server:query (nickname, message)
-
Send a private message to the specified target.
Parameters:
- nickname the target
- message the message
- Server:say (target, message)
-
Send a message to a channel or a nickname.
Parameters:
- target a nick or a channel
- message the message to send
- Server:topic (channel, topic)
-
Change the topic on the specified channel.
Parameters:
- channel the channel
- topic the new topic
- Server:umode (mode)
-
Change your own user mode.
Parameters:
- mode the new mode
- Server:whois (target)
-
Get whois information from a user.
The function will generate the onWhois event.
Parameters:
- target the target
See also: