Last active
September 28, 2017 09:20
-
-
Save takakabe/5e18cc5734422f69b5be3bb0e45766a4 to your computer and use it in GitHub Desktop.
RaspberryPi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (robot) -> | |
robot.respond /写真/, (msg) -> | |
@exec = require('child_process').exec | |
command = "raspistill -vf -hf -o /home/pi/raspberry_bot/scripts/wawawa.jpg; | |
curl -F file=@/home/pi/raspberry_bot/scripts/wawawa.jpg -F channels=C99999999 -F token=xoxb-9999999999999999-XXXXXXXXXXXXXXXXXXXXXXXX https://slack.com/api/files.upload" | |
#msg.send "Command: #{command}" | |
msg.send "しゃしんとってるよ。ちょっとまってね。" | |
@exec command, (error, stdout, stderr) -> | |
@msg.send error if error? | |
#msg.send stdout if stdout? | |
#@msg.send stderr if stderr? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment