sopel-irc / sopel

:robot::speech_balloon: An easy-to-use and highly extensible IRC Bot framework. Formerly Willie.
https://sopel.chat
Other
949 stars 403 forks source link

General output for everyone should use channel/bot timezone/time-format, not the triggering user's #2324

Open ghost opened 2 years ago

ghost commented 2 years ago

Requested Feature

Sopel should use a channel's timezone and timeformat for general link replies, such as to the Reddit plugin.

Problems Solved

Makes it easier to tell when something was posted. If I post, say, a Reddit link and it shows the time in CDT, that might not be very useful to an Australian or European immediately. Being forced to UTC or some common timezone for easy reference for a channel would be ideal.

Alternatives

Force every user to UTC or something? lol

Notes

I know the title fucking sucks. I'm tired.

EDIT ONE

chatlog ``` [2022-01-05T22:58:18.913Z] seems silly for me to post a reddit link and every gets my timezone against their will lol [2022-01-05T22:58:49.009Z] <+dgw> The silver lining is, every plugin can choose how it picks a timezone [2022-01-05T22:58:51.084Z] <+dgw> and time format [2022-01-05T22:58:58.094Z] <+dgw> because we have functions for those :D [2022-01-05T22:59:35.016Z] <+dgw> or if you're using format_time, just don't pass the nick in [2022-01-05T23:00:58.800Z] <+dgw> Modify this and done. https://github.com/sopel-irc/sopel/blob/d36a19dad548068e34357d63761258cdd5e5efc0/sopel/modules/reddit.py#L64 [2022-01-05T23:00:59.091Z] <+Sopel> [GitHub] [sopel-irc/sopel] sopel/modules/reddit.py @ d36a19dad548068e34357d63761258cdd5e5efc0 | L64:  trigger.nick, trigger.sender, [2022-01-05T23:01:00.373Z] <+Exirel> Yeah, I think a plugin that shows an information not tied to a user (say, a reddit link), should use the channel's timeformat first. [2022-01-05T23:01:09.745Z] ^ [2022-01-05T23:01:11.530Z] concur [2022-01-05T23:01:16.273Z] <+dgw> channel, bot, default (UTC) [2022-01-05T23:01:20.406Z] <+Exirel> :) [2022-01-05T23:01:26.849Z] And obviously, any good person would set their channel to UTC and ISO 8601 [2022-01-05T23:01:28.659Z] ;P [2022-01-05T23:01:31.568Z] <+dgw> But, that's not on Sopel to enforce, so we don't have to change any APIs :D [2022-01-05T23:01:42.509Z] <+Exirel> Which is, by the way, something that can be added to the "about time" documentation! [2022-01-05T23:02:03.874Z] <+dgw> Probably other APIs could use a "best practices" section too, yes [2022-01-05T23:02:39.630Z] <+Exirel> "hear hear, official recommendation by your good grace lord Sopelunker the First" [2022-01-05T23:02:54.934Z] <+dgw> Saint Sopelunker the Chatty [2022-01-05T23:14:43.910Z] <+Exirel> .t [2022-01-05T23:14:44.064Z] <+Sopel> [clock] [01] Thursday, January 06, 00:14:43+0100 (CET) [2022-01-05T23:14:50.578Z] <+Exirel> Talking about time: it's bed time for me. :) [2022-01-05T23:14:55.259Z] <+Exirel> See ya o/ [2022-01-05T23:17:11.773Z] <+dgw> Sleepirel [2022-01-05T23:17:14.474Z] <+dgw> \o ```
RustyBower commented 2 years ago

This was very similar to the work I did to be able to lookup weather per user (.weather RustyCloud) in https://github.com/sopel-irc/sopel-weather/commit/62fb6b6e689ba4c25fd29eb1fa5ca3344ffc747d

ghost commented 2 years ago

Rather, the opposite is desired. We'd want it to lookup the channel-configured timezone, if none, then the bots, if none, then the default (UTC, typically?).