Browse Source

Add indicator that a modules CommandContext has been set.

pull/499/head
Joe4evr 8 years ago
parent
commit
c64d6cdd7c
1 changed files with 14 additions and 1 deletions
  1. +14
    -1
      src/Discord.Net.Commands/ModuleBase.cs

+ 14
- 1
src/Discord.Net.Commands/ModuleBase.cs View File

@@ -8,12 +8,25 @@ namespace Discord.Commands
public abstract class ModuleBase<T> : IModuleBase
where T : class, ICommandContext
{
public T Context { get; private set; }
public T Context
{
get { return _context; }
private set
{
_context = value;
ContextSet();
}
}
private T _context;

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 ContextSet()
{
}

//IModuleBase
void IModuleBase.SetContext(ICommandContext context)


Loading…
Cancel
Save