Add Checkem Command

This commit is contained in:
Runebaas 2017-09-15 12:58:49 +02:00
parent ee4c09e7ea
commit 1295ed6206
7 changed files with 211 additions and 8 deletions

View file

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Discord.Commands;
using Geekbot.net.Lib;
namespace Geekbot.net.Modules
{
public class CheckEm : ModuleBase
{
private readonly Random rnd;
private readonly ICheckEmImageProvider checkEmImages;
public CheckEm(Random RandomClient, ICheckEmImageProvider checkEmImages)
{
this.rnd = RandomClient;
this.checkEmImages = checkEmImages;
}
[Command("checkem", RunMode = RunMode.Async), Summary("Check for dubs")]
public async Task MuhDubs()
{
try
{
var sb = new StringBuilder();
sb.AppendLine($"Check em {Context.User.Mention}");
sb.AppendLine($"**{rnd.Next(100000, 99999999)}**");
sb.AppendLine(checkEmImages.GetRandomCheckEmPic());
await ReplyAsync(sb.ToString());
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}

View file

@ -7,8 +7,8 @@ namespace Geekbot.net.Modules
{
public class Fortune : ModuleBase
{
private readonly IFortunes fortunes;
public Fortune(IFortunes fortunes)
private readonly IFortunesProvider fortunes;
public Fortune(IFortunesProvider fortunes)
{
this.fortunes = fortunes;
}