This commit is contained in:
2023-10-22 14:09:08 +02:00
parent ce86994af0
commit 5e86865841
2 changed files with 32 additions and 21 deletions

View File

@@ -256,24 +256,3 @@ class MatrixRoom
}
}
}
$cb = function($event)
{
if ($event->event_type == "m.room.message") {
var_dump($event);
if ($event->content["body"] && $event->content["body"][0] === "!") {
$command_parts = explode(" ", $event->content["body"], 2);
$command = $command_parts[0];
$arg = isset($command_parts[1]) ? $command_parts[1] : "";
switch($command) {
case "!echo":
$event->room->send_text($arg);
break;
case "!help":
$event->room->send_text("Usage: !COMMAND ARG1 ARG2...\n!echo TEXT => repeat TEXT");
break;
}
}
}
};