IRCCD-API(7) - Miscellaneous Information Manual

NAME

irccd-api - irccd Javascript API

SYNOPSIS

Modules

Irccd
Irccd.Chrono
Irccd.Directory
Irccd.File
Irccd.Hook
Irccd.Logger
Irccd.Plugin
Irccd.Rule
Irccd.Server
Irccd.System
Irccd.Timer
Irccd.Unicode
Irccd.Util

Events

onCommand(server, origin, channel, message);

onConnect(server);

onDisonnect(server);

onInvite(server, origin, channel);

onJoin(server, origin, channel);

onKick(server, origin, channel, target, reason);

onLoad();

onMe(server, origin, channel, message);

onMessage(server, origin, channel, message);

onMode(server, origin, channel, mode, args);

onNames(server, channel, list);

onNick(server, origin, nickname);

onNotice(server, origin, notice);

onPart(server, origin, channel, reason);

onReload();

onTopic(server, origin, channel, topic);

onUnload();

onWhois(server, info);

DESCRIPTION

This documentation shows the API reference for the official irccd Javascript API.

Any function that is indicated as optional in square brackets means it may not exist on your platform. A quick check in Javascript will let you test its presence.

An example of plugin can be found at /usr/share/doc/irccd/sample-plugin.js

INFO

The global info object in the plugin can contain the following strings which identifies the plugin information:

license

Plugin license.

version

Arbitraty version.

author

Author.

summary

A short description about the plugin.

EVENTS

The following is a list of events that Javascript plugins support. All functions are completely optional and may be omitted. If you want to support a function just implement it as global Javascript function.

onCommand

Special commands are not real IRC events. They are called from channel messages with a specific syntax using a delimiter and the plugin name.

For instance, with default irccd parameters, saying on a channel !ask foo will call the special command of the plugin named ask.

Arguments

server (Server)

The current server.

origin (string)

Who invoked the command.

channel (string)

The channel where the message comes from.

message (string)

The real message, without the ! part.

onConnect

This callback is called when the irccd instance successfully connect to a server.

Arguments

server (Server)

The current server.

onDisconnect

This callback is called when a server has been disconnected by any way.

Arguments

server (Server)

The current server.

onInvite

This event is called when someone is inviting you to a channel.

Arguments

server (Server)

The current server.

origin (string)

Who invited you.

channel (string)

On which channel you are invited to.

onJoin

User join events, this function is called when someone joins a channel.

Arguments

server (Server)

The current server.

origin (string)

The person who joined the channel.

channel (string)

The channel the user has joined.

onKick

This event is triggered when someone has been kicked from a channel.

Arguments

server (Server)

The current server.

origin (string)

Who kicked the person.

channel (string)

The channel.

target (string)

The kicked person.

reason (string)

An optional reason.

onLoad

This function is called when irccd instance load a plugin. If this function throws an error, the script is not loaded.

onMe

Action emote.

Arguments

server (Server)

The current server.

origin (string)

The person who said something.

channel (string)

The channel.

message (string)

The message sent.

onMessage

This event is triggered when someone said something on a specific channel.

Arguments

server (Server)

The current server.

origin (string)

The person who said something.

channel (string)

The channel.

message (string)

The message sent.

onMode

This event is triggered when the server changed a channel mode or your mode.

Arguments

server (Server)

The current server.

origin (string)

The person who changed the mode.

mode (string)

The new mode.

args (array)

List of mode arguments as strings.

onNames

This event is triggered when a list of names has come.

Arguments

server (Server)

The current server.

channel (string)

Which channel.

list (string)

A sequence with all users.

onNick

This event is triggered when someone changed its nickname.

Arguments

server (Server)

The current server.

origin (string)

The old nickname.

nickname (string)

The new nickname.

onNotice

This event is triggered when someone sent a notice to you.

Arguments

server (Server)

The current server.

origin (string)

The one who sent the notice.

message (string)

The notice message.

onPart

This event is triggered when someone has left a specific channel.

Arguments

server (Server)

The current server.

origin (string)

The person who left the channel.

channel (string)

The channel.

reason (string)

An optional reason.

onReload

Request to reload the plugin.

This function does nothing in the irccd internals, it just calls a function that you can use to reload some data.

onTopic

This event is triggered when someone changed the channel’s topic.

Arguments

server (Server)

The current server.

origin (string)

The person who changed the topic.

channel (string)

The channel.

topic (string)

The new topic (may be empty).

onUnload

This event is triggered when the plugin is about to be unloaded.

onWhois

This event is triggered when irccd gets information about a user.

Arguments

server (Server)

The current server.

info (Object)

The whois information.

The info is an object with the following properties:

nickname (string)

The user nickname.

user (string)

The user name.

host (string)

The hostname.

realname (string)

The real name used.

channels (array)

An optional list of channels joined by the user. Objects in the array are defined using the following properties:

name (string)

The name of the channel.

modes (int)

A bitwise mask of modes applied the user has on this channel.

MODULES

The following modules are part of the official Javascript API. They are all accessible as global function, variables and objects.

All modules are categorized into pseudo namespaces that are placed into the global Irccd object. (e.g. Irccd.Directory, Irccd.File). See dedicated manual pages for information of all submodules.

CONSTANTS

The following constants properties are defined:

Irccd.Version (object)

See below.

Irccd.Version.Major (int)

The major irccd version.

Irccd.Version.Minor (int)

The minor irccd version.

Irccd.Version.Patch (int)

The patch irccd version.

EXCEPTIONS

The following exceptions are defined:

Irccd.SystemError

An exception inheriting Error thrown by some filesystem functions.

SEE ALSO

irccd(1) irccd-api-chrono(3), irccd-api-directory(3), irccd-api-file(3), irccd-api-hook(3), irccd-api-logger(3), irccd-api-plugin(3), irccd-api-rule(3), irccd-api-server(3), irccd-api-system(3), irccd-api-timer(3), irccd-api-unicode(3), irccd-api-util(3)

AUTHORS

The irccd daemon was written by David Demelier <markand@malikania.fr>.

macOS 13.5 - February 3, 2022