SecondBot/Core/Commands/Chat/say.cs
2020-04-29 20:23:52 +01:00

31 lines
1 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using OpenMetaverse;
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 bool CallFunction(string[] args)
{
if(base.CallFunction(args) == true)
{
string message = args[0];
int channel = 0;
if (args.Count() == 2)
{
message = args[1];
int.TryParse(args[0], out channel);
}
bot.GetClient.Self.Chat(message, channel, ChatType.Normal);
return true;
}
return false;
}
}
}