Example #1
0
<?php

use gries\Pokebot\Command\PokemathCommand;
use PhpSlackBot\Bot;
require_once __DIR__ . '/../vendor/autoload.php';
$bot = new Bot();
$bot->setToken('token');
$bot->loadCommand(new PokemathCommand());
$bot->run();
Example #2
0
<?php

namespace Flyingcoder\Bots;

use PhpSlackBot\Bot;
use Flyingcoder\TimeCommand;
/**
* 
*/
// class Oras extends Bot
// {
// }
$bot = new Bot();
$bot->setToken('xoxb-19972036567-itTiAcgQZUDlzkmQ5zdW8c5X');
// Get your token here https://my.slack.com/services/new/bot
$bot->loadCommand(new TimeCommand());
$bot->run();
Example #3
0
                    continue;
                }
                if ($status != $invoices[$i]["status"] && $status != "*") {
                    continue;
                }
                $selected_invoices[] = $invoices[$i];
            }
            if ($current_page < $total_pages) {
                $req_page++;
            } else {
                break;
            }
        } while (1);
        $out_msg = "";
        for ($i = 0; $i < count($selected_invoices); $i++) {
            $out_msg = $out_msg . $selected_invoices[$i]["btc_address"] . " | <" . $selected_invoices[$i]["description"] . "> | *" . $selected_invoices[$i]["status"] . "*\n";
        }
        $out_msg = trim($out_msg);
        if (strlen($out_msg) > 0) {
            $out_msg = "\n" . $out_msg;
        } else {
            $out_msg = "No invoices found, sorry :(";
        }
        $this->send($this->getCurrentChannel(), $this->initiator, $out_msg);
    }
}
$bot = new Bot();
$bot->setToken($bot_token);
// Get your token here https://my.slack.com/services/new/bot
$bot->loadCommand(new BtcCommand());
$bot->run();
Example #4
0
            if ($channel != 'bo-dev') {
                return false;
            }
            $msg = $data['text'];
            if (stristr($msg, 'profit')) {
                $this->send($data['channel'], $username, "I will count profit for the day, later.. maybe tomorrow.");
            }
            if (stristr($msg, 'help')) {
                $this->send($data['channel'], $username, "Don't worry, - I'm not able to help you :))");
            }
            if (stristr($msg, 'че там по звонкам')) {
                $this->send($data['channel'], $username, "Нормально всё, чё");
            }
            if (stristr($msg, 'че там по продажам')) {
                $this->send($data['channel'], $username, "Конверсия гавно, но вроде капает");
            }
            if (stristr($msg, 'че там по продажам')) {
                $this->send($data['channel'], $username, "Конверсия гавно, но вроде капает");
            }
            if (stristr($msg, 'че там по деньгам')) {
                $this->send($data['channel'], $username, "считаем...");
            }
        }
    }
}
$bot = new Bot();
$bot->setToken('xxxxxxxx');
// Get your token here https://my.slack.com/services/new/bot
//$bot->loadCatchAllCommand(new SuperCommand());
$bot->loadCommand(new \PhpSlackBot\Command\WhyCommand());
$bot->run();