summaryrefslogtreecommitdiff
path: root/docs/RPC
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-03-13 15:11:37 +0000
committerSadie Powell <sadie@witchery.services>2025-03-13 15:12:47 +0000
commitfd6770373f453473293d4b99e847744dad9ec55c (patch)
tree69d9958ee190c94e0ff31d737fb59eec2e6abce2 /docs/RPC
parent645f969d702157a9a5ce864d3a3777f22cedac8d (diff)
Add the rpc_message module, remove the notice RPC event.
Diffstat (limited to 'docs/RPC')
-rw-r--r--docs/RPC/RPC2
-rw-r--r--docs/RPC/jsonrpc.js27
-rw-r--r--docs/RPC/jsonrpc.php2
-rw-r--r--docs/RPC/rpc_message.md67
4 files changed, 95 insertions, 3 deletions
diff --git a/docs/RPC/RPC b/docs/RPC/RPC
index 94c7ba7f7..eee81c632 100644
--- a/docs/RPC/RPC
+++ b/docs/RPC/RPC
@@ -13,8 +13,6 @@ command - Takes three parameters, a service name (BotServ, ChanServ, NickServ),
stats - Takes no parameters, returns miscellaneous stats that can be found in the /operserv stats command.
-notice - Takes three parameters, source user, target user, and message. Sends a message to the user.
-
RPC was designed to be used with db_sql, and will not return any information that can be pulled from the SQL
database, such as accounts and registered channel information. It is instead used for pulling realtime data such
as users and channels currently online. For examples on how to use these calls in PHP, see xmlrpc.php in docs/RPC.
diff --git a/docs/RPC/jsonrpc.js b/docs/RPC/jsonrpc.js
index 29291ad7d..e6cd07e36 100644
--- a/docs/RPC/jsonrpc.js
+++ b/docs/RPC/jsonrpc.js
@@ -119,6 +119,33 @@ class AnopeRPC {
user(nick) {
return this.run("anope.user", nick);
}
+
+ /**
+ * Sends a message to every user on the network.
+ * @param {...*} messages One or more messages to send.
+ */
+ messageNetwork(...messages) {
+ return this.run("anope.messageNetwork", ...messages);
+ }
+
+ /**
+ * Sends a message to every user on the specified server.
+ * @param {string} name The name of the server.
+ * @param {...*} messages One or more messages to send.
+ */
+ messageServer(server, ...messages) {
+ return this.run("anope.messageServer", server, ...messages);
+ }
+
+ /**
+ * Sends a message to the specified user.
+ * @param {string} source The source pseudoclient to send the message from.
+ * @param {string} target The target user to send the message to.
+ * @param {...*} messages One or more messages to send.
+ */
+ messageUser(source, target, ...messages) {
+ return this.run("anope.messageServer", source, target, ...messages);
+ }
}
/*
diff --git a/docs/RPC/jsonrpc.php b/docs/RPC/jsonrpc.php
index a0a6e9270..4e9b52ba9 100644
--- a/docs/RPC/jsonrpc.php
+++ b/docs/RPC/jsonrpc.php
@@ -132,7 +132,7 @@ class AnopeRPC
*/
public function notice($source, $target, $message)
{
- return $this->run("notice", [$source, $target, $message]);
+ return $this->run("anope.messageUser", [$source, $target, $message]);
}
/**
diff --git a/docs/RPC/rpc_message.md b/docs/RPC/rpc_message.md
new file mode 100644
index 000000000..de91767ae
--- /dev/null
+++ b/docs/RPC/rpc_message.md
@@ -0,0 +1,67 @@
+# Anope `rpc_message` RPC interface
+
+## `anope.messageNetwork`
+
+Sends a message to all users on the network.
+
+### Parameters
+
+Index | Description
+----- | -----------
+0+ | One or more messages to send.
+
+### Errors
+
+Code | Description
+------ | -----------
+-32099 | The global service is not available.
+
+### Result
+
+This procedure returns no result.
+
+## `anope.messageServer`
+
+Sends a message to all users on the specified server.
+
+### Parameters
+
+Index | Description
+----- | -----------
+0 | The name of the server to message users on.
+1+ | One or more messages to send.
+
+### Errors
+
+Code | Description
+------ | -----------
+-32099 | The global service is not available.
+-32098 | The specified server does not exist.
+
+### Result
+
+This procedure returns no result.
+
+## `anope.messageUser`
+
+Sends a message to the specified user.
+
+### Parameters
+
+Index | Description
+----- | -----------
+0 | The source pseudoclient to send the message from.
+1 | The target user to send the message to.
+2+ | One or more messages to send.
+
+### Errors
+
+Code | Description
+------ | -----------
+-32099 | The specified source does not exist.
+-32098 | The specified target does not exist.
+
+### Result
+
+This procedure returns no result.
+