}
-
+ function sendTelegram()
+ {
+ if ($this->ontable != 'mtrack_ticket') {
+ return;
+ }
+
+ static $tg = false;
+ if ($tg === false) {
+ require_once 'Net/Telegram.php';
+ $tg = new Net_Telegram(HTML_FlexyFramework::get()->Pman_Telegram['token']);
+ }
+
+
+ foreach ($this->audit() as $a) {
+ $str[] = $a->toAuditString($this);
+ }
+
+ $tg->factory('SendMessage',array(
+ 'chat_id' => 35721679,
+ 'parse_mode' => 'MarkdownV2',
+ 'text' => "/ticket@{$this->onid} {$this->cgtype} by {$this->person()->name} \n" . implode("\n", $str)
+
+
+ ))->send();
+
+
+ }
}