using Discord.WebSocket;
using Newtonsoft.Json.Linq;
using System;
using System.Threading.Tasks;
namespace Kerobot
{
///
/// Base class for a Kerobot module. A module implements a user-facing feature and is expected to directly handle
/// user input (both by means of configuration and incoming Discord events) and process it accordingly.
///
///
/// Implementing classes should not rely on local variables to store runtime data regarding guilds.
/// Use and .
///
public abstract class ModuleBase
{
///
/// Retrieves the Kerobot instance.
///
public Kerobot Kerobot { get; }
///
/// Retrieves the Discord client instance.
///
public DiscordSocketClient DiscordClient { get => Kerobot.DiscordClient; }
///
/// When a module is loaded, this constructor is called.
/// Services are available at this point. Do not attempt to communicate to Discord within the constructor.
///
public ModuleBase(Kerobot kb) => Kerobot = kb;
///
/// Gets the module name.
/// This value is derived from the class's name. It is used in configuration and logging.
///
public string Name => GetType().Name;
///
/// Called when a guild becomes available. The implementing class should construct an object to hold
/// data specific to the corresponding guild for use during runtime.
///
/// JSON token holding module configuration specific to this guild.
///
/// An object containing state and/or configuration information for the guild currently being processed.
///
public abstract Task