diff --git a/src/NadekoBot/Modules/Administration/Administration.cs b/src/NadekoBot/Modules/Administration/Administration.cs index b2d7333f..8f123251 100644 --- a/src/NadekoBot/Modules/Administration/Administration.cs +++ b/src/NadekoBot/Modules/Administration/Administration.cs @@ -689,7 +689,21 @@ namespace NadekoBot.Modules.Administration await NadekoBot.Client.GetCurrentUser().ModifyStatusAsync(u => u.Game = new Game(game)).ConfigureAwait(false); - await channel.SendMessageAsync("New game set.").ConfigureAwait(false); + await channel.SendMessageAsync("`New game set.`").ConfigureAwait(false); + } + + [NadekoCommand, Usage, Description, Aliases] + [RequireContext(ContextType.Guild)] + [OwnerOnly] + public async Task SetStream(IUserMessage umsg, string url, [Remainder] string name = null) + { + var channel = (ITextChannel)umsg.Channel; + + name = name ?? ""; + + await NadekoBot.Client.GetCurrentUser().ModifyStatusAsync(u => u.Game = new Game(name, url, StreamType.Twitch)).ConfigureAwait(false); + + await channel.SendMessageAsync("`New stream set.`").ConfigureAwait(false); } [NadekoCommand, Usage, Description, Aliases] diff --git a/src/NadekoBot/Modules/Utility/Commands/InfoCommands.cs b/src/NadekoBot/Modules/Utility/Commands/InfoCommands.cs index 1cfc36a5..fad77cc4 100644 --- a/src/NadekoBot/Modules/Utility/Commands/InfoCommands.cs +++ b/src/NadekoBot/Modules/Utility/Commands/InfoCommands.cs @@ -36,7 +36,7 @@ namespace NadekoBot.Modules.Utility `TextChannels:` **{(await server.GetTextChannelsAsync()).Count()}** `VoiceChannels:` **{(await server.GetVoiceChannelsAsync()).Count()}** `Members:` **{users.Count}** `-` {users.Count(u => u.Status == UserStatus.Online)}:green_heart: {users.Count(u => u.Status == UserStatus.Idle)}:yellow_heart: {users.Count(u => u.Status == UserStatus.DoNotDisturb)}:heart: {users.Count(u=> u.Status == UserStatus.Offline || u.Status == UserStatus.Unknown)}:black_heart: `Roles:` **{server.Roles.Count()}** -`Created At:` **{createdAt}** +`Created At:` **{createdAt.ToString("dd.MM.yyyy HH:mm")}** "); if (server.Emojis.Count() > 0) sb.AppendLine($"`Custom Emojis:` **{string.Join(", ", server.Emojis)}**"); @@ -57,7 +57,7 @@ namespace NadekoBot.Modules.Utility var createdAt = new DateTime(2015, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(ch.Id >> 22); var toReturn = $@"`Name:` **#{ch.Name}** `Id:` **{ch.Id}** -`Created At:` **{createdAt}** +`Created At:` **{createdAt.ToString("dd.MM.yyyy HH:mm")}** `Topic:` **{ch.Topic}** `Users:` **{(await ch.GetUsersAsync()).Count()}**"; await msg.Reply(toReturn).ConfigureAwait(false); @@ -76,7 +76,8 @@ namespace NadekoBot.Modules.Utility toReturn += $"`Nickname:` **{user.Nickname}**"; toReturn += $@"`Id:` **{user.Id}** `Current Game:` **{(user.Game?.Name == null ? "-" : user.Game.Name)}** -`Joined At:` **{user.JoinedAt}** +`Joined Server:` **{user.JoinedAt?.ToString("dd.MM.yyyy HH:mm")}** +`Joined Discord:` **{user.CreatedAt.ToString("dd.MM.yyyy HH:mm")}** `Roles:` **({user.Roles.Count()}) - {string.Join(", ", user.Roles.Select(r => r.Name)).SanitizeMentions()}** `AvatarUrl:` **{user.AvatarUrl}**"; await msg.Reply(toReturn).ConfigureAwait(false); diff --git a/src/NadekoBot/Resources/CommandStrings.Designer.cs b/src/NadekoBot/Resources/CommandStrings.Designer.cs index b8e071e5..d88c31c4 100644 --- a/src/NadekoBot/Resources/CommandStrings.Designer.cs +++ b/src/NadekoBot/Resources/CommandStrings.Designer.cs @@ -5729,6 +5729,33 @@ namespace NadekoBot.Resources { } } + /// + /// Looks up a localized string similar to setstream. + /// + public static string setstream_cmd { + get { + return ResourceManager.GetString("setstream_cmd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sets the bots stream. First argument is the twitch link, second argument is stream name.. + /// + public static string setstream_desc { + get { + return ResourceManager.GetString("setstream_desc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to `{0}setstream https://www.twitch.tv/masterkwoth Developing Nakedo`. + /// + public static string setstream_usage { + get { + return ResourceManager.GetString("setstream_usage", resourceCulture); + } + } + /// /// Looks up a localized string similar to settopic st. /// diff --git a/src/NadekoBot/Resources/CommandStrings.resx b/src/NadekoBot/Resources/CommandStrings.resx index 60e1b125..e8016c21 100644 --- a/src/NadekoBot/Resources/CommandStrings.resx +++ b/src/NadekoBot/Resources/CommandStrings.resx @@ -2475,4 +2475,13 @@ `{0}adsarm` + + setstream + + + Sets the bots stream. First argument is the twitch link, second argument is stream name. + + + `{0}setstream https://www.twitch.tv/masterkwoth Developing Nakedo` +