adds a optional 3rd arg for chat level (Shout/Whisper)
This commit is contained in:
parent
dea834a427
commit
509425cd7e
1 changed files with 11 additions and 5 deletions
|
|
@ -5,21 +5,27 @@ namespace BSB.Commands.Chat
|
|||
{
|
||||
class Say : CoreCommand_1arg
|
||||
{
|
||||
public override string[] ArgTypes { get { return new[] { "Mixed","Text" }; } }
|
||||
public override string[] ArgHints { get { return new[] { "Message or channel","Message" }; } }
|
||||
public override string Helpfile { get { return "Makes the bot talk via chat<br/>Example: say|||Hello<br/>Example: say|||12~#~Goodbye"; } }
|
||||
public override string[] ArgTypes { get { return new[] { "Mixed","Text","Text" }; } }
|
||||
public override string[] ArgHints { get { return new[] { "Message or channel","Message","Chat level" }; } }
|
||||
public override string Helpfile { get { return "Makes the bot talk via chat<br/>Example: say|||Hello<br/>Example: say|||12~#~Goodbye<br/>Example: say|||12~#~Goodbye~#~Shout<br/>Chat levels [Arg 3]:<br/> Whisper<br/> Shout"; } }
|
||||
public override bool CallFunction(string[] args)
|
||||
{
|
||||
if(base.CallFunction(args) == true)
|
||||
{
|
||||
string message = args[0];
|
||||
int channel = 0;
|
||||
if (args.Count() == 2)
|
||||
ChatType ChatLevel = ChatType.Normal;
|
||||
if (args.Count() >= 2)
|
||||
{
|
||||
message = args[1];
|
||||
int.TryParse(args[0], out channel);
|
||||
if (args.Count() == 3)
|
||||
{
|
||||
if (args[2] == "Shout") ChatLevel = ChatType.Shout;
|
||||
else if (args[2] == "Whisper") ChatLevel = ChatType.Whisper;
|
||||
}
|
||||
}
|
||||
bot.GetClient.Self.Chat(message, channel, ChatType.Normal);
|
||||
bot.GetClient.Self.Chat(message, channel, ChatLevel);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue