Custom activation methods

This commit is contained in:
Googie2149
2016-01-27 15:10:03 -05:00
parent 484b2b1391
commit 00171c68ac
2 changed files with 58 additions and 8 deletions

View File

@@ -11,6 +11,17 @@ namespace Discord.Commands
/// <summary> Use the automatic help command and respond in a private message. </summary>
Private
}
[Flags]
public enum ActivationMode
{
// All of these probably need to be changed
/// <summary> Enable command activation by char. </summary>
Char = 0x1,
/// <summary> Enable command activation when mentioned. </summary>
Mention = 0x2,
/// <summary> Enable command activation by custom function. </summary>
Custom = 0x4
}
public class CommandServiceConfig
{
public char? CommandChar
@@ -29,10 +40,16 @@ namespace Discord.Commands
}
public char[] CommandChars { get { return _commandChars; } set { SetValue(ref _commandChars, value); } }
private char[] _commandChars = new char[] { '!' };
public Func<Message, int> CustomActivator { get { return _customActivator; } set { SetValue(ref _customActivator, value); } }
private Func<Message, int> _customActivator = null;
public HelpMode HelpMode { get { return _helpMode; } set { SetValue(ref _helpMode, value); } }
private HelpMode _helpMode = HelpMode.Disable;
public ActivationMode ActivationMode { get { return _activationMode; } set { SetValue(ref _activationMode, value); } }
private ActivationMode _activationMode = ActivationMode.Char; // Set char as default, not sure if it's the best method of doing it
//Lock
protected bool _isLocked;
internal void Lock() { _isLocked = true; }