From 3a5a0df846ed74e3c33843a3d21e0a576fec02ee Mon Sep 17 00:00:00 2001 From: Runebaas Date: Tue, 19 Sep 2017 18:53:59 +0200 Subject: [PATCH] Add google command, small change in dice and help commands --- Geekbot.net/Geekbot.net.csproj | 84 +++++++++++++++++----------------- Geekbot.net/Modules/Dice.cs | 4 +- Geekbot.net/Modules/Google.cs | 17 +++++++ Geekbot.net/Modules/Help.cs | 2 +- Geekbot.net/Modules/Ping.cs | 3 +- Geekbot.net/Program.cs | 1 + 6 files changed, 65 insertions(+), 46 deletions(-) create mode 100644 Geekbot.net/Modules/Google.cs diff --git a/Geekbot.net/Geekbot.net.csproj b/Geekbot.net/Geekbot.net.csproj index 5e543ab..4e2e121 100755 --- a/Geekbot.net/Geekbot.net.csproj +++ b/Geekbot.net/Geekbot.net.csproj @@ -1,43 +1,43 @@ - - - Exe - netcoreapp2.0 - derp.ico - 1.1.0 - Pizza and Coffee Studios - Pizza and Coffee Studios - A Discord bot - https://github.com/pizzaandcoffee/Geekbot.net - - - - 1.0.2 - - - 1.29.1.976 - - - 1.5.0.1 - - - - - - - 105.2.3 - - - 1.2.6 - - - 4.3.2 - - - - 4.3.0 - - - 4.3.0 - - + + + Exe + netcoreapp2.0 + derp.ico + 1.1.0 + Pizza and Coffee Studios + Pizza and Coffee Studios + A Discord bot + https://github.com/pizzaandcoffee/Geekbot.net + + + + 1.0.2 + + + 1.29.1.976 + + + 1.5.0.1 + + + + + + + 105.2.3 + + + 1.2.6 + + + 4.3.2 + + + + 4.3.0 + + + 4.3.0 + + \ No newline at end of file diff --git a/Geekbot.net/Modules/Dice.cs b/Geekbot.net/Modules/Dice.cs index 4c76c3e..c6409fc 100644 --- a/Geekbot.net/Modules/Dice.cs +++ b/Geekbot.net/Modules/Dice.cs @@ -63,8 +63,8 @@ namespace Geekbot.net.Modules total = total + roll; } - eb.AddField("Total", modifier == 0 ? $"{total}" : $"{total} (+{modifier})"); + eb.AddField("Total", modifier == 0 ? $"{total}" : $"{total + modifier} ({total} +{modifier})"); await ReplyAsync("", false, eb.Build()); } } -} \ No newline at end of file +} diff --git a/Geekbot.net/Modules/Google.cs b/Geekbot.net/Modules/Google.cs new file mode 100644 index 0000000..e2205aa --- /dev/null +++ b/Geekbot.net/Modules/Google.cs @@ -0,0 +1,17 @@ +using System.Threading.Tasks; +using Discord.Commands; + +namespace Geekbot.net.Modules +{ + public class Google : ModuleBase + { + [Command("google", RunMode = RunMode.Async)] + [Summary("Google Something.")] + public async Task Eyes([Remainder, Summary("SearchText")] string searchText) + { + var url = $"http://lmgtfy.com/?q={searchText.Replace(' ', '+')}"; + + await ReplyAsync($"Please click here :unamused:\r\n{url}"); + } + } +} \ No newline at end of file diff --git a/Geekbot.net/Modules/Help.cs b/Geekbot.net/Modules/Help.cs index 9dd80a5..57feb87 100644 --- a/Geekbot.net/Modules/Help.cs +++ b/Geekbot.net/Modules/Help.cs @@ -29,7 +29,7 @@ namespace Geekbot.net.Modules if (!param.Contains("admin")) if (cmd.Parameters.Any()) sb.AppendLine(tp(param, 15) + - tp(string.Join(",", cmd.Parameters.Select(e => e.Summary)), 19) + + tp(string.Join(" ", cmd.Parameters.Select(e => e.Summary)), 19) + cmd.Summary); else sb.AppendLine(tp(param, 34) + cmd.Summary); diff --git a/Geekbot.net/Modules/Ping.cs b/Geekbot.net/Modules/Ping.cs index 2ccca12..a3ba98d 100644 --- a/Geekbot.net/Modules/Ping.cs +++ b/Geekbot.net/Modules/Ping.cs @@ -1,4 +1,5 @@ -using System.Threading.Tasks; +using System.Linq; +using System.Threading.Tasks; using Discord.Commands; namespace Geekbot.net.Modules diff --git a/Geekbot.net/Program.cs b/Geekbot.net/Program.cs index 319db04..38bea6a 100755 --- a/Geekbot.net/Program.cs +++ b/Geekbot.net/Program.cs @@ -42,6 +42,7 @@ namespace Geekbot.net { var redisMultiplexer = ConnectionMultiplexer.Connect("127.0.0.1:6379"); redis = redisMultiplexer.GetDatabase(6); + Console.WriteLine("- Connected to Redis (db6)"); } catch (Exception) {