mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:12:58 +00:00
- miscellaneous small fixes
- add support for preventing all commands to be run on the channel by default. Now TechBot only answers some of the commands in PM - add back the error Command svn path=/trunk/; revision=34079
This commit is contained in:
parent
b7525df85d
commit
a46601a21c
8 changed files with 63 additions and 578 deletions
|
@ -21,6 +21,11 @@ namespace TechBot.Library
|
|||
set { m_Context = value; }
|
||||
}
|
||||
|
||||
public virtual bool AnswerInPublic
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
|
@ -53,6 +58,25 @@ namespace TechBot.Library
|
|||
TechBot.ServiceOutput.WriteLine(Context, String.Format(format, args));
|
||||
}
|
||||
|
||||
public void Run()
|
||||
{
|
||||
if (Context is ChannelMessageContext)
|
||||
{
|
||||
if (AnswerInPublic)
|
||||
{
|
||||
ExecuteCommand();
|
||||
}
|
||||
else
|
||||
{
|
||||
Say("Sorry, I only respond '{0}' in private , PM me!", Name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ExecuteCommand();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void ExecuteCommand();
|
||||
|
||||
public virtual void Initialize()
|
||||
|
|
|
@ -6,8 +6,6 @@ namespace TechBot.Library
|
|||
{
|
||||
public abstract class XmlLookupCommand : XmlCommand
|
||||
{
|
||||
protected string m_Text = null;
|
||||
|
||||
public virtual string Text
|
||||
{
|
||||
get { return Parameters; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue