1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-26 19:24:42 +01:00
This commit is contained in:
Daniil Gentili 2023-12-03 13:26:18 +01:00
parent dd9e443baa
commit f5c22300c6
4 changed files with 8 additions and 8 deletions

2
docs

@ -1 +1 @@
Subproject commit bf3c9a39fd1d7ee6d7497109e7ee4d6666b87d42
Subproject commit b5aa55944beab3de3384a300fdcc5c629557fd83

View File

@ -36,7 +36,7 @@ if (file_exists('vendor/autoload.php')) {
/**
* Event handler class.
*/
class MyEventHandler extends EventHandler
class CombinedEventHandler extends EventHandler
{
/**
* @var int|string Username or ID of bot admin
@ -75,8 +75,8 @@ class MyEventHandler extends EventHandler
}
$MadelineProtos = [];
foreach (['session1.madeline', 'session2.madeline', 'session3.madeline'] as $session => $message) {
foreach (['session1.madeline', 'session2.madeline', 'session3.madeline'] as $session) {
$MadelineProtos []= new API($session);
}
API::startAndLoopMulti($MadelineProtos, MyEventHandler::class);
API::startAndLoopMulti($MadelineProtos, CombinedEventHandler::class);

View File

@ -24,7 +24,7 @@ if (class_exists(API::class)) {
require_once 'madeline.php';
}
class MyEventHandler extends SimpleEventHandler
class LibtgvoipEventHandler extends SimpleEventHandler
{
// !!! Change this to your username! !!!
private const ADMIN = 'danogentili';
@ -70,4 +70,4 @@ if (!getenv('TOKEN')) {
throw new AssertionError("You must define a TOKEN environment variable with the token of the bot!");
}
MyEventHandler::startAndLoopBot($argv[1] ?? 'libtgvoipbot.madeline', getenv('TOKEN'));
LibtgvoipEventHandler::startAndLoopBot($argv[1] ?? 'libtgvoipbot.madeline', getenv('TOKEN'));

View File

@ -24,7 +24,7 @@ if (file_exists('vendor/autoload.php')) {
require_once 'madeline.php';
}
class MyEventHandler extends SimpleEventHandler
class BasicEventHandler extends SimpleEventHandler
{
// !!! Change this to your username !!!
public const ADMIN = "@me";
@ -66,4 +66,4 @@ class MyEventHandler extends SimpleEventHandler
}
}
MyEventHandler::startAndLoop('bot.madeline');
BasicEventHandler::startAndLoop('bot.madeline');