diff --git a/Core/Commands/Chat/say.cs b/Core/Commands/Chat/say.cs index 5616e5e..3d484d6 100644 --- a/Core/Commands/Chat/say.cs +++ b/Core/Commands/Chat/say.cs @@ -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
Example: say|||Hello
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
Example: say|||Hello
Example: say|||12~#~Goodbye
Example: say|||12~#~Goodbye~#~Shout
Chat levels [Arg 3]:
Whisper
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;