-
Notifications
You must be signed in to change notification settings - Fork 277
scripting network
Kiwi has multi-network support meaning you can be connected to many IRC networks at once. You can listen for events or interact on all connected networks by getting the following reference:
var network = kiwi.components.Network()
Or if you know the specific network/connection ID to use:
var network = kiwi.components.Network(connection_id)
Send raw IRC data to the server
network.raw('raw data')
Kick a user from a channel
network.kick('#channel', 'nick', 'reason why kicked')
Set the topic for a channel
network.topic('#channel', 'the new topic')
Part a channel
network.part('#channel')
Join a channel
network.join('#channel', 'optional_key')
Send an action to a channel or user
network.action('#channel_or_user', 'your message')
Send a CTCP message to a user
network.ctcpRequest('VERSION', '#channel_or_user', 'optional params')
Respond to a CTCP message
network.ctcpResponse('VERSION', '#channel_or_user', 'optional params')
Send a message via CTCP to a user
network.ctcp(is_a_request, 'VERSION', '#channel_or_user', 'optional params')
Send a notice to a channel or user
network.notice('#channel_or_user', 'your message')
Send a normal message (PRIVMSG) to a channel or user
network.msg('#channel_or_user', 'your message')
Change your nickname on the network
network.changeNick('new_nickname')
Retrieve general information on a channel
network.channelInfo('#channel')
Set the mode for a channel or user
network.mode('#channel_or_user', '+i')
It is possible to retrieve information for a connected network, such as the network name or current nick.
You can get these via network.get('name')
Name | Description |
---|---|
address |
Network address |
port |
Network port |
name |
Network name |
channel_prefix |
Channel name prefix (eg. # or &) |
nick |
Current users nickname |
You can bind to network related events via:
network.on('event', function)
Bind to the channel
event to listen to all of these
Event | Arguments |
---|---|
channel:join |
{channel, nick, ident, hostname, time} |
channel:part |
{channel, nick, ident, hostname, message, time} |
channel:quit |
{nick, ident, hostname, message, time} |
channel:kick |
{channel, kicked, nick, ident, hostname, message, time} |
Bind to the message
event to listen to all of these
Event | Arguments |
---|---|
message:message |
{type, nick, ident, hostname, target, msg, time} |
message:notice |
{type, nick, ident, hostname, target, msg, from_server, time} |
message:action |
{type, nick, ident, hostname, target, msg, time} |
Event | Arguments | Notes |
---|---|---|
connect |
{nick} | |
disconnect |
{reason} | |
nick |
{nick, newnick} | |
options |
{options, cap} | |
motd |
{msg} | |
channel_redirect |
{from, to} | |
nick |
{nick, ident, hostname, newnick} | |
ctcp_request |
{nick, ident, hostname, target, type, msg, time} | |
ctcp_response |
{nick, ident, hostname, target, type, msg, time} | |
topic |
{channel, topic, nick, time} | |
topicsetby |
{channel, nick, when} | |
userlist |
{channel, users} | |
userlist_end |
{} | |
banlist |
{channel, bans} | |
mode |
{nick, target, modes, time} | |
whois |
{nick, msg, end} | May be one of several whois events. Each may contain other information. If end === true, this is the final whois event. |
whowas |
{nick, ident, host, real_name, end} | If end === true, this is the final whowas event. |
away |
{nick, msg} | |
list_start |
{} | |
list_channel |
{chans} | |
irc_error |
{error} | |
unknown_command |
{error, command, params} | |
channel_info |
{} | Channel info event may contain one of several types of info including creation time and modes. |
Officially mirrored at https://kiwiirc.com/docs/