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

Add TimeStamp support. #940

Merged

Conversation

VelvetToroyashi
Copy link
Member

Summary

Adds support for timestamps, documented in discord/discord-api-docs#3135.

@CabbageAdi
Copy link
Contributor

Shouldn't there be support for all the flags?

@VelvetToroyashi
Copy link
Member Author

Technically speaking, yes, but:
1: that would require adding an enum, I suppose
2: Embed timestamps also use relative, which imo is the most useful

3: Since you're here anyway do you mind triaging this.

@CabbageAdi
Copy link
Contributor

Doesn't really make sense to restrict it to only the relative one. Nothing wrong with an enum either

@VelvetToroyashi
Copy link
Member Author

@idoeverything done.

/// <summary>
/// Denotes the type of formatting to use for timestamps.
/// </summary>
public enum TimestampFormat
Copy link
Contributor

Choose a reason for hiding this comment

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

: char?

Copy link
Member Author

Choose a reason for hiding this comment

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

/// <param name="time">The time from now.</param>
/// <param name="format">The format to render the timestamp in. Defaults to relative.</param>
/// <returns>A formatted timestamp relative to now.</returns>
public static string TimeStamp(TimeSpan time, TimestampFormat format = TimestampFormat.RelativeTime)
Copy link
Contributor

Choose a reason for hiding this comment

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

s/S/s/

Copy link
Member Author

Choose a reason for hiding this comment

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

what?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, sed

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, also I forgot

Copy link
Contributor

@Emzi0767 Emzi0767 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 what I forgot

@VelvetToroyashi
Copy link
Member Author

@Emzi0767 should be good now

@Emzi0767 Emzi0767 merged commit 05904e5 into DSharpPlus:master Jun 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants