/// <summary> /// Runs updates to the system read from the Silph road. /// </summary> /// <param name="guilds">List of guilds the bot is currently in.</param> /// <returns>Completed Task.</returns> public async Task RunSilphUpdate(List <SocketGuild> guilds) { UpdatePokemonNameList(); UpdateMoveNameList(); UpdateEggList(); UpdateRocketList(); Dictionary <int, List <string> > newBosses = SilphData.GetRaidBosses(); bool bossesChanged = RaidBosses.Keys.Count != newBosses.Keys.Count || !RaidBosses.Keys.All(newBosses.Keys.Contains); foreach (int tier in RaidBosses.Keys) { bossesChanged = bossesChanged || RaidBosses[tier].Count != newBosses[tier].Count || !RaidBosses[tier].All(newBosses[tier].Contains); } if (bossesChanged) { if (SilphData.GetRaidBossesConfirmed()) { UpdateRaidBossList(); SocketGuild emoteServer = guilds.FirstOrDefault(x => x.Name.Equals(Global.EMOTE_SERVER, StringComparison.OrdinalIgnoreCase)); GuildEmote[] previousEmotes = emoteServer.Emotes.ToArray(); foreach (GuildEmote emote in emoteServer.Emotes) { await emoteServer.DeleteEmoteAsync(emote); } foreach (KeyValuePair <int, List <string> > tier in RaidBosses) { foreach (string boss in tier.Value) { string fileName = GetPokemonPicture(boss); CopyFile(fileName); Image img = new Image(fileName); await emoteServer.CreateEmoteAsync(fileName.Remove(fileName.Length - 4), img); img.Dispose(); DeleteFile(fileName); } } Dictionary <ulong, ulong> channels = Instance().GetNotificationChannels(); foreach (KeyValuePair <ulong, ulong> chan in channels) { SocketGuild guild = guilds.FirstOrDefault(x => x.Id == chan.Key); ISocketMessageChannel channel = (ISocketMessageChannel)guild.Channels.FirstOrDefault(x => x.Id == chan.Value); await ClearNotifyMessage(guild, channel.Id, previousEmotes.ToArray()); await SetNotifyMessage(guild, channel, emoteServer.Emotes.ToArray()); } } } }
public virtual Task DeleteEmoteAsync(GuildEmote emote, RequestOptions?options = null) { return(_socketGuild.DeleteEmoteAsync(emote, options)); }
public Task DeleteEmoteAsync(GuildEmote emote, RequestOptions options = null) { return(Guild.DeleteEmoteAsync(emote, options)); }