Raspberry PiにHubotをインストールしてWebカメラの画像をslack上に表示するシステムを構築中です。
現状としてはslackとhubotとの接続が完了しており、
slack上でbotにチャットでcameraと入力すると"今撮っているから待ってね"と表示されるのですが、その後に肝心な写真が送られてきません。
以下coffee言語のプログラムになります。
script.coffee
1module.exports = (robot) -> 2 robot.respond /camera/, (msg) -> 3 @exec = require('child_process').exec 4 command = "fswebcam /home/pi/mybot/scripts/sample.jpg; 5 curl -F file=@/home/pi/mybot/scripts/sample.jpg -F channels=CBVxxxx -F token=xxxxxx https://slack.com/api/files.upload" 6 #msg.send "Command: #{command}" 7 msg.send "今撮っているから待ってね" 8 @exec command, (error, stdout, stderr) -> 9 @msg.send error if error? 10 #msg.send stdout if stdout? 11 #@msg.send stderr if stderr?
"今撮っているから待ってね"という返事が帰ってくるのでプログラムは動いていると思いますが、画像が送られてこない理由が分かりましたら教えていただけないでしょうか。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。