mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 09:48:26 -04:00
Global usings and file scoped namespaces
This commit is contained in:
@@ -1,62 +1,59 @@
|
||||
using Discord.Commands;
|
||||
using NadekoBot.Extensions;
|
||||
using NadekoBot.Modules.Searches.Services;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using NadekoBot.Common;
|
||||
using NadekoBot.Common.Attributes;
|
||||
|
||||
namespace NadekoBot.Modules.Searches
|
||||
namespace NadekoBot.Modules.Searches;
|
||||
|
||||
public partial class Searches
|
||||
{
|
||||
public partial class Searches
|
||||
[Group]
|
||||
public class JokeCommands : NadekoSubmodule<SearchesService>
|
||||
{
|
||||
[Group]
|
||||
public class JokeCommands : NadekoSubmodule<SearchesService>
|
||||
|
||||
[NadekoCommand, Aliases]
|
||||
public async Task Yomama()
|
||||
{
|
||||
await SendConfirmAsync(await _service.GetYomamaJoke().ConfigureAwait(false)).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[NadekoCommand, Aliases]
|
||||
public async Task Yomama()
|
||||
[NadekoCommand, Aliases]
|
||||
public async Task Randjoke()
|
||||
{
|
||||
var (setup, punchline) = await _service.GetRandomJoke().ConfigureAwait(false);
|
||||
await SendConfirmAsync(setup, punchline).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[NadekoCommand, Aliases]
|
||||
public async Task ChuckNorris()
|
||||
{
|
||||
await SendConfirmAsync(await _service.GetChuckNorrisJoke().ConfigureAwait(false)).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[NadekoCommand, Aliases]
|
||||
public async Task WowJoke()
|
||||
{
|
||||
if (!_service.WowJokes.Any())
|
||||
{
|
||||
await SendConfirmAsync(await _service.GetYomamaJoke().ConfigureAwait(false)).ConfigureAwait(false);
|
||||
await ReplyErrorLocalizedAsync(strs.jokes_not_loaded).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
var joke = _service.WowJokes[new NadekoRandom().Next(0, _service.WowJokes.Count)];
|
||||
await SendConfirmAsync(joke.Question, joke.Answer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[NadekoCommand, Aliases]
|
||||
public async Task Randjoke()
|
||||
[NadekoCommand, Aliases]
|
||||
public async Task MagicItem()
|
||||
{
|
||||
if (!_service.WowJokes.Any())
|
||||
{
|
||||
var (setup, punchline) = await _service.GetRandomJoke().ConfigureAwait(false);
|
||||
await SendConfirmAsync(setup, punchline).ConfigureAwait(false);
|
||||
await ReplyErrorLocalizedAsync(strs.magicitems_not_loaded).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
var item = _service.MagicItems[new NadekoRandom().Next(0, _service.MagicItems.Count)];
|
||||
|
||||
[NadekoCommand, Aliases]
|
||||
public async Task ChuckNorris()
|
||||
{
|
||||
await SendConfirmAsync(await _service.GetChuckNorrisJoke().ConfigureAwait(false)).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[NadekoCommand, Aliases]
|
||||
public async Task WowJoke()
|
||||
{
|
||||
if (!_service.WowJokes.Any())
|
||||
{
|
||||
await ReplyErrorLocalizedAsync(strs.jokes_not_loaded).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
var joke = _service.WowJokes[new NadekoRandom().Next(0, _service.WowJokes.Count)];
|
||||
await SendConfirmAsync(joke.Question, joke.Answer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[NadekoCommand, Aliases]
|
||||
public async Task MagicItem()
|
||||
{
|
||||
if (!_service.WowJokes.Any())
|
||||
{
|
||||
await ReplyErrorLocalizedAsync(strs.magicitems_not_loaded).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
var item = _service.MagicItems[new NadekoRandom().Next(0, _service.MagicItems.Count)];
|
||||
|
||||
await SendConfirmAsync("✨" + item.Name, item.Description).ConfigureAwait(false);
|
||||
}
|
||||
await SendConfirmAsync("✨" + item.Name, item.Description).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user