-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathListener.php
49 lines (43 loc) · 1.13 KB
/
Listener.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* This file is a part of [Telegram] Core.
* All rights reserved.
*
* Developed by SourceModders.
*/
namespace SModders\TelegramCore;
use TelegramBot\Api\Client;
use TelegramBot\Api\Types\Message;
use XF\App;
use XF\Container;
use XF\Mvc\Entity\Manager;
use XF\Mvc\Entity\Structure;
use XF\SubContainer\Import;
class Listener
{
/**
* Called after the global \XF\App object has been setup.
*
* @param App $app
*/
public static function app_setup(App $app)
{
/** @var \XF\Container $container */
$container = $app->container();
// Make Telegram great again!
$container['smodders.telegram'] = function (Container $c) use ($app)
{
$class = $app->extendClass('SModders\TelegramCore\SubContainer\Telegram');
return new $class($c, $app);
};
}
/**
* Called when the BB code renderer map is accessed.
*
* @param array $rendererMap The current renderer map.
*/
public static function bb_code_renderer_map(array &$rendererMap)
{
$rendererMap['smTgCoreMarkdown'] = 'SModders\TelegramCore:Markdown';
}
}