That One Guy’s Timezone bot is a bot designed for communities who have members from around the world.
The bot works by having users enter their timezone via a command. This is saved in a database.
There are only certain times when users need to know their chat partner’s time zone. For example, they don’t need to know it when the user is in a very close-by timezone to them. They also usually don’t need to know it when they’re already in conversation with that person, or when they’re not talking directly to that person. With that in mind, I implemented a system that would interject with a user’s timezone ONLY if:
The sender directly messaged the recipient using @ The sender’s timezone is more than 2 hours apart from the targeted recipient The recipient has not sent a message in the last hour The recipient’s timezone has not been announced in the channel in the past hour
A users timezone can also be determined by doing a command.