2017-09-22 22:42:15 +00:00
|
|
|
|
using Discord.Commands;
|
2016-12-09 03:22:23 +00:00
|
|
|
|
using NadekoBot.Extensions;
|
2017-07-17 19:42:36 +00:00
|
|
|
|
using NadekoBot.Modules.Searches.Services;
|
2016-08-16 12:11:45 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
2017-07-17 19:42:36 +00:00
|
|
|
|
using NadekoBot.Common;
|
|
|
|
|
using NadekoBot.Common.Attributes;
|
2016-08-16 12:11:45 +00:00
|
|
|
|
|
2016-08-20 20:35:27 +00:00
|
|
|
|
namespace NadekoBot.Modules.Searches
|
2016-08-16 12:11:45 +00:00
|
|
|
|
{
|
2016-08-20 20:35:27 +00:00
|
|
|
|
public partial class Searches
|
2016-08-16 12:11:45 +00:00
|
|
|
|
{
|
|
|
|
|
[Group]
|
2017-07-15 16:34:34 +00:00
|
|
|
|
public class JokeCommands : NadekoSubmodule<SearchesService>
|
2016-08-16 12:11:45 +00:00
|
|
|
|
{
|
|
|
|
|
|
2016-10-05 03:09:44 +00:00
|
|
|
|
[NadekoCommand, Usage, Description, Aliases]
|
2016-12-16 18:43:57 +00:00
|
|
|
|
public async Task Yomama()
|
2016-08-16 12:11:45 +00:00
|
|
|
|
{
|
2017-09-22 22:42:15 +00:00
|
|
|
|
await Context.Channel.SendConfirmAsync(await _service.GetYomamaJoke()).ConfigureAwait(false);
|
2016-08-16 12:11:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-05 03:09:44 +00:00
|
|
|
|
[NadekoCommand, Usage, Description, Aliases]
|
2016-12-16 18:43:57 +00:00
|
|
|
|
public async Task Randjoke()
|
2016-08-16 12:11:45 +00:00
|
|
|
|
{
|
2017-09-22 22:42:15 +00:00
|
|
|
|
var jokeInfo = await _service.GetRandomJoke();
|
|
|
|
|
await Context.Channel.SendConfirmAsync("", jokeInfo.Text, footer: jokeInfo.BaseUri).ConfigureAwait(false);
|
2016-08-16 12:11:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-05 03:09:44 +00:00
|
|
|
|
[NadekoCommand, Usage, Description, Aliases]
|
2016-12-16 18:43:57 +00:00
|
|
|
|
public async Task ChuckNorris()
|
2016-08-16 12:11:45 +00:00
|
|
|
|
{
|
2017-09-22 22:42:15 +00:00
|
|
|
|
await Context.Channel.SendConfirmAsync(await _service.GetChuckNorrisJoke()).ConfigureAwait(false);
|
2016-08-16 12:11:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-05 03:09:44 +00:00
|
|
|
|
[NadekoCommand, Usage, Description, Aliases]
|
2016-12-16 18:43:57 +00:00
|
|
|
|
public async Task WowJoke()
|
2016-08-16 12:11:45 +00:00
|
|
|
|
{
|
2017-07-15 16:34:34 +00:00
|
|
|
|
if (!_service.WowJokes.Any())
|
2016-08-16 12:11:45 +00:00
|
|
|
|
{
|
2017-02-24 16:10:44 +00:00
|
|
|
|
await ReplyErrorLocalized("jokes_not_loaded").ConfigureAwait(false);
|
2016-12-09 03:22:23 +00:00
|
|
|
|
return;
|
2016-08-16 12:11:45 +00:00
|
|
|
|
}
|
2017-07-15 16:34:34 +00:00
|
|
|
|
var joke = _service.WowJokes[new NadekoRandom().Next(0, _service.WowJokes.Count)];
|
2016-12-16 18:43:57 +00:00
|
|
|
|
await Context.Channel.SendConfirmAsync(joke.Question, joke.Answer).ConfigureAwait(false);
|
2016-08-16 12:11:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
2016-10-05 03:09:44 +00:00
|
|
|
|
[NadekoCommand, Usage, Description, Aliases]
|
2016-12-16 18:43:57 +00:00
|
|
|
|
public async Task MagicItem()
|
2016-08-16 12:11:45 +00:00
|
|
|
|
{
|
2017-07-15 16:34:34 +00:00
|
|
|
|
if (!_service.WowJokes.Any())
|
2016-12-09 03:22:23 +00:00
|
|
|
|
{
|
2017-02-24 16:10:44 +00:00
|
|
|
|
await ReplyErrorLocalized("magicitems_not_loaded").ConfigureAwait(false);
|
2016-12-09 03:22:23 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2017-07-15 16:34:34 +00:00
|
|
|
|
var item = _service.MagicItems[new NadekoRandom().Next(0, _service.MagicItems.Count)];
|
2016-08-16 12:11:45 +00:00
|
|
|
|
|
2016-12-16 18:43:57 +00:00
|
|
|
|
await Context.Channel.SendConfirmAsync("✨" + item.Name, item.Description).ConfigureAwait(false);
|
2016-08-16 12:11:45 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|