An integration for Slack that converts time string in a message to all timezones (MIT License)

栏目: IT技术 · 发布时间: 5年前

内容简介:An integration for Slack that converts any time string in a message to all timezones where the team is.Just invite the @bot to your channel. Then, any message that mentions @time and contains a time will be converted, for example:

Slack Timezone Converter

An integration for Slack that converts any time string in a message to all timezones where the team is.

An integration for Slack that converts time string in a message to all timezones (MIT License)

Usage

Just invite the @bot to your channel. Then, any message that mentions @time and contains a time will be converted, for example: Let's meet at 8am PDT please @time .

Description

Currently supports any format parsable by ActiveSupport .

Any time a time string is found in a message that mentions @time , the integration, running in a server, converts it to all timezones where the team has at least one member. A message is sent back to the Slack channel with all the conversions and a fancy clock icon that represents the time. It supports any channel joined by the user whose token is passed as parameter. This user's timezone is used as the default when a timezone is not present on the parsed message.

Example message that would be parsed: Hey, our meeting is at 12h30 PDT @time .

Installation

In order to use this integration, the following Ruby libraries are needed:

  • slack-rtmapi
  • active_support
  • json

But they can be installed by using bundle :

bundle install

After all requirements are met, it's just necessary to run the code, passing the Slack token as parameter:

ruby slack-timezone-converter.rb <Slack token> <number of times per line (defaults to 1)> <additional message>

This program runs indefinitely and listens for new messages on the Slack channels. It can be stopped by just stopping the process.

TODO

  • Correctly identify the format where a dot is the separator between hour and minutes (e.g., "8.30am")

References


以上所述就是小编给大家介绍的《An integration for Slack that converts time string in a message to all timezones (MIT License)》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Perl语言入门

Perl语言入门

[美] Randal L.Schwartz、Tom Phoenix / 李晓峰 / 中国电力出版社 / 2002-8 / 48.00元

本书第一版于1993年问世,并从此成为畅销书。本书由Perl社区最著名、最活跃的两位成员写成,是Perl程序设计语言的精髓指南。 Perl最初只是Unix系统管理员的一个工具,在工作日里被用在无数的小任务中。从那以后,它逐步发展成为一种全功能的程序设计语言,特别是在各种计算平台上,它被用作Web编程、数据库处理、XML处理以及系统管理——它能够完成所有这些工作,同时仍然是处理小的日常工作的完......一起来看看 《Perl语言入门》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具