Created Helper classes for Discord Bot and Plugin

This commit is contained in:
Brett Hewitson 2021-12-04 15:01:47 +10:00
parent 8d9d208a66
commit d526a3f457
8 changed files with 74 additions and 35 deletions

View file

@ -0,0 +1,18 @@
using ServerManagerTool.Lib;
using System.Collections.Generic;
using System.Linq;
namespace ServerManagerTool.Utils
{
internal static class DiscordPluginHelper
{
public static IList<Plugin.Common.Lib.Profile> FetchProfiles()
{
return ServerManager.Instance.Servers.Select(s => new ServerManagerTool.Plugin.Common.Lib.Profile()
{
ProfileName = s?.Profile?.ProfileName ?? string.Empty,
InstallationFolder = s?.Profile?.InstallDirectory ?? string.Empty
}).ToList();
}
}
}