public async Task Modlist([Remainder] string modsetNameOrUrl) { var mission = SignupsData.GetCurrentlyEditedMission(Context.User.Id); if (mission != null) { var modsetName = ModsetProvider.GetModsetNameFromUrl(modsetNameOrUrl); await ModsetProvider.GetModsetDownloadUrl(modsetName).Match( onSuccess: url => { mission.ModlistUrl = mission.Modlist = url.Replace(" ", "%20"); mission.ModlistName = modsetName; return(ReplyAsync($"Modset {modsetName} was found under {mission.ModlistUrl}.")); }, onFailure: error => ReplyAsync(error)); } else { await ReplyAsync("Najpierw zdefiniuj nazwę misji cymbale."); } }
private string GetModsetNameFromUnknownUrl(string unknownUrl) { return(unknownUrl.Contains("modlist.armaforces.com") ? _legacyModsetProvider.GetModsetNameFromUrl(unknownUrl) : _newModsetProvider.GetModsetNameFromUrl(unknownUrl)); }