geekbot/Geekbot.net/Modules/Fortune.cs

23 lines
565 B
C#
Raw Normal View History

2017-09-15 22:56:03 +02:00
using System.Threading.Tasks;
2017-09-15 00:31:13 +02:00
using Discord.Commands;
using Geekbot.net.Lib;
namespace Geekbot.net.Modules
{
public class Fortune : ModuleBase
{
2017-09-15 12:58:49 +02:00
private readonly IFortunesProvider fortunes;
2017-09-15 22:56:03 +02:00
2017-09-15 12:58:49 +02:00
public Fortune(IFortunesProvider fortunes)
2017-09-15 00:31:13 +02:00
{
this.fortunes = fortunes;
}
2017-09-15 22:56:03 +02:00
[Command("fortune", RunMode = RunMode.Async)]
[Summary("Get a random fortune")]
2017-09-15 00:31:13 +02:00
public async Task GetAFortune()
{
await ReplyAsync(fortunes.GetRandomFortune());
}
}
2017-09-15 22:56:03 +02:00
}