using System.Collections.Generic;
namespace TGServerService.ChatCommands
{
///
/// Retrieve the list of test-merged github pull requests
///
sealed class PullRequestsCommand : ChatCommand
{
///
/// Construct a
///
public PullRequestsCommand()
{
Keyword = "prs";
}
///
protected override ExitCode Run(IList parameters)
{
var PRs = Instance.MergedPullRequests(out string res);
if (PRs == null)
{
OutputProc(res);
return ExitCode.ServerError;
}
if (PRs.Count == 0)
OutputProc("None!");
else
{
res = "";
foreach (var I in PRs)
res += "#" + I.Number + " ";
OutputProc(res);
}
return ExitCode.Normal;
}
///
public override string GetHelpText()
{
return "Gets the currently merged pull requests in the repository";
}
}
}