示例#1
0
文件: run.php 项目: rudestan/teebot
<?php

/**
 * Teebot console listener. Through this script Teebot will be started as demon and will continuously
 * request an updates from Telegram's servers.
 *
 * @author Stan Drozdov <*****@*****.**>
 */
define('ROOT_DIR', realpath(__DIR__));
$paths = [ROOT_DIR . '/vendor/autoload.php', ROOT_DIR . '/../../autoload.php'];
foreach ($paths as $path) {
    if (file_exists($path)) {
        require_once $path;
    }
}
$client = new Teebot\Client();
$client->listen();
示例#2
0
文件: hook.php 项目: rudestan/teebot
<?php

/**
 * An example of how to run Teebot in webhook mode.
 *
 * @author Stan Drozdov <*****@*****.**>
 */
require_once realpath(__DIR__) . '/vendor/autoload.php';
$client = new \Teebot\Client(['n' => 'Example']);
$response = $client->webhook();