public async Task Install(IServiceProvider map) { _client = map.GetService <DiscordSocketClient>(); _config = map.GetService <Config>(); _newModsetProvider = new ModsetProvider(map.GetService <IModsetsApiClient>()); _legacyModsetProvider = new LegacyModsetProvider(); _services = map; // Hook the MessageReceived event into our command handler _client.GuildAvailable += Load; }
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."); } }