コード例 #1
0
ファイル: PyScriptService.cs プロジェクト: MatanRad/Matbot
        public PyScriptService(Bot bot, int hour, int minute, string file, Commands.PyScriptCommand.PyScriptOnce Once) : base(bot, file)
        {
            this.file  = file;
            ElapseTime = new TimeSpan(hour, minute, 0);

            if (!File.Exists(Path.Combine(PyScriptPath, file)))
            {
                Stop();
            }

            if (Once == Commands.PyScriptCommand.PyScriptOnce.once)
            {
                this.ElapseOnce = true;
            }
            else if (Once == Commands.PyScriptCommand.PyScriptOnce.onceuntiloutput)
            {
                StopAfterOutput = true;
            }
        }
コード例 #2
0
ファイル: PyScriptService.cs プロジェクト: MatanRad/Matbot
        public PyScriptService(Bot bot, int seconds, string file, Commands.PyScriptCommand.PyScriptOnce Once) : base(bot, file)
        {
            this.file   = file;
            ElapseEvery = TimeSpan.FromSeconds(seconds);

            if (!File.Exists(Path.Combine(PyScriptPath, file)))
            {
                Stop();
            }

            if (Once == Commands.PyScriptCommand.PyScriptOnce.once)
            {
                this.ElapseOnce = true;
            }
            else if (Once == Commands.PyScriptCommand.PyScriptOnce.onceuntiloutput)
            {
                StopAfterOutput = true;
            }
        }