Split the service and server functions

This commit is contained in:
Cyberboss
2017-11-12 23:48:54 -05:00
parent 6e54f622de
commit 1372f2daea
55 changed files with 1112 additions and 1129 deletions
@@ -0,0 +1,45 @@
using System.Collections.Generic;
namespace TGS.Server.ChatCommands
{
/// <summary>
/// Retrieve the list of test-merged github pull requests
/// </summary>
sealed class PullRequestsCommand : ChatCommand
{
/// <summary>
/// Construct a <see cref="PullRequestsCommand"/>
/// </summary>
public PullRequestsCommand()
{
Keyword = "prs";
}
/// <inheritdoc />
protected override ExitCode Run(IList<string> 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;
}
/// <inheritdoc />
public override string GetHelpText()
{
return "Gets the currently merged pull requests in the repository";
}
}
}