Browse Source

Merge ba8fbdb916 into 8eb9b2071c

pull/499/merge
Joe4evr GitHub 8 years ago
parent
commit
c882217123
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      src/Discord.Net.Commands/ModuleBase.cs

+ 5
- 0
src/Discord.Net.Commands/ModuleBase.cs View File

@@ -14,6 +14,10 @@ namespace Discord.Commands
{ {
return await Context.Channel.SendMessageAsync(message, isTTS, embed, options).ConfigureAwait(false); return await Context.Channel.SendMessageAsync(message, isTTS, embed, options).ConfigureAwait(false);
} }
protected virtual void OnContextSet()
{
}


protected virtual void BeforeExecute() protected virtual void BeforeExecute()
{ {
@@ -30,6 +34,7 @@ namespace Discord.Commands
if (newValue == null) if (newValue == null)
throw new InvalidOperationException($"Invalid context type. Expected {typeof(T).Name}, got {context.GetType().Name}"); throw new InvalidOperationException($"Invalid context type. Expected {typeof(T).Name}, got {context.GetType().Name}");
Context = newValue; Context = newValue;
OnContextSet();
} }


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


Loading…
Cancel
Save