Use the TransactionModuleBase for all commands that haven't implemented GeekbotCommandBase

This commit is contained in:
Daan Boerlage 2021-09-17 14:31:24 +02:00
parent f02c30e660
commit a1f8d033c2
Signed by: daan
GPG key ID: FCE070E1E4956606
25 changed files with 40 additions and 25 deletions

View file

@ -3,13 +3,14 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
using Geekbot.Core.Extensions; using Geekbot.Core.Extensions;
using PokeAPI; using PokeAPI;
namespace Geekbot.Bot.Commands.Games namespace Geekbot.Bot.Commands.Games
{ {
public class Pokedex : ModuleBase public class Pokedex : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;

View file

@ -10,7 +10,7 @@ using Geekbot.Core.ErrorHandling;
namespace Geekbot.Bot.Commands.Integrations.LolMmr namespace Geekbot.Bot.Commands.Integrations.LolMmr
{ {
public class LolMmr : ModuleBase public class LolMmr : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;

View file

@ -4,6 +4,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.Converters; using Geekbot.Core.Converters;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
using Geekbot.Core.Extensions; using Geekbot.Core.Extensions;
@ -11,7 +12,7 @@ using MtgApiManager.Lib.Service;
namespace Geekbot.Bot.Commands.Integrations namespace Geekbot.Bot.Commands.Integrations
{ {
public class MagicTheGathering : ModuleBase public class MagicTheGathering : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;
private readonly IMtgManaConverter _manaConverter; private readonly IMtgManaConverter _manaConverter;

View file

@ -9,7 +9,7 @@ using Geekbot.Core.Extensions;
namespace Geekbot.Bot.Commands.Integrations.UbranDictionary namespace Geekbot.Bot.Commands.Integrations.UbranDictionary
{ {
public class UrbanDictionary : ModuleBase public class UrbanDictionary : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;

View file

@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.Database; using Geekbot.Core.Database;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
using Geekbot.Core.Extensions; using Geekbot.Core.Extensions;
@ -14,7 +15,7 @@ using HtmlAgilityPack;
namespace Geekbot.Bot.Commands.Integrations namespace Geekbot.Bot.Commands.Integrations
{ {
public class Wikipedia : ModuleBase public class Wikipedia : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;
private readonly IWikipediaClient _wikipediaClient; private readonly IWikipediaClient _wikipediaClient;

View file

@ -1,6 +1,7 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
using Geekbot.Core.GlobalSettings; using Geekbot.Core.GlobalSettings;
using Google.Apis.Services; using Google.Apis.Services;
@ -8,7 +9,7 @@ using Google.Apis.YouTube.v3;
namespace Geekbot.Bot.Commands.Integrations namespace Geekbot.Bot.Commands.Integrations
{ {
public class Youtube : ModuleBase public class Youtube : TransactionModuleBase
{ {
private readonly IGlobalSettings _globalSettings; private readonly IGlobalSettings _globalSettings;
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;

View file

@ -2,12 +2,13 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
using Geekbot.Core.RandomNumberGenerator; using Geekbot.Core.RandomNumberGenerator;
namespace Geekbot.Bot.Commands.Randomness namespace Geekbot.Bot.Commands.Randomness
{ {
public class BenedictCumberbatchNameGenerator : ModuleBase public class BenedictCumberbatchNameGenerator : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;
private readonly IRandomNumberGenerator _randomNumberGenerator; private readonly IRandomNumberGenerator _randomNumberGenerator;

View file

@ -7,7 +7,7 @@ using Geekbot.Core.ErrorHandling;
namespace Geekbot.Bot.Commands.Randomness.Cat namespace Geekbot.Bot.Commands.Randomness.Cat
{ {
public class Cat : ModuleBase public class Cat : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;

View file

@ -7,7 +7,7 @@ using Geekbot.Core.ErrorHandling;
namespace Geekbot.Bot.Commands.Randomness.Chuck namespace Geekbot.Bot.Commands.Randomness.Chuck
{ {
public class ChuckNorrisJokes : ModuleBase public class ChuckNorrisJokes : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;

View file

@ -6,7 +6,7 @@ using Geekbot.Core.ErrorHandling;
namespace Geekbot.Bot.Commands.Randomness.Dad namespace Geekbot.Bot.Commands.Randomness.Dad
{ {
public class DadJokes : ModuleBase public class DadJokes : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;

View file

@ -7,7 +7,7 @@ using Geekbot.Core.ErrorHandling;
namespace Geekbot.Bot.Commands.Randomness.Dog namespace Geekbot.Bot.Commands.Randomness.Dog
{ {
public class Dog : ModuleBase public class Dog : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;

View file

@ -1,10 +1,11 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.Media; using Geekbot.Core.Media;
namespace Geekbot.Bot.Commands.Randomness namespace Geekbot.Bot.Commands.Randomness
{ {
public class Fortune : ModuleBase public class Fortune : TransactionModuleBase
{ {
private readonly IFortunesProvider _fortunes; private readonly IFortunesProvider _fortunes;

View file

@ -8,7 +8,7 @@ using Geekbot.Core.Extensions;
namespace Geekbot.Bot.Commands.Randomness.Greetings namespace Geekbot.Bot.Commands.Randomness.Greetings
{ {
public class Greetings : ModuleBase public class Greetings : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;

View file

@ -6,7 +6,7 @@ using Geekbot.Core.ErrorHandling;
namespace Geekbot.Bot.Commands.Randomness.Kanye namespace Geekbot.Bot.Commands.Randomness.Kanye
{ {
public class Kanye : ModuleBase public class Kanye : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;

View file

@ -1,11 +1,12 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.Media; using Geekbot.Core.Media;
namespace Geekbot.Bot.Commands.Randomness namespace Geekbot.Bot.Commands.Randomness
{ {
public class RandomAnimals : ModuleBase public class RandomAnimals : TransactionModuleBase
{ {
private readonly IMediaProvider _mediaProvider; private readonly IMediaProvider _mediaProvider;

View file

@ -4,6 +4,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.Database; using Geekbot.Core.Database;
using Geekbot.Core.Database.Models; using Geekbot.Core.Database.Models;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
@ -11,7 +12,7 @@ using Geekbot.Core.Extensions;
namespace Geekbot.Bot.Commands.Randomness namespace Geekbot.Bot.Commands.Randomness
{ {
public class Slap : ModuleBase public class Slap : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;
private readonly DatabaseContext _database; private readonly DatabaseContext _database;

View file

@ -3,6 +3,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.CommandPreconditions; using Geekbot.Core.CommandPreconditions;
using Geekbot.Core.Database; using Geekbot.Core.Database;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
@ -11,7 +12,7 @@ using Geekbot.Core.Levels;
namespace Geekbot.Bot.Commands.User namespace Geekbot.Bot.Commands.User
{ {
public class GuildInfo : ModuleBase public class GuildInfo : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;
private readonly DatabaseContext _database; private readonly DatabaseContext _database;

View file

@ -2,11 +2,12 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
namespace Geekbot.Bot.Commands.Utils namespace Geekbot.Bot.Commands.Utils
{ {
public class AvatarGetter : ModuleBase public class AvatarGetter : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;

View file

@ -11,7 +11,7 @@ using Geekbot.Core.ErrorHandling;
namespace Geekbot.Bot.Commands.Utils.Changelog namespace Geekbot.Bot.Commands.Utils.Changelog
{ {
public class Changelog : ModuleBase public class Changelog : TransactionModuleBase
{ {
private readonly DiscordSocketClient _client; private readonly DiscordSocketClient _client;
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;

View file

@ -3,12 +3,13 @@ using System.Collections.Generic;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.DiceParser; using Geekbot.Core.DiceParser;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
namespace Geekbot.Bot.Commands.Utils namespace Geekbot.Bot.Commands.Utils
{ {
public class Dice : ModuleBase public class Dice : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;
private readonly IDiceParser _diceParser; private readonly IDiceParser _diceParser;

View file

@ -1,12 +1,13 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.Converters; using Geekbot.Core.Converters;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
namespace Geekbot.Bot.Commands.Utils namespace Geekbot.Bot.Commands.Utils
{ {
public class Emojify : ModuleBase public class Emojify : TransactionModuleBase
{ {
private readonly IEmojiConverter _emojiConverter; private readonly IEmojiConverter _emojiConverter;
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;

View file

@ -3,11 +3,12 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord; using Discord;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
namespace Geekbot.Bot.Commands.Utils namespace Geekbot.Bot.Commands.Utils
{ {
public class Help : ModuleBase public class Help : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;

View file

@ -11,7 +11,7 @@ using Geekbot.Core.Extensions;
namespace Geekbot.Bot.Commands.Utils namespace Geekbot.Bot.Commands.Utils
{ {
public class Info : ModuleBase public class Info : TransactionModuleBase
{ {
private readonly DiscordSocketClient _client; private readonly DiscordSocketClient _client;
private readonly CommandService _commands; private readonly CommandService _commands;

View file

@ -2,11 +2,12 @@ using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Web; using System.Web;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
using Geekbot.Core.ErrorHandling; using Geekbot.Core.ErrorHandling;
namespace Geekbot.Bot.Commands.Utils namespace Geekbot.Bot.Commands.Utils
{ {
public class Lmgtfy : ModuleBase public class Lmgtfy : TransactionModuleBase
{ {
private readonly IErrorHandler _errorHandler; private readonly IErrorHandler _errorHandler;

View file

@ -1,9 +1,10 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Discord.Commands; using Discord.Commands;
using Geekbot.Core;
namespace Geekbot.Bot.Commands.Utils namespace Geekbot.Bot.Commands.Utils
{ {
public class Ping : ModuleBase public class Ping : TransactionModuleBase
{ {
[Command("👀", RunMode = RunMode.Async)] [Command("👀", RunMode = RunMode.Async)]
[Summary("Look at the bot.")] [Summary("Look at the bot.")]