Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time related to me #12

Open
RandyTobias opened this issue Mar 9, 2017 · 9 comments
Open

Time related to me #12

RandyTobias opened this issue Mar 9, 2017 · 9 comments

Comments

@RandyTobias
Copy link

Might be interesting to make Bolts learn timezone, such as with:
@Bolts learn rtobias81_timezone = EST

Then make a revision to time:
@Bolts time
Where it would check if the asking user has a factoid set for _timezone, and if so display the time with the correction for timezone. Just a way to personalize the system a bit.

@xurizaemon
Copy link
Owner

xurizaemon commented Mar 11, 2017

Leaving this one as an exercise for anyone who wants it. A chance to practice storing and retrieving data from robot.brain, and do some time calcs in coffee or javascript.

The local time to yourself should be visible above every message (incl but not only replies from bolts), but this could be more useful for

bolts time for @xurizaemon?

although this would probably be self-defeating, since odds are you're asking bolts the time in order to decide if it's a good time to ping that user ... you don't want the question to ping them in passing 🙀

@xurizaemon
Copy link
Owner

@joemcl suggested in chat that this might be a useful addition to other commands, eg hubot-remindher introduced recently says "I'll remind you at 4PM" but this time is server time and should be relative to user. I wonder if user TZ is available at that point?

@RandyTobias
Copy link
Author

I think we would still need to have @Bolts learn rtobias81_timezone = EST first, but then could use the same code of we abstract it first. Does coffee script support inheritance and OO design? If we can make a class that lists all factoids and parses any match to user_timezone, then it would be easy to make child classes operate off of a "if match found, time offset = whatever. Else offset=0" . Just would need to have, for example, the time function take in the timezone param. I think reminders would be a bit more complicated as they are more functional than this, but I assume that function is already part of hubbot-reminder. I need to learn coffee script.n

@joemcl
Copy link
Collaborator

joemcl commented Mar 11, 2017

How about this? https://www.npmjs.com/package/hubot-timezone
Unclear if
hubot set timezone offset to - Set the default timezone offset, can be hours or minutes
is per user

@xurizaemon
Copy link
Owner

xurizaemon commented Jun 5, 2017

As far as reminders go:

  • If you want to implement reminders in your local timezone, the place to do that is in hubot-remind-her. This script could either get user TZ from some user metadata package or possibly obtain from chat metadata (eg query Mattermost, Slack, Rocket.chat for the user's TZ).
  • If you just want reminders in your timezone without contributing to that project, bolts will accept a TZ argument. (Note the +1 day here though, I didn't explore further.)

image

If you're working on getting such a change into other packages, and are ready to test some fixes/features, hit me up and I'll get bolts to pull your fork of that hubot script until the change is merged upstream.

@xurizaemon
Copy link
Owner

I hear you, & will try to make sure people commenting on this and related repos are made aware of the notifications generated by using your GitHub username here. Sorry for the noise! 😔

@rtobias81
Copy link

Is bolts just complaining about atBolts in github comments, or is bolts also being spammed, due to mentions, in MM when people issue commands?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@xurizaemon @RandyTobias @joemcl @rtobias81 and others