Home » Docs » Server »
 

pipe.sendRaw

(since 1.0)



Send a custom RAW on the pipe

Description


string pipe.sendRaw ( string name, object data, [object options] )

Used to send a custom RAW on the pipe.

Does not work with custom pipes.

Parameters


name
The raw's name

data
An object that will be JSON encoded and sent with the raw.

options
Options, here is a list:
  • from - (pipe) An user pipe or a custom pipe that will be added in the from field, if an user pipe, the raw will not be sent to this user.
  • restrict - (user|subuser) A user (if sending to a channel), or a subuser (if sending to n user) which will not receive the raw.

Examples


Basic
pipe.sendRaw("CUSTOM_RAW", {"foo":"bar"});
 
//This will send this raw: {"time":"1255281320","raw":"CUSTOM_RAW","data":{"foo":"bar"}}

Send a raw to an user
Ape.registerCmd("foocmd", true, function(params, info) {
	Ape.log("The user ip : ("+infos.ip+"), foo : " + params.foo);
	info.user.pipe.sendRaw("CUSTOM_RAW", {"foo":"bar"});
});

Send a raw to a pipe
Ape.registerCmd("foocmd", true, function(params, info) {
	Ape.log("The user ip : ("+info.ip+"), foo : " + params.foo);
	Ape.getPipe(params.pubid).sendRaw("CUSTOM_RAW", {"foo":"bar"});
});

User notes


# No comment

Post a note


User notes may be edited or deleted, and usually a note is deleted because of the following reasons:
  • Bugs: Instead report a bug
  • Missing documentation: report that as a bug.
  • Support questions: See the community for available options.

In other words, do not ask questions within the user notes.

Note <b>,<u>,<i> HTML tags are allowed in the posts and the note formatting is preserved. URLs will be turned into clickable links, JavaScipt and C code blocks enclosed in the <source="javascript">JS Code</source> and <source="c">C Code</source> tags will be source highlighted automatically.