コード例 #1
0
        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);
        }
コード例 #2
0
 public void SaveScript(HipchatScript script)
 {
     var typedClient = _client.As<HipchatScript>();
     typedClient.SetEntry(script.Pattern, script);
 }