IRCClientNode๏
Node wrapper for IRC client with automatic polling.
Description๏
A Node-based IRC (Internet Relay Chat) client that automatically polls for messages in the _process() method. This is the recommended way to use the IRC client module as it handles polling automatically when added to the scene tree.
Supports full IRC protocol (RFC 1459, RFC 2812), IRCv3 extensions, SSL/TLS connections, and DCC file transfers.
extends Node
var irc: IRCClientNode
func _ready():
irc = IRCClientNode.new()
add_child(irc)
irc.connected.connect(_on_connected)
irc.privmsg.connect(_on_message)
irc.connect_to_server("irc.libera.chat", 6667, false, "MyNick", "myuser", "Real Name")
func _on_connected():
print("Connected!")
irc.join_channel("#blazium")
func _on_message(sender, target, text, tags):
print("[%s] <%s> %s" % [target, sender, text])
Methods๏
Signals๏
account_registration_failed(reason: String) ๐
Emitted when account registration fails. reason contains the failure reason.
account_registration_success(account: String) ๐
Emitted when account registration succeeds (IRCv3 draft/account-registration). account is the registered account name.
account_verification_failed(reason: String) ๐
Emitted when account verification fails. reason contains the failure reason.
account_verification_required(account: String, method: String) ๐
Emitted when account registration requires verification (email, etc.). account is the account name, method describes verification method.
account_verification_success(account: String) ๐
Emitted when account verification succeeds. account is the verified account name.
batch_ended(ref_tag: String, batch_type: String, messages: Array) ๐
Emitted when IRCv3 BATCH ends. ref_tag is the batch ID, batch_type is the type, messages contains accumulated messages.
batch_started(ref_tag: String, batch_type: String, params: PackedStringArray) ๐
Emitted when IRCv3 BATCH starts. ref_tag is the batch ID, batch_type is the type, params are batch parameters.
capability_acknowledged(capability: String) ๐
Emitted when server acknowledges a requested capability (CAP ACK). capability is the enabled capability.
capability_denied(capability: String) ๐
Emitted when server denies a requested capability (CAP NAK). capability is the denied capability.
capability_list(capabilities: PackedStringArray) ๐
Emitted when server sends CAP LS response. capabilities contains array of available IRCv3 capabilities.
connected() ๐
Emitted when successfully connected and registered with the server.
connection_error(error: String) ๐
Emitted when connection error.
ctcp_received(sender: String, command: String, params: String) ๐
Emitted when ctcp received.
ctcp_reply(sender: String, command: String, params: String) ๐
Emitted when ctcp reply.
dcc_completed(transfer_index: int) ๐
Emitted when a DCC transfer completes successfully. transfer_index identifies the transfer.
dcc_failed(transfer_index: int, error: String) ๐
Emitted when a DCC transfer fails. transfer_index identifies the transfer, error contains error description.
dcc_progress(transfer_index: int, bytes: int, total: int) ๐
Emitted during DCC transfer with progress. transfer_index identifies the transfer, bytes is transferred, total is file size.
dcc_request(transfer: IRCDCCTransfer) ๐
Emitted when receiving a DCC transfer request. transfer is an IRCDCCTransfer object. Accept with accept_dcc_transfer().
disconnected(reason: String) ๐
Emitted when disconnected from the server. reason contains the disconnect reason.
highlighted(channel: String, sender: String, message: String, tags: Dictionary) ๐
Emitted directly when the sequence identifies an inclusion of the user's nickname wrapped securely in an external message from a known sender inside a specific channel.
Emitted when you successfully join a channel.
kicked(channel: String, kicker: String, reason: String) ๐
Emitted securely when the client is forcefully disconnected from a target channel by an external kicker providing an underlying operational reason.
latency_measured(latency_ms: int) ๐
Emitted accurately tracking internal engine millisecond fluctuations across ping requests sequentially against a target network pipeline natively via latency_ms.
message_received(message: IRCMessage) ๐
Emitted whenever the core socket pipeline finishes decrypting an unformatted network object successfully against an external IRCMessage structural payload wrapper.
mode_changed(target: String, modes: String, params: PackedStringArray) ๐
Emitted when channel or user modes change. target is the channel/user, modes is the mode string, params are mode parameters.
nick_changed(old_nick: String, new_nick: String) ๐
Emitted when a user (including yourself) changes nickname.
notice(sender: String, target: String, text: String) ๐
Emitted natively whenever a NOTICE directive reaches the stream wrapper bypassing active automation processing elements over a specific target.
numeric_001_welcome(message: String) ๐
Emitted when the welcome message (001) is received, indicating successful registration.
numeric_005_isupport(features: Dictionary) ๐
Emitted when numeric 005 isupport.
numeric_332_topic(channel: String, topic: String) ๐
Emitted when receiving channel topic (RPL_TOPIC, 332). channel is the channel, topic is the topic text.
numeric_353_names(channel: String, names: PackedStringArray) ๐
Emitted when receiving channel names list (RPL_NAMREPLY, 353). channel is the channel, names are the users.
numeric_366_endofnames(channel: String) ๐
Emitted when channel names list is complete (RPL_ENDOFNAMES, 366). channel is the channel name.
numeric_372_motd(line: String) ๐
Emitted for each line of server MOTD (RPL_MOTD, 372). line contains the MOTD line text.
numeric_433_nicknameinuse(nick: String) ๐
Emitted when the chosen nickname is already in use. You should choose a different nick.
numeric_730_mononline(nicks: PackedStringArray) ๐
Emitted when monitored nicks come online (RPL_MONONLINE, 730, IRCv3.3). nicks contains array of nicks.
numeric_731_monoffline(nicks: PackedStringArray) ๐
Emitted when monitored nicks go offline (RPL_MONOFFLINE, 731, IRCv3.3). nicks contains array of nicks.
numeric_received(code: int, params: PackedStringArray) ๐
Emitted for any numeric reply not otherwise handled specifically. code is the numeric code, params are parameters.
parted(channel: String, message: String) ๐
Emitted successfully following a channel disconnection event natively over an available localized channel namespace string hook wrapper.
privmsg(sender: String, target: String, text: String, tags: Dictionary) ๐
Emitted when a message is received. sender is the nickname, target is the channel or your nickname, text is the message content, and tags contains IRCv3 message tags.
sasl_failed(reason: String) ๐
Emitted cleanly if an internal SASL credential wrapper triggers a denial response directly from an IRCv3 authentication pipeline block.
sasl_success() ๐
Emitted immediately upon successfully negotiating a valid cryptographic credential wrapper dynamically against an IRC authentication service.
standard_reply_fail(command: String, code: String, context: String, description: String, tags: Dictionary) ๐
Emitted for IRCv3.4 FAIL command (structured error). command is the failed command, code is error code, context and description provide details.
standard_reply_note(command: String, code: String, context: String, description: String, tags: Dictionary) ๐
Emitted for IRCv3.4 NOTE command (structured notice). command is the command, code is notice code.
standard_reply_warn(command: String, code: String, context: String, description: String, tags: Dictionary) ๐
Emitted for IRCv3.4 WARN command (structured warning). command is the command, code is warning code.
status_changed(status: int) ๐
Emitted when connection status changes. status is the new Status value.
tag_base64_data(key: String, encoded: String, decoded: String) ๐
Emitted when an IRCv3 tag contains base64 data. key is the tag name, encoded is original, decoded is decoded string.
tag_json_data(key: String, data: Dictionary) ๐
Emitted when an IRCv3 tag contains base64-encoded JSON data (automatically decoded). key is the tag name, data is the parsed Dictionary.
topic_changed(channel: String, topic: String, setter: String) ๐
Emitted when channel topic changes. channel is the channel name, topic is the new topic, setter is who set it.
user_joined(channel: String, user: String, account: String, realname: String) ๐
Emitted when another user joins a channel. account and realname are only available with IRCv3 extended-join capability.
user_kicked(channel: String, kicker: String, kicked: String, reason: String) ๐
Emitted when a secondary standard user is forcefully unlinked from a shared channel network space by a secondary kicker client.
user_parted(channel: String, user: String, message: String) ๐
Emitted smoothly when a standard client node cleanly disassociates from a loaded connection sequence naturally over an active channel.
user_quit(user: String, message: String) ๐
Emitted when user quit.
Method Descriptions๏
void accept_dcc_transfer(transfer_index: int) ๐
Accepts an incoming DCC file transfer by index from get_active_transfers(). transfer_index - Transfer index.
void cancel_dcc_transfer(transfer_index: int) ๐
Cancels an active DCC transfer by index. transfer_index - Transfer index.
void clear_dcc_local_ip() ๐
Clears manual DCC IP configuration, reverting to automatic detection.
void clear_message_history() ๐
Clears all stored message history.
Error connect_to_server(host: String, port: int, use_ssl: bool, nick: String, username: String, realname: String, password: String = "") ๐
Connects to an IRC server. Returns @GlobalScope.OK on success.
host is the server hostname or IP address.
port is the server port (typically 6667 for plain, 6697 for SSL).
use_ssl enables SSL/TLS encryption (requires mbedtls module).
nick is the nickname to use.
username is the username for the connection.
realname is the real name or description.
password is optional server password (not NickServ).
$IRCClientNode.connect_to_server("irc.libera.chat", 6697, true, "BlazeBot", "bot", "Blazium Test Bot")
void disable_sasl() ๐
Disables SASL authentication.
void disconnect_from_server(quit_message: String = "") ๐
Disconnects from the IRC server with an optional quit message.
void enable_sasl(username: String, password: String) ๐
Enables SASL authentication with the given username and password. Must be called before connect_to_server().
Array[IRCDCCTransfer] get_active_transfers() const ๐
Returns array of all active IRCDCCTransfer objects.
bool get_auto_detect_encoding() const ๐
Returns true if automatic encoding detection is enabled.
PackedStringArray get_available_capabilities() const ๐
Returns array of IRCv3 capabilities advertised by server (from CAP LS).
IRCChannel get_channel(channel: String) const ๐
Returns IRCChannel object for the specified channel, or null if not joined. channel - Channel.
Returns the underlying IRCClient instance for advanced usage.
String get_current_nick() const ๐
Returns your current nickname. May differ from requested nick if changed.
String get_dcc_local_ip() const ๐
Returns the configured or auto-detected local IP address for DCC.
PackedStringArray get_enabled_capabilities() const ๐
Returns array of IRCv3 capabilities successfully enabled via CAP ACK.
String get_encoding() const ๐
Returns current character encoding.
bool get_history_enabled() const ๐
Returns true if message history is enabled.
PackedStringArray get_joined_channels() const ๐
Returns array of all channel names you have joined.
int get_max_history_size() const ๐
Returns maximum message history size.
Array get_message_history() const ๐
Returns array of recent messages as Dictionaries containing sender, target, text, and tags.
int get_messages_per_second() const ๐
Returns current flood protection rate limit.
PackedStringArray get_monitored_nicks() const ๐
Returns array of locally tracked monitored nicknames.
int get_ping_timeout() const ๐
Returns PING timeout in milliseconds.
Status get_status() const ๐
Returns the current connection status. See Status.
PackedStringArray get_supported_encodings() const ๐
Returns array of supported character encodings.
TLSOptions get_tls_options() const ๐
Returns the configured TLSOptions for SSL/TLS connections.
int get_token_bucket_size() const ๐
Returns token bucket size (burst capacity for messages).
bool is_debug_enabled() const ๐
There is currently no description for this method. Please help us by contributing one!
bool is_irc_connected() const ๐
Returns true if the client is connected to an IRC server and ready to send/receive messages.
void join_channel(channel: String, key: String = "") ๐
Joins an IRC channel. Optionally provide a key for password-protected channels.
$IRCClientNode.join_channel("#blazium")
void monitor_add(nick: String) ๐
Adds a nickname to MONITOR list for real-time presence tracking (IRCv3.3). Emits numeric_730_mononline or numeric_731_monoffline. nick - Nick.
void monitor_clear() ๐
Clears all monitored nicknames.
void monitor_list() ๐
Requests current MONITOR list from server.
void monitor_remove(nick: String) ๐
Removes a nickname from MONITOR list. nick - Nick.
void monitor_status() ๐
Requests online/offline status for all monitored nicknames.
Dictionary parse_formatting(text: String) ๐
Parses mIRC formatting and returns Dictionary with parsed segments, colors, and styles. text - Text.
void part_channel(channel: String, message: String = "") ๐
Leaves an IRC channel with an optional part message.
$IRCClientNode.part_channel("#blazium", "Goodbye everyone!")
void reject_dcc_transfer(transfer_index: int) ๐
Rejects an incoming DCC file transfer by index. transfer_index - Transfer index.
void request_capability(capability: String) ๐
Requests an IRCv3 capability from the server. Emits capability_acknowledged or capability_denied. capability - Capability.
void send_action(target: String, action: String) ๐
Sends a CTCP ACTION message (like /me in IRC clients).
Example: irc.send_action("#channel", "waves hello")
$IRCClientNode.send_action("#blazium", "waves to the channel")
Error send_dcc_file(nick: String, file_path: String) ๐
Initiates a DCC SEND file transfer. Returns @GlobalScope.OK on success. Emits dcc_request to recipient. nick - Nick. file_path - File path.
void send_notice(target: String, message: String) ๐
Sends a notice to a channel or user. Notices are like messages but should not trigger automatic responses.
$IRCClientNode.send_notice("TargetUser", "This is an automated notice")
void send_privmsg(target: String, message: String) ๐
Sends a message to a channel or user. target can be a channel name (starting with #) or a nickname.
$IRCClientNode.send_privmsg("#blazium", "Hello world!")
void send_raw(message: String) ๐
Sends raw. message - Message.
void send_whois(nick: String) ๐
Sends WHOIS command to query detailed information about a user. Server responds via numeric replies. nick - Nick.
void set_auto_detect_encoding(auto: bool) ๐
Enables/disables automatic encoding detection on received messages. auto - Auto.
void set_dcc_local_ip(ip: String) ๐
Manually sets the local IP address for DCC connections. Auto-detected if not set. ip - Ip.
void set_debug_enabled(enabled: bool) ๐
There is currently no description for this method. Please help us by contributing one!
void set_encoding(encoding: String) ๐
Sets character encoding (UTF-8, ISO-8859-1, CP1252). Default is UTF-8. encoding - Encoding.
void set_history_enabled(enabled: bool) ๐
Enables or disables local message history storage in memory. enabled - Enabled.
void set_max_history_size(size: int) ๐
Sets maximum number of messages to store in history. Older messages are discarded. size - Size.
void set_messages_per_second(rate: int) ๐
Sets maximum IRC messages to send per second for flood protection. Default is usually 2. rate - Rate.
void set_mode(target: String, modes: String, params: PackedStringArray = PackedStringArray()) ๐
Sets IRC modes on a channel or user. modes is the mode string (e.g., "+o"), params are mode parameters.
void set_nick(new_nick: String) ๐
Changes the nickname. May fail if the nick is already in use.
void set_ping_timeout(timeout_ms: int) ๐
Sets the ping timeout. timeout_ms - Timeout ms.
void set_realname(realname: String) ๐
Sets the realname. realname - Realname.
void set_tls_options(options: TLSOptions) ๐
Binds specific TLS handshake parameters and security configurations mapped via options to the underlying StreamPeerTLS authentication module handler.
void set_token_bucket_size(size: int) ๐
Constrains the automated outgoing payload limiter to a sequence maximum governed by size to effectively resolve connection aborts resulting from network spam protocols.
void set_topic(channel: String, topic: String) ๐
Generates and launches a TOPIC adjustment payload mapped accurately against channel dynamically altering the channel's standard display sequence with topic.
$IRCClientNode.set_topic("#blazium", "Welcome to the official Blazium channel!")
String strip_formatting(text: String) ๐
Removes all mIRC color codes and formatting characters from text. Returns plain text. text - Text.