1:44:25.47 can now be set in .adpl to show current server time

This commit is contained in:
Kwoth 2017-01-23 01:44:25 +01:00
parent b6f44de8b5
commit 1fde33676f
2 changed files with 5 additions and 1 deletions

View File

@ -81,7 +81,8 @@ namespace NadekoBot.Modules.Administration
}
}
},
{"%queued%", () => Music.Music.MusicPlayers.Sum(kvp => kvp.Value.Playlist.Count).ToString()}
{"%queued%", () => Music.Music.MusicPlayers.Sum(kvp => kvp.Value.Playlist.Count).ToString()},
{ "%time%", () => DateTime.Now.ToString("hh:mm "+TimeZoneInfo.Local.StandardName.GetInitials()) }
};
[NadekoCommand, Usage, Description, Aliases]

View File

@ -103,6 +103,9 @@ namespace NadekoBot.Extensions
http.DefaultRequestHeaders.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
}
public static string GetInitials(this string txt, string glue = "") =>
string.Join(glue, txt.Split(' ').Select(x => x.FirstOrDefault()));
public static DateTime ToUnixTimestamp(this double number) => new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddSeconds(number);
public static EmbedBuilder WithOkColor(this EmbedBuilder eb) =>