public void Execute() { if (OriginalMessage.FileUrl == null) { BotsoHipchatHelpers.SendError("To add a script you must include a script file.", OriginalMessage.RoomId); return; } if (!Arguments.Any()) { BotsoHipchatHelpers.SendError("The add script commandlet requires one paramater, the pattern to register to the script", OriginalMessage.RoomId); return; } var script = new HipchatScript() { Filename = "testFile.js", Pattern = Arguments.First().Value, Priority = 1 }; BotsoHipchatHelpers.SendError(script.Dump(), OriginalMessage.RoomId); }
public void SaveScript(HipchatScript script) { var typedClient = _client.As<HipchatScript>(); typedClient.SetEntry(script.Pattern, script); }