geekbot/Geekbot.net/Commands/Choose.cs

27 lines
808 B
C#
Raw Normal View History

using System;
using System.Threading.Tasks;
using Discord.Commands;
2017-10-12 16:34:10 +02:00
using Geekbot.net.Lib;
namespace Geekbot.net.Commands
{
public class Choose : ModuleBase
{
private readonly Random rnd;
2017-09-15 22:56:03 +02:00
public Choose(Random RandomClient)
{
rnd = RandomClient;
}
2017-09-15 22:56:03 +02:00
[Command("choose", RunMode = RunMode.Async)]
2017-10-12 16:34:10 +02:00
[Remarks(CommandCategories.Helpers)]
[Summary("Let the bot choose for you, seperate options with a semicolon.")]
2017-09-15 22:56:03 +02:00
public async Task Command([Remainder] [Summary("option1;option2")] string choices)
{
var choicesArray = choices.Split(';');
var choice = rnd.Next(choicesArray.Length);
await ReplyAsync($"I choose **{choicesArray[choice]}**");
}
}
2017-05-15 20:43:50 +02:00
}