Files
tg-bot/src/entryPoint.php

35 lines
684 B
PHP

<?php
// Placeholder Globals
//$userid = 0;
//$room_lang = "th";
//$is_admin = false;
define("BLUE_ROOM", 12345);
define("RED_ROOM", 67890);
define("INTER_ROOM", 111213);
// randomorg($start,$end);
// Placeholder
function randomorg(int $min, int $max) {
return random_int ($min, $max);
}
require_once 'MessageHandler.php';
require_once 'Handlers.php';
$handlers = array(
new BeatHandler()
);
function reply_user(int $room_id, int $msgid, string $message, $room_lang): bool
{
global $handlers;
foreach ($handlers as $handler) {
if($handler->TryHandle($room_id, $msgid, $message, $room_lang)) {
return true;
}
}
return false;
}