geekbot/Geekbot.net/Commands/Randomness/EightBall.cs

57 lines
1.7 KiB
C#
Raw Normal View History

2017-04-13 00:03:03 +02:00
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Discord.Commands;
using Geekbot.net.Lib.ErrorHandling;
2017-04-13 00:03:03 +02:00
namespace Geekbot.net.Commands.Randomness
2017-04-13 00:03:03 +02:00
{
public class EightBall : ModuleBase
{
private readonly IErrorHandler _errorHandler;
2017-09-15 22:56:03 +02:00
public EightBall(IErrorHandler errorHandler)
2017-04-25 17:27:11 +02:00
{
_errorHandler = errorHandler;
2017-04-25 17:27:11 +02:00
}
2017-09-15 22:56:03 +02:00
[Command("8ball", RunMode = RunMode.Async)]
[Summary("Ask 8Ball a Question.")]
public async Task Ball([Remainder] [Summary("Question")] string echo)
2017-04-13 00:03:03 +02:00
{
try
2017-09-15 22:56:03 +02:00
{
var replies = new List<string>
{
"It is certain",
"It is decidedly so",
"Without a doubt",
"Yes, definitely",
"You may rely on it",
"As I see it, yes",
"Most likely",
"Outlook good",
"Yes",
"Signs point to yes",
"Reply hazy try again",
"Ask again later",
"Better not tell you now",
"Cannot predict now",
"Concentrate and ask again",
"Don't count on it",
"My reply is no",
"My sources say no",
"Outlook not so good",
"Very doubtful"
};
2017-04-13 00:03:03 +02:00
var answer = new Random().Next(replies.Count);
await ReplyAsync(replies[answer]);
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context);
}
2017-04-13 00:03:03 +02:00
}
}
}