2017 © Pedro Peláez
 

library botman-chatwork

BotMan driver for ChatWork

image

revolution/botman-chatwork

BotMan driver for ChatWork

  • Thursday, December 21, 2017
  • by revolution
  • Repository
  • 1 Watchers
  • 3 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

BotMan driver for ChatWork

ChatWork用のBotManドライバー。
https://go.chatwork.com/
https://botman.io/, (*1)

Requirements

  • PHP >= 7.1
  • Laravel >= 5.5

Demo

  • https://www.chatwork.com/g/botman
  • https://github.com/kawax/botman-chatwork-project
  • ~~https://botman.kawax.biz/~~

Installation

BotMan Studio

Create new project by BotMan Studio
https://botman.io/2.0/botman-studio
https://github.com/botman/studio, (*2)

Composer

composer require revolution/botman-chatwork

config/botman/chatwork.php

php artisan vendor:publish --provider="Revolution\BotMan\Drivers\ChatWork\Providers\ChatWorkDriverServiceProvider"

.env

CHATWORK_API_TOKEN=
CHATWORK_WEBHOOK_ROOM_TOKEN=
CHATWORK_WEBHOOK_ACCOUNT_TOKEN=

app/Providers/BotMan/DriverServiceProvider.php

Set ChatWorkRoomDriver or ChatWorkAccountDriver or both.
ここで設定したドライバーが有効化される。, (*3)

<?php

namespace App\Providers\BotMan;

use BotMan\BotMan\Drivers\DriverManager;
use BotMan\Studio\Providers\DriverServiceProvider as ServiceProvider;

use Revolution\BotMan\Drivers\ChatWork\ChatWorkRoomDriver;
use Revolution\BotMan\Drivers\ChatWork\ChatWorkAccountDriver;

class DriverServiceProvider extends ServiceProvider
{
    /**
     * The drivers that should be loaded to
     * use with BotMan
     *
     * @var array
     */
    protected $drivers = [
        //        ChatWorkRoomDriver::class,
        ChatWorkAccountDriver::class,
    ];

    /**
     * @return void
     */
    public function boot()
    {
        parent::boot();

        foreach ($this->drivers as $driver) {
            DriverManager::loadDriver($driver);
        }
    }
}

Webhook

アカウントイベントルームイベント 用にWebhookを2つ作成する。
https://www.chatwork.com/service/packages/chatwork/subpackages/api/token.php, (*4)

  • アカウントイベントは ご自身へのメンション をチェック。
  • ルームイベントは メッセージ作成 をチェック。更新は非対応。ルームIDも入力。

どちらもトークンを .env で設定。, (*5)

APIトークン

メッセージの投稿に必要なAPIトークン。 https://www.chatwork.com/service/packages/chatwork/subpackages/api/token.php, (*6)

Use another API Token

$botman->hears('Hi', function ($bot) {
    $bot->reply('Hello!', ['api_token' => '...']);
});
$botman->say('say()', 'Room ID', ChatWorkAccountDriver::class, ['api_token' => '...']);

Supported Features

Basic hears-reply only., (*7)

LICENSE

MIT
Copyright kawax, (*8)

The Versions

21/12 2017

dev-master

9999999-dev

BotMan driver for ChatWork

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel chatwork botman

21/12 2017

1.0.2

1.0.2.0

BotMan driver for ChatWork

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel chatwork botman

19/12 2017

1.0.1

1.0.1.0

BotMan driver for ChatWork

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel chatwork botman

18/12 2017

1.0.0

1.0.0.0

BotMan driver for ChatWork

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel chatwork botman

18/12 2017

0.0.5

0.0.5.0

BotMan driver for ChatWork

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel chatwork botman

18/12 2017

0.0.4

0.0.4.0

BotMan driver for ChatWork

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel chatwork botman

18/12 2017

0.0.3

0.0.3.0

BotMan driver for ChatWork

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel chatwork botman

18/12 2017

0.0.2

0.0.2.0

BotMan driver for ChatWork

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel chatwork botman

18/12 2017

0.0.1

0.0.1.0

BotMan driver for ChatWork

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel chatwork botman