Skype API wrapper class (PHP) を試してみた (3)

Skype/Chat.php

    protected   $property_def_list = array(
	<略>
        // and more...
        'DIALOG_PARTNER' => array(
            'default'   => true,
            'type'      => Skype::property_type_string,
        ),

今度は MYROLL でエラー

% php skype_bot.php
exception 'Exception' with message 'unsupported property [MYROLE]'
in /usr/share/pear/Skype/Object.php:68
Stack trace:
#0 /usr/share/pear/Skype.php(226): Skype_Object->set('MYROLE', 'USER')
#1 /usr/share/pear/Skype.php(139): Skype->handleChat('#yoya_test/$y...')
#2 [internal function]: Skype->callback(Object(dbusmessage))
#3 /usr/share/pear/Skype.php(126): dbusconnection->poll(86400)
#4 /usr/share/pear/Skype/Bot.php(36): Skype->poll(86400)
#5 /home/yoya/lang/php/skype_bot.php(16): Skype_Bot->run()
#6 {main}

ふむ。MYROLL も追加と。

        // and more...
        'DIALOG_PARTNER' => array(
            'default'   => true,
            'type'      => Skype::property_type_string,
        ),
        'MYROLE' => array(
            'default'   => true,
            'type'      => Skype::property_type_string,
        ),
    );

とりあえず、安定して動くようになりました。(*'ω'*)

常駐開始

さて /var/tmp はまずいので、自分の home 以下を指定して常駐開始。

(php skype_bot.php >& ~/log/skype/log.txt ) &
[1]+  Exit 255                ( php skype_bot.php >&~/log/skype/log.txt )

あれれ…
log.txt を読むと、

PHP Fatal error:  Uncaught exception 'Exception' with message 'parameter [dir]
seems to be invalid or not set' in /usr/share/pear/Skype/Bot/Plugin/Log.php:26
Stack trace:
#0 /usr/share/pear/Skype/Bot.php(62): Skype_Bot_Plugin_Log->__construct(
Object(Skype_Bot), Array)
#1 home/yoya/lang/php/skype_bot.php(15): Skype_Bot->loadPlugin('log', Array
)
#2 {main}
  thrown in /usr/share/pear/Skype/Bot/Plugin/Log.php on line 26

うわーぃ。~/log/skype を指定したけど ~ はダメか。

$bot->loadPlugin(
    "log",
    array(
        'dir'               => '~/log/skype',
        'chat_topic_filter' => null,
        'chat_id_filter'    => null,
        ));

/home/yoya/log/skype のように絶対パス指定にしとこう。

        'dir'               => '/home/yoya/log/skype',

常駐成功と♪
さて、特定のキーワードが出たらメールを送るとか出来るといいな。