mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-20 00:43:36 +03:00
Resolve conversations pt.2
Signed-off-by: Macintosh II <mctaylxrs@outlook.com>
This commit is contained in:
parent
d00e70fa52
commit
431111cb3f
1 changed files with 12 additions and 12 deletions
|
@ -290,6 +290,17 @@ public class ToolsCommandGroup : CommandGroup
|
||||||
return await _feedback.SendContextualEmbedResultAsync(embed, ct);
|
return await _feedback.SendContextualEmbedResultAsync(embed, ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static readonly TimestampStyle[] AllStyles =
|
||||||
|
{
|
||||||
|
TimestampStyle.ShortDate,
|
||||||
|
TimestampStyle.LongDate,
|
||||||
|
TimestampStyle.ShortTime,
|
||||||
|
TimestampStyle.LongTime,
|
||||||
|
TimestampStyle.ShortDateTime,
|
||||||
|
TimestampStyle.LongDateTime,
|
||||||
|
TimestampStyle.RelativeTime
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A slash command that shows the current timestamp with an optional offset in all styles supported by Discord.
|
/// A slash command that shows the current timestamp with an optional offset in all styles supported by Discord.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -302,7 +313,7 @@ public class ToolsCommandGroup : CommandGroup
|
||||||
[Description("Shows a timestamp in all styles")]
|
[Description("Shows a timestamp in all styles")]
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public async Task<Result> ExecuteTimestampAsync(
|
public async Task<Result> ExecuteTimestampAsync(
|
||||||
[Description("Add an offset from now")]
|
[Description("Offset from current time")]
|
||||||
TimeSpan? offset = null)
|
TimeSpan? offset = null)
|
||||||
{
|
{
|
||||||
if (!_context.TryGetContextIDs(out var guildId, out _, out var userId))
|
if (!_context.TryGetContextIDs(out var guildId, out _, out var userId))
|
||||||
|
@ -322,17 +333,6 @@ public class ToolsCommandGroup : CommandGroup
|
||||||
return await SendTimestampAsync(offset, user, CancellationToken);
|
return await SendTimestampAsync(offset, user, CancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly TimestampStyle[] AllStyles =
|
|
||||||
{
|
|
||||||
TimestampStyle.ShortDate,
|
|
||||||
TimestampStyle.LongDate,
|
|
||||||
TimestampStyle.ShortTime,
|
|
||||||
TimestampStyle.LongTime,
|
|
||||||
TimestampStyle.ShortDateTime,
|
|
||||||
TimestampStyle.LongDateTime,
|
|
||||||
TimestampStyle.RelativeTime
|
|
||||||
};
|
|
||||||
|
|
||||||
private async Task<Result> SendTimestampAsync(TimeSpan? offset, IUser user, CancellationToken ct)
|
private async Task<Result> SendTimestampAsync(TimeSpan? offset, IUser user, CancellationToken ct)
|
||||||
{
|
{
|
||||||
var timestamp = DateTimeOffset.UtcNow.Add(offset ?? TimeSpan.Zero).ToUnixTimeSeconds();
|
var timestamp = DateTimeOffset.UtcNow.Add(offset ?? TimeSpan.Zero).ToUnixTimeSeconds();
|
||||||
|
|
Loading…
Add table
Reference in a new issue