Add google command, small change in dice and help commands
This commit is contained in:
parent
e57b80d4b4
commit
3a5a0df846
6 changed files with 65 additions and 46 deletions
|
@ -63,7 +63,7 @@ namespace Geekbot.net.Modules
|
||||||
total = total + roll;
|
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());
|
await ReplyAsync("", false, eb.Build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
17
Geekbot.net/Modules/Google.cs
Normal file
17
Geekbot.net/Modules/Google.cs
Normal file
|
@ -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}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -29,7 +29,7 @@ namespace Geekbot.net.Modules
|
||||||
if (!param.Contains("admin"))
|
if (!param.Contains("admin"))
|
||||||
if (cmd.Parameters.Any())
|
if (cmd.Parameters.Any())
|
||||||
sb.AppendLine(tp(param, 15) +
|
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);
|
cmd.Summary);
|
||||||
else
|
else
|
||||||
sb.AppendLine(tp(param, 34) + cmd.Summary);
|
sb.AppendLine(tp(param, 34) + cmd.Summary);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System.Threading.Tasks;
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
|
|
||||||
namespace Geekbot.net.Modules
|
namespace Geekbot.net.Modules
|
||||||
|
|
|
@ -42,6 +42,7 @@ namespace Geekbot.net
|
||||||
{
|
{
|
||||||
var redisMultiplexer = ConnectionMultiplexer.Connect("127.0.0.1:6379");
|
var redisMultiplexer = ConnectionMultiplexer.Connect("127.0.0.1:6379");
|
||||||
redis = redisMultiplexer.GetDatabase(6);
|
redis = redisMultiplexer.GetDatabase(6);
|
||||||
|
Console.WriteLine("- Connected to Redis (db6)");
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue