Warning: session_start(): open(/var/lib/php/sessions/sess_27rfobvbhj2gu6rs2rck034ru7, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
svoid gazelle_mathBot1_handlePost(S _user, S _botToken, Map post) {
Number postID = cast post.get("id");
S text = cast post.get("text");
LS groups = regexpGroupsIC("What is (\\d+)\\s*\\+\\s*(\\d+)", text);
if (empty(groups)) ret;
print("Processing post " + postID + ": " + quote(text));
BigInt result = plus(parseBigInt(first(groups)), parseBigInt(second(groups)));
print("Calculated result: " + result);
print(postJSONPage("https://gazelle.rocks/bot/createPost",
+_user, +_botToken, refs := postID, text := "The result is " + result, type := "Answer", botInfo := "Math bot"));
}