<commit_before>﻿using System;
using System.Threading.Tasks;

namespace Discord.Commands
{
    public abstract class ModuleBase : ModuleBase<CommandContext> { }

    public abstract class ModuleBase<T> : IModuleBase
        where T : class, ICommandContext
    {
        public T Context { get; private set; }

        protected virtual async Task<IUserMessage> ReplyAsync(string message, bool isTTS = false, Embed embed = null, RequestOptions options = null)
        {
            return await Context.Channel.SendMessageAsync(message, isTTS, embed, options).ConfigureAwait(false);
        }

        protected void BeforeExecute()
        {
        }

        protected void AfterExecute()
        {
        }

        //IModuleBase
        void IModuleBase.SetContext(ICommandContext context)
        {
            var newValue = context as T;
            if (newValue == null)
                throw new InvalidOperationException($"Invalid context type. Expected {typeof(T).Name}, got {context.GetType().Name}");
            Context = newValue;
        }

        void IModuleBase.BeforeExecute() => BeforeExecute();

        void IModuleBase.AfterExecute() => AfterExecute();
    }
}
<commit_msg>Actually mark the methods virtual #derp<commit_after>﻿using System;
using System.Threading.Tasks;

namespace Discord.Commands
{
    public abstract class ModuleBase : ModuleBase<CommandContext> { }

    public abstract class ModuleBase<T> : IModuleBase
        where T : class, ICommandContext
    {
        public T Context { get; private set; }

        protected virtual async Task<IUserMessage> ReplyAsync(string message, bool isTTS = false, Embed embed = null, RequestOptions options = null)
        {
            return await Context.Channel.SendMessageAsync(message, isTTS, embed, options).ConfigureAwait(false);
        }

        protected virtual void BeforeExecute()
        {
        }

        protected virtual void AfterExecute()
        {
        }

        //IModuleBase
        void IModuleBase.SetContext(ICommandContext context)
        {
            var newValue = context as T;
            if (newValue == null)
                throw new InvalidOperationException($"Invalid context type. Expected {typeof(T).Name}, got {context.GetType().Name}");
            Context = newValue;
        }

        void IModuleBase.BeforeExecute() => BeforeExecute();

        void IModuleBase.AfterExecute() => AfterExecute();
    }
}

{'fraction_non_alphanumeric': 0.0889344262295082, 'fraction_numerical': 0.0, 'mean_word_length': 2.4673295454545454, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5614214', 'n_tokens_mistral': 629, 'n_tokens_neox': 617, 'n_words': 171}