summaryrefslogtreecommitdiffstats
path: root/appinfo
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-08-07 14:39:28 +0200
committerJoas Schilling <coding@schilljs.com>2023-08-07 14:52:30 +0200
commitd80c30beb67983192627a7b37898c99810780f3b (patch)
treeff6e48dbb59051be49e1931827dd28abf69f15a4 /appinfo
parent221e889cc27dbb404868e4c6845fb9c0a249d826 (diff)
feat(bot): Allow reactions by bots
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'appinfo')
-rw-r--r--appinfo/routes/routesBotController.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/appinfo/routes/routesBotController.php b/appinfo/routes/routesBotController.php
index f61d6aa1f..90910d2a3 100644
--- a/appinfo/routes/routesBotController.php
+++ b/appinfo/routes/routesBotController.php
@@ -28,6 +28,12 @@ $requirements = [
'token' => '[a-z0-9]{4,30}',
];
+$requirementsWithMessageId = [
+ 'apiVersion' => 'v1',
+ 'token' => '[a-z0-9]{4,30}',
+ 'messageId' => '[0-9]+',
+];
+
$requirementsWithBotId = [
'apiVersion' => 'v1',
'token' => '[a-z0-9]{4,30}',
@@ -38,6 +44,10 @@ return [
'ocs' => [
/** @see \OCA\Talk\Controller\BotController::sendMessage() */
['name' => 'Bot#sendMessage', 'url' => '/api/{apiVersion}/bot/{token}/message', 'verb' => 'POST', 'requirements' => $requirements],
+ /** @see \OCA\Talk\Controller\BotController::react() */
+ ['name' => 'Bot#react', 'url' => '/api/{apiVersion}/bot/{token}/reaction/{messageId}', 'verb' => 'POST', 'requirements' => $requirementsWithMessageId],
+ /** @see \OCA\Talk\Controller\BotController::deleteReaction() */
+ ['name' => 'Bot#deleteReaction', 'url' => '/api/{apiVersion}/bot/{token}/reaction/{messageId}', 'verb' => 'DELETE', 'requirements' => $requirementsWithMessageId],
/** @see \OCA\Talk\Controller\BotController::listBots() */
['name' => 'Bot#listBots', 'url' => '/api/{apiVersion}/bot/{token}', 'verb' => 'GET', 'requirements' => $requirements],
/** @see \OCA\Talk\Controller\BotController::enableBot() */