The Public Client API lets you interact with the client
#runAsUser(command: String, targetId: String)
Allows to make the client send a message/run a command.
- IRC command to run, this is in the same format that a client would send to the server (eg: JOIN #test).
- The id of the channel to simulate the command coming from. Replies will go to this channel if appropriate
Allows to create a new channel.
- The id of the channel, defaults to 0.
messages: Array of Msg
- The messages of the channel, defaults to empty array.
- The name of the channel, defaults to empty string.
- The key of the channel, defaults to empty string.
- The topic of the channel, defaults to empty string.
- The type of the channel, defaults to
CHANNEL. Available types:
SPECIAL. Special is used for banlist, invitelist, channellist or ignorelist.
- The state of the channel, defaults to
PARTED, Possible states:
- The first unread message, defaults to 0.
- The number of unread messages, defaults to 0.
- The number of highlights, defaults to 0.
users: Map from String to User
- The users of the channel, key is the lowercase nick, the value is the user object. Defaults to empty map.
#sendToBrowser(event: String, data: Object)
event to the browser client, with
data in the body of the event.
- Name of the event, must be something the browser will recognise.
- Body of the event, can be anything, but will need to be properly interpreted by the client.
Looks up a channel by ID.
- The id of the channel to return.
#sendMessage(text: String, chan: Chan)
Sends a message to this client, displayed in the given channel.
This message will be displayed as a plugin message, the sender will be the name of your plugin (define in your package.json under thelounge.name) and defaults to the package name.
- The content of the message.
- The channel to send this message into.