How to attach files to ruby hipchat messages?

徘徊边缘 提交于 2020-01-05 03:44:19

问题


I want to send text files through hipchat using the ruby hipchat-rb gem. There doesn't seem to be a way to do this described in the readme of this gem. Is it possible to do this?


回答1:


the working solution:

#!/usr/bin/env ruby
require 'hipchat'

client = HipChat::Client.new('HIPCHAT_TOKEN', :api_version => 'v2', :server_url => 'HIPCHAT_URL')
client.user('some_username').send_file('message', File.open('some-file.txt') )


来源:https://stackoverflow.com/questions/41271497/how-to-attach-files-to-ruby-hipchat-messages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!