2017-05-15 20:43:50 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Discord.Commands;
|
|
|
|
|
using Geekbot.net.Lib.IClients;
|
|
|
|
|
|
|
|
|
|
namespace Geekbot.net.Modules
|
|
|
|
|
{
|
|
|
|
|
public class Choose : ModuleBase
|
|
|
|
|
{
|
|
|
|
|
private readonly IRandomClient rnd;
|
|
|
|
|
public Choose(IRandomClient randomClient)
|
|
|
|
|
{
|
|
|
|
|
rnd = randomClient;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Command("choose", RunMode = RunMode.Async), Summary("Let the bot make a choice for you.")]
|
|
|
|
|
public async Task Command([Remainder, Summary("The choices, sepperated by a ;")] string choices)
|
|
|
|
|
{
|
|
|
|
|
var choicesArray = choices.Split(';');
|
|
|
|
|
var choice = rnd.Client.Next(choicesArray.Length);
|
2017-05-15 23:38:23 +02:00
|
|
|
|
await ReplyAsync($"I choose **{choicesArray[choice]}**");
|
2017-05-15 20:43:50 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|