示例#1
0
        public override async Task <CommandResult> Execute(CancellationToken token)
        {
            var isNumber = int.TryParse(Pid, out var pid);

            if (!isNumber)
            {
                await SendMessage("You gotta give me an id boss... ya know, a number?");

                return(CommandResult.Failed);
            }

            var result = _commandEngine.KillProcess(pid);

            if (!result)
            {
                await SendMessage("I couldn't kill that process, are you sure it exists?");

                return(CommandResult.Failed);
            }
            await SendMessage("Done. (In cold mechanical tone)");

            return(CommandResult.Success);
        }