vexus2 / hubot-slack-timeline Goto Github PK
View Code? Open in Web Editor NEWsend all of the messages on Slack in #timeline
License: MIT License
send all of the messages on Slack in #timeline
License: MIT License
hubot-slack v4にアップデートされ
msg.envelope.room
が チャンネル名 ではなく チャンネルID として表示されるようになった
その為hubot-slack-timelineで(at #{チャンネル名})
と表示される部分が(at #{チャンネルID})
として表示されてしまう為、修正が必要だと考えます。
メソッドを利用しIDからチャンネル名に変換することで対応できると考えられます。
request = require 'request'
module.exports = (robot) ->
robot.hear /.*?/i, (msg) ->
channel = msg.envelope.room
+ room_name = robot.adapter.client.rtm.dataStore.getChannelGroupOrDMById(channel).name
...(略)
- request = msg.http("https://slack.com/api/chat.postMessage?token=#{process.env.SLACK_API_TOKEN}&channel=%23#{timeline_channel}&text=#{message}%20(at%20%23#{channel}%20)&username=#{username}&link_names=#{link_names}&pretty=1&icon_url=#{user_image}").get()
+ request = msg.http("https://slack.com/api/chat.postMessage?token=#{process.env.SLACK_API_TOKEN}&channel=%23#{timeline_channel}&text=#{message}%20(at%20%23#{room_name}%20)&username=#{username}&link_names=#{link_names}&pretty=1&icon_url=#{user_image}").get()
request (err, res, body) ->
素晴らしいスクリプトをありがとうございます!
便利なスクリプトで大変助かっております。
ぜひ修正案を参考に修正していただけると幸いです。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.