Add BeforeExecute/AfterExecute methods to ModuleBase
This commit is contained in:
@@ -15,6 +15,14 @@ namespace Discord.Commands
|
||||
return await Context.Channel.SendMessageAsync(message, isTTS, embed, options).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
protected void BeforeExecute()
|
||||
{
|
||||
}
|
||||
|
||||
protected void AfterExecute()
|
||||
{
|
||||
}
|
||||
|
||||
//IModuleBase
|
||||
void IModuleBase.SetContext(ICommandContext context)
|
||||
{
|
||||
@@ -23,5 +31,9 @@ namespace Discord.Commands
|
||||
throw new InvalidOperationException($"Invalid context type. Expected {typeof(T).Name}, got {context.GetType().Name}");
|
||||
Context = newValue;
|
||||
}
|
||||
|
||||
void IModuleBase.BeforeExecute() => BeforeExecute();
|
||||
|
||||
void IModuleBase.AfterExecute() => AfterExecute();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user