From c32546d633e55b3f524f9c1bcf65aa4fd1373f6a Mon Sep 17 00:00:00 2001 From: Kwoth Date: Sat, 11 Feb 2017 22:29:25 +0100 Subject: [PATCH] timezone parsing done, just needs actual db field and usage --- .../Modules/Administration/Administration.cs | 40 ++++++++++++++ .../Resources/CommandStrings.Designer.cs | 54 +++++++++++++++++++ src/NadekoBot/Resources/CommandStrings.resx | 18 +++++++ 3 files changed, 112 insertions(+) diff --git a/src/NadekoBot/Modules/Administration/Administration.cs b/src/NadekoBot/Modules/Administration/Administration.cs index cf92fb4b..b86f80e9 100644 --- a/src/NadekoBot/Modules/Administration/Administration.cs +++ b/src/NadekoBot/Modules/Administration/Administration.cs @@ -552,5 +552,45 @@ namespace NadekoBot.Modules.Administration await Context.Channel.SendConfirmAsync($"Successfuly added a new donator. Total donated amount from this user: {don.Amount} 👑").ConfigureAwait(false); } + + //[NadekoCommand, Usage, Description, Aliases] + //[RequireContext(ContextType.Guild)] + //public async Task Timezones(int page = 1) + //{ + // page -= 1; + + // if (page < 0 || page > 20) + // return; + + // var timezones = TimeZoneInfo.GetSystemTimeZones(); + // var timezonesPerPage = 20; + + // await Context.Channel.SendPaginatedConfirmAsync(page + 1, (curPage) => new EmbedBuilder() + // .WithOkColor() + // .WithTitle("Available Timezones") + // .WithDescription(string.Join("\n", timezones.Skip((curPage - 1) * timezonesPerPage).Take(timezonesPerPage).Select(x => $"`{x.Id,-25}` UTC{x.BaseUtcOffset:hhmm}"))), + // timezones.Count / timezonesPerPage); + //} + + //[NadekoCommand, Usage, Description, Aliases] + //[RequireContext(ContextType.Guild)] + //public async Task Timezone([Remainder] string id) + //{ + // TimeZoneInfo tz; + // try + // { + // tz = TimeZoneInfo.FindSystemTimeZoneById(id); + // if (tz != null) + // await Context.Channel.SendConfirmAsync(tz.ToString()).ConfigureAwait(false); + // } + // catch (Exception ex) + // { + // tz = null; + // _log.Warn(ex); + // } + + // if (tz == null) + // await Context.Channel.SendErrorAsync("Timezone not found. You should specify one of the timezones listed in the 'timezones' command.").ConfigureAwait(false); + //} } } \ No newline at end of file diff --git a/src/NadekoBot/Resources/CommandStrings.Designer.cs b/src/NadekoBot/Resources/CommandStrings.Designer.cs index 04745557..11fa3692 100644 --- a/src/NadekoBot/Resources/CommandStrings.Designer.cs +++ b/src/NadekoBot/Resources/CommandStrings.Designer.cs @@ -7754,6 +7754,60 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to timezone. + /// + public static string timezone_cmd { + get { + return ResourceManager.GetString("timezone_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sets this guilds timezone. This affects bot's time output in this server (logs, etc..). + /// + public static string timezone_desc { + get { + return ResourceManager.GetString("timezone_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}timezone`. + /// + public static string timezone_usage { + get { + return ResourceManager.GetString("timezone_usage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to timezones. + /// + public static string timezones_cmd { + get { + return ResourceManager.GetString("timezones_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to List of all timezones available on the system to be used with `{0}timezone`.. + /// + public static string timezones_desc { + get { + return ResourceManager.GetString("timezones_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}timezones`. + /// + public static string timezones_usage { + get { + return ResourceManager.GetString("timezones_usage", resourceCulture); + } + } + /// /// Looks up a localized string similar to tl. /// diff --git a/src/NadekoBot/Resources/CommandStrings.resx b/src/NadekoBot/Resources/CommandStrings.resx index fae1afda..cca4cf5c 100644 --- a/src/NadekoBot/Resources/CommandStrings.resx +++ b/src/NadekoBot/Resources/CommandStrings.resx @@ -3087,4 +3087,22 @@ >ttt + + timezones + + + List of all timezones available on the system to be used with `{0}timezone`. + + + `{0}timezones` + + + timezone + + + Sets this guilds timezone. This affects bot's time output in this server (logs, etc..) + + + `{0}timezone` + \ No newline at end of file