summaryrefslogtreecommitdiffstats
path: root/appinfo
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-07-26 18:38:09 +0200
committerJoas Schilling <coding@schilljs.com>2023-08-08 10:46:53 +0200
commit65893d2c4afa6d838d2dc438c7c413d473c0d9ab (patch)
treec75c55be68894824c5eeb1101a6b8692b485d2c5 /appinfo
parent71ee2c8cd08fbeae97d7f9cbff6f0b81636ff663 (diff)
feat(bots): Add API to list, enable and disable bots in a conversation
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'appinfo')
-rw-r--r--appinfo/routes/routesBotController.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/appinfo/routes/routesBotController.php b/appinfo/routes/routesBotController.php
index c8a1d5db1..f61d6aa1f 100644
--- a/appinfo/routes/routesBotController.php
+++ b/appinfo/routes/routesBotController.php
@@ -28,9 +28,21 @@ $requirements = [
'token' => '[a-z0-9]{4,30}',
];
+$requirementsWithBotId = [
+ 'apiVersion' => 'v1',
+ 'token' => '[a-z0-9]{4,30}',
+ 'botId' => '[0-9]+',
+];
+
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::listBots() */
+ ['name' => 'Bot#listBots', 'url' => '/api/{apiVersion}/bot/{token}', 'verb' => 'GET', 'requirements' => $requirements],
+ /** @see \OCA\Talk\Controller\BotController::enableBot() */
+ ['name' => 'Bot#enableBot', 'url' => '/api/{apiVersion}/bot/{token}/{botId}', 'verb' => 'POST', 'requirements' => $requirementsWithBotId],
+ /** @see \OCA\Talk\Controller\BotController::disableBot() */
+ ['name' => 'Bot#disableBot', 'url' => '/api/{apiVersion}/bot/{token}/{botId}', 'verb' => 'DELETE', 'requirements' => $requirementsWithBotId],
],
];