From ad3dd61d26ca95e3a366192c746ecf261ae591d0 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Mon, 6 Feb 2017 07:53:27 +0100 Subject: [PATCH] rule34, e621 back on public bot --- src/NadekoBot/Modules/NSFW/NSFW.cs | 12 +++---- src/NadekoBot/Modules/Utility/Utility.cs | 43 ++++++++++++++++++++---- 2 files changed, 42 insertions(+), 13 deletions(-) diff --git a/src/NadekoBot/Modules/NSFW/NSFW.cs b/src/NadekoBot/Modules/NSFW/NSFW.cs index 9698379a..fe81fa49 100644 --- a/src/NadekoBot/Modules/NSFW/NSFW.cs +++ b/src/NadekoBot/Modules/NSFW/NSFW.cs @@ -147,11 +147,7 @@ namespace NadekoBot.Modules.NSFW [NadekoCommand, Usage, Description, Aliases] public Task Konachan([Remainder] string tag = null) => Searches.Searches.InternalDapiCommand(Context.Message, tag, Searches.Searches.DapiSearchType.Konachan); - - [NadekoCommand, Usage, Description, Aliases] - public Task Rule34([Remainder] string tag = null) - => Searches.Searches.InternalDapiCommand(Context.Message, tag, Searches.Searches.DapiSearchType.Rule34); - +#endif [NadekoCommand, Usage, Description, Aliases] public async Task E621([Remainder] string tag = null) { @@ -168,7 +164,11 @@ namespace NadekoBot.Modules.NSFW .WithFooter(efb => efb.WithText("e621"))) .ConfigureAwait(false); } -#endif + + [NadekoCommand, Usage, Description, Aliases] + public Task Rule34([Remainder] string tag = null) + => Searches.Searches.InternalDapiCommand(Context.Message, tag, Searches.Searches.DapiSearchType.Rule34); + [NadekoCommand, Usage, Description, Aliases] public async Task Danbooru([Remainder] string tag = null) { diff --git a/src/NadekoBot/Modules/Utility/Utility.cs b/src/NadekoBot/Modules/Utility/Utility.cs index 01f91b67..035acf74 100644 --- a/src/NadekoBot/Modules/Utility/Utility.cs +++ b/src/NadekoBot/Modules/Utility/Utility.cs @@ -25,6 +25,36 @@ namespace NadekoBot.Modules.Utility { private static ConcurrentDictionary rotatingRoleColors = new ConcurrentDictionary(); + //[NadekoCommand, Usage, Description, Aliases] + //[RequireContext(ContextType.Guild)] + //public async Task Midorina([Remainder] string arg) + //{ + // var channel = (ITextChannel)Context.Channel; + + // var roleNames = arg?.Split(';'); + + // if (roleNames == null || roleNames.Length == 0) + // return; + + // var j = 0; + // var roles = roleNames.Select(x => Context.Guild.Roles.FirstOrDefault(r => String.Compare(r.Name, x) == 0)) + // .Where(x => x != null) + // .Select(x => $"`{++j}.` {x.Name}") + // .Take(10) + // .ToArray(); + + // string[] reactions = { "one", ":two:", ":three:", ":four:", ":five:", ":six:", ":seven:", ":eight:", ":nine:", ":ten:" }; + + // var msg = await Context.Channel.SendConfirmAsync("Pick a Role", + // string.Join("\n", roles)).ConfigureAwait(false); + + // for (int i = 0; i < roles.Length; i++) + // { + // await msg.AddReactionAsync(reactions[i]).ConfigureAwait(false); + // await Task.Delay(1000).ConfigureAwait(false); + // } + //} + [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] [RequireUserPermission(GuildPermission.ManageRoles)] @@ -317,10 +347,6 @@ namespace NadekoBot.Modules.Utility var shardId = Context.Guild != null ? NadekoBot.Client.GetShardIdFor(Context.Guild.Id) : 0; - var footer = $"Shard {shardId} | {NadekoBot.Client.Shards.Count} total shards"; -#if !GLOBAL_NADEKO - footer += $" | Playing {Music.Music.MusicPlayers.Where(mp => mp.Value.CurrentSong != null).Count()} songs, {Music.Music.MusicPlayers.Sum(mp => mp.Value.Playlist.Count)} queued."; -#endif await Context.Channel.EmbedAsync( new EmbedBuilder().WithOkColor() @@ -328,15 +354,18 @@ namespace NadekoBot.Modules.Utility .WithUrl("http://nadekobot.readthedocs.io/en/latest/") .WithIconUrl("https://cdn.discordapp.com/avatars/116275390695079945/b21045e778ef21c96d175400e779f0fb.jpg")) .AddField(efb => efb.WithName(Format.Bold("Author")).WithValue(stats.Author).WithIsInline(true)) - .AddField(efb => efb.WithName(Format.Bold("Library")).WithValue(stats.Library).WithIsInline(true)) .AddField(efb => efb.WithName(Format.Bold("Bot ID")).WithValue(NadekoBot.Client.CurrentUser.Id.ToString()).WithIsInline(true)) + .AddField(efb => efb.WithName(Format.Bold("Shard")).WithValue($"#{shardId}, {NadekoBot.Client.Shards.Count} total").WithIsInline(true)) .AddField(efb => efb.WithName(Format.Bold("Commands Ran")).WithValue(stats.CommandsRan.ToString()).WithIsInline(true)) .AddField(efb => efb.WithName(Format.Bold("Messages")).WithValue($"{stats.MessageCounter} ({stats.MessagesPerSecond:F2}/sec)").WithIsInline(true)) .AddField(efb => efb.WithName(Format.Bold("Memory")).WithValue($"{stats.Heap} MB").WithIsInline(true)) .AddField(efb => efb.WithName(Format.Bold("Owner ID(s)")).WithValue(string.Join("\n", NadekoBot.Credentials.OwnerIds)).WithIsInline(true)) .AddField(efb => efb.WithName(Format.Bold("Uptime")).WithValue(stats.GetUptimeString("\n")).WithIsInline(true)) .AddField(efb => efb.WithName(Format.Bold("Presence")).WithValue($"{NadekoBot.Client.GetGuildCount()} Servers\n{stats.TextChannels} Text Channels\n{stats.VoiceChannels} Voice Channels").WithIsInline(true)) - .WithFooter(efb => efb.WithText(footer))); +#if !GLOBAL_NADEKO + .WithFooter(efb => efb.WithText($"Playing {Music.Music.MusicPlayers.Where(mp => mp.Value.CurrentSong != null).Count()} songs, {Music.Music.MusicPlayers.Sum(mp => mp.Value.Playlist.Count)} queued.")) +#endif + ); } [NadekoCommand, Usage, Description, Aliases] @@ -393,4 +422,4 @@ namespace NadekoBot.Modules.Utility await JsonConvert.SerializeObject(grouping, Formatting.Indented).ToStream().ConfigureAwait(false), title, title).ConfigureAwait(false); } } -} +} \ No newline at end of file