ircjs
v1.1.10
Published
ircJS is a class designed to make it easier to connect and utilise IRC with Javascript
Downloads
9
Readme
Table of Contents
ircJS
Extends EventEmitter3
Extendable base class for ircJS classes
Parameters
hostname
string Hostname to connect to (optional, default'irc.irc7.com'
)port
number Server port to connect to (optional, default6667
)useTLS
boolean? Describes if SSL/TLS encryption should be used (optional, defaultfalse
)
Meta
- author: Joshua Davison <[email protected]>
client
The client object object contains multiple properties about the connection
Alias: ircJS.c
Type: Object
Properties
away
boolean Returns the valuetrue
orfalse
depending on whether you are marked as away or not.me
string Returns your current nickname.port
number Returns the port specified in the constructor whether you are connected to the server or not.realName
string Returns the connection's 'realname'. in the constructor whether you are connected or not.server
string Returns the name of the server to which you are currently connected.serverTarget
string Returns the address specified in the constructor whether you are connected to the server or not.ssl
boolean Returnstrue
if TLS/SSL was requesteduserName
string Returns your current username
event
The events object contains multiple properties that are useful for dealing with the handling of events.
Alias: ircJS.e
Type: Object
Properties
address
string Returns the address of the user associated with an event in the form user@host.chann
string Returns the name of the channel for a specific event. For all non-channel events chan will be$null
.event
string Returns the name of the event that was triggered.fulladdress
string Returns the full address of the user triggering an event in the form nick!user@host.nick
string Returns the nickname of the user associated with an event.numeric
string Returns the nickname of the user associated with an event.rawMsg
string Returns raw server line for server events.site
string Returns the portion of $address after the @ for the user associated with an event in the form user@host.target
string Returns the target of an event.
connect
Connect the ircJS to the host specified in construction
Parameters
callback
Function? An optional callback for when the client has successfully connected.
Returns object Instance of ircJS
parsePrefix
Converts a string representation of an IRC server/user (prefix) into a javascript object.
Parameters
prefix
string
Returns IRCPrefix
send
Used to send an unterminated string to the IRC server.
Parameters
data
String? Data to be send to server (optional, default''
)
Returns object Current instance of ircJS
IRCPrefix
An object containing information extracted from an IRC prefix
Type: Object
Parameters
target
text
Properties