darrenfoley / Asiago

A Discord bot written in C#
GNU General Public License v3.0
1 stars 0 forks source link

Add slash command for generating discord timestamp #1

Closed darrenfoley closed 1 month ago

darrenfoley commented 7 months ago

Discord timestamps offer a great way to communicate dates and times across timezones so that each user can automatically see them in their local timezone.

To send a Discord timestamp, you simply type <t:TIMESTAMP:STYLE>. For example, <t:1701029351:F> in a message and Discord will handle displaying it automatically. You can look at https://discord.com/developers/docs/reference#message-formatting to see the various styles in which timestamps can be shown.

However, the average user might not know how to get a Unix timestamp or remember how to format a Discord timestamp. Thus, it would be helpful to have a slash command to help generate timestamps, which the user can then chose to copy/paste and share wherever.

Ideally, the slash command would have date and time pickers (or some combination picker) and also send information about the user's timezone to the bot so that the datetime could be easily converted to a Unix timestamp in code.

Unfortunately, this was requested of Discord in 2021 and is still not available. See the following:

So, either a creative workaround will be needed or we can wait.

darrenfoley commented 7 months ago

Just a warning that this is actually really difficult to implement both accurately and in a way that is user friendly. I honestly don't think it's worth the effort for the time being and it would be much easier for Discord to just implement a utility for this themselves.