18F / charlie

18F's Slack bot, Charlie. Built on Bolt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Time zone conversion

cmc333333 opened this issue · comments

From @tadhg-ohiggins

I was thinking more /tzone I'm setting up a meeting at 14:00 -> `I'm setting up a meeting at 14:00 PST/15:00 MST/16:00 CST/17:00 EST

Slash commands require a different level of integration with Slack than we currently use. Charlie would need to be registered as a Slack app instead of just using an API token. It would also have to respond to external HTTP requests, which is how those slash commands are routed.

Does anyone have ideas for other implementations? We've pulled Moment.js in as a dependency, so figuring all the timezones should be pretty easy, and there's a web API for pulling a user's timezone information from their profile.

So would
@charlie schedule meeting 14:00
be able to pull from the web API and output
@tadhg is setting up a meeting at 14:00 PST/15:00 MST/16:00 CST/17:00 EST?

I believe so. The users.info method returns a timezone name that should be usable as an input. We should be able to get the user ID from the message info when Charlie is triggered.

🤔 It might be possible to have Charlie post ephemeral messages (the "only you can see this" types) to everyone in the channel, translating the time into their local timezone. So maybe Charlie could watch for something like "[tz] 14:00" and then it'd pull your local timezone, get a list of users in the channels, and send everyone an ephemeral message saying something like "that's 16:00 for you in central time" Just a quick mockup:

image