* @param {String} params Additional paramaters\r
* @param {Function} callback A callback function\r
*/\r
- this.ctcp = function (connection_id, request, type, target, params, callback) {\r
+ this.ctcp = function (connection_id, is_request, type, target, params, callback) {\r
var args = {\r
- request: request,\r
+ is_request: is_request,\r
type: type,\r
target: target,\r
params: params\r
this.rpcCall('irc.ctcp', connection_id, args, callback);\r
};\r
\r
+ this.ctcpRequest = function (connection_id, type, target, params, callback) {\r
+ this.ctcp(connection_id, true, type, target, params, callback);\r
+ };\r
+ this.ctcpResponse = function (connection_id, type, target, params, callback) {\r
+ this.ctcp(connection_id, false, type, target, params, callback);\r
+ };\r
+\r
/**\r
* @param {String} target The target of the message (e.g. a channel or nick)\r
* @param {String} msg The message to send\r
\r
ctcp: function (irc_connection, callback, args) {\r
if ((args.target) && (args.type)) {\r
- if (args.request) {\r
+ if (args.is_request) {\r
irc_connection.write('PRIVMSG ' + args.target + ' :' + String.fromCharCode(1) + args.type.toUpperCase() + ' ' + args.params + String.fromCharCode(1), callback);\r
} else {\r
irc_connection.write('NOTICE ' + args.target + ' :' + String.fromCharCode(1) + args.type.toUpperCase() + ' ' + args.params + String.fromCharCode(1), callback);\r