Skip to content

feat: Discord Timestamps Variable#2060

Merged
ebiggz merged 4 commits intov5from
discord-time-stamps
Feb 5, 2023
Merged

feat: Discord Timestamps Variable#2060
ebiggz merged 4 commits intov5from
discord-time-stamps

Conversation

@itsjesski
Copy link
Copy Markdown
Collaborator

Description of the Change

This adds in a new variable that generates discord timestamps. This is meant to really only ever be used with the "send discord message" effect. This will generate text similar to "<t:1543392060:R>". It supports all of the formats that discord supports. I've also tried to make it flexible as possible so that people can use it to announce stream times and other things.

  • Can exclude the date to use the current date at the specified time.
  • Can use 'now' instead of a time to use the current date and time. This allows people to use the current time in whatever format they want.
  • Can use any discord timestamp format.

https://discord.com/developers/docs/reference#message-formatting-timestamp-styles

Applicable Issues

  • No issues, but it is important to note that discord will change the output format based on if the end user has 12 hour or 24 hour time set. I've tried to include both in the examples. This doesn't change how the user enters time into firebot.

Testing

  • $discordTimestamp[2076-01-26 13:00:00]
  • $discordTimestamp[13:00:00]
  • $discordTimestamp[2076-01-26 13:00:00, R]
  • $discordTimestamp[13:00:00, R]
  • $discordTimestamp[now, R]
  • $discordTimestamp[]
  • $discordTimestamp[blahblahblah] (will output [Incorrect date format])
  • $discordTimestamp[now, LOL] (will fallback to discord default format)

Screenshots

None

@itsjesski itsjesski requested a review from ebiggz as a code owner February 5, 2023 16:59
@itsjesski itsjesski changed the title Add in a variable to generate discord timestamps. feat: Discord Timestamps Variable Feb 5, 2023
Copy link
Copy Markdown
Member

@ebiggz ebiggz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is awesome, didnt even know about this discord feature!

@ebiggz ebiggz merged commit 7ef1264 into v5 Feb 5, 2023
@ebiggz ebiggz deleted the discord-time-stamps branch February 5, 2023 17:29
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

Successfully merging this pull request may close these issues.

2 participants