Action Plugin
This plugin is built-in.
This plugin provides functions to communicate with the server.
All of its export properties are also available as methods on the Client.
Exports
- raw(message...: String)
- Send a raw message to the server. Useful for sending messages that don't have functions defined in this plugin. If there are multiple arguments, they'll be joined together with a space.
- rawf(format: String, args...: String)
- A convenience function for sending a [util formatted string](//nodejs.org/api/util.html#util_util_format_format).
- act(target: Target, action: String | [String])
-
Commit an action to the target. Basically what your client's
/me
does.Example:
client.act("#chan", "plays the ukelele.");
- ctcp(target: Target, tag: CtcpTag, body: undefined | String| [String])
- [Deprecated] Send a CTCP request or response to the target.
- ctcpRequest(target: Target, tag: CtcpTag, body: undefined | String | [String])
- Send a CTCP request to the target.
- ctcpResponse(target: Nickname, type: CtcpTag, body: undefined | String | [String])
- Send a CTCP response to the target.
- join(channel: ChannelName): Promise<JoinResponse>
- Attempt to join channel. Returns a promise of the results, though the actually returned object is unstable.
- join(channel: ChannelName, password: String): Promise<JoinResponse>
- As prior, but sends the password to the channel for channels that have mode +k.
- kick(channel: ChanelName, nick: NickName)
- Attempt to kick user with specified nick from the channel.
- kick(channel: ChannelName, nick: NickName, reason: String)
- As prior, but kicks with the specified reason.
- mode(target: Target, plus: String, minus: String, params: [String])
-
Attempt to change modes on the target.
Ex:
client.mode(client.nickname(), "B", "", [])
- nick(newNick: NickName)
- Attempt to change the bots nickname.
- notice(target: Target, message: String | [String])
- Send a notice to the target.
- part(channel: ChannelName)
- Cause the bot to leave the channel.
- part(channel: ChannelName, reason: String)
- Cause the bot to leave the channel with the specified reason.
- quit()
- Cause the bot to quit.
- quit(reason: String)
-
Cause the bot to quit with the specified reason.
Note: The reason is ignored on many servers if the bot quits within the first minute.
- respond(response, privmsg)
-
Added in Tennu 4.8.0.
Send a response.
The
privmsg
is required because a response uses the details on the privmsg for the target if not given.Note: Every
command
is also aprivmsg
. - say(target: Target, message: String | [String])
- Send a message to the target.
- userhost(user: Nickname)
- Gets the userhost of the user.
- userhost(users: [Nickname])
- Gets the userhosts of the users.
- who(channel: ChannelName)
- Get the
WHO
data of the channel. - whois(user: NickName, undefined, opts: {memoizeOver: Object})
-
Get the
WHOIS
data of the user. Returns aPromise<Result<WhoisResult, WhoisError>>
.You can optionally pass an object with a
memoizeOver
as the third parameter to memoize over this value. If you are doing awhois
in reaction to a private message (including commands), you should memoize over the private message. Otherwise, your bot may whois the same nickname multiple times in quick succession. For a command, you can get the private message withObject.getPrototypeOf(command)
. - whois(users: NickNamesSeparatedByCommas)
- Whois multiple nicknames at the same time. This doesn't return a promise, or allow memoization. If you need either, file an issue or send a PR.