lang/php

botman PHP

C/H 2017. 5. 25. 08:30

BotMan is a framework agnostic PHP library that is designed to simplify the task of developing innovative bots for multiple messaging platforms, including Slack, Telegram, Microsoft Bot Framework, Nexmo, HipChat, Facebook Messenger and WeChat.
BotMan은 Slack, Telegram, Microsoft Bot Framework, Nexmo, HipChat, Facebook Messenger 및 WeChat을 비롯한 여러 메시징 플랫폼 용 혁신적인 봇을 개발하는 작업을 단순화하기 위해 설계된 프레임 워크에 무관심한 PHP 라이브러리입니다

composer require mpociot/botman
use Mpociot\BotMan\BotManFactory;
use Mpociot\BotMan\BotMan;

$config = [
    'hipchat_urls' =--> [
        'YOUR-INTEGRATION-URL-1',
        'YOUR-INTEGRATION-URL-2',
    ],
    'nexmo_key' => 'YOUR-NEXMO-APP-KEY',
    'nexmo_secret' => 'YOUR-NEXMO-APP-SECRET',
    'microsoft_bot_handle' => 'YOUR-MICROSOFT-BOT-HANDLE',
    'microsoft_app_id' => 'YOUR-MICROSOFT-APP-ID',
    'microsoft_app_key' => 'YOUR-MICROSOFT-APP-KEY',
    'slack_token' => 'YOUR-SLACK-TOKEN-HERE',
    'telegram_token' => 'YOUR-TELEGRAM-TOKEN-HERE',
    'facebook_token' => 'YOUR-FACEBOOK-TOKEN-HERE',
    'facebook_app_secret' => 'YOUR-FACEBOOK-APP-SECRET-HERE',
    'wechat_app_id' => 'YOUR-WECHAT-APP-ID',
    'wechat_app_key' => 'YOUR-WECHAT-APP-KEY',
];

// create an instance
$botman = BotManFactory::create($config);

// give the bot something to listen for.
$botman->hears('hello', function (BotMan $bot) {
    $bot->reply('Hello yourself.');
});

// start listening
$botman->listen();


반응형

'lang > php' 카테고리의 다른 글

brew php-xdebug  (0) 2017.05.29
Multi-library chart PHP  (0) 2017.05.26
Rinvex Country - PHP  (0) 2017.05.24
Requests for PHP  (0) 2017.05.23
CI 2.6 에서 redis 캐시드라이브  (0) 2017.03.20