public async void SendMessage(string bossName, int minutesLeft, DateTime bossTime, Color color) { SocketTextChannel channel = MKManager.GetInstance().client.GetChannel(Config.BossChannelID) as SocketTextChannel; EmbedBuilder embedBuilder = new EmbedBuilder(); //Title embedBuilder.Title = bossName; //Color embedBuilder.Color = color; //Description if (minutesLeft == 0) { embedBuilder.AddField($"Live!", "May the RNG be with you!", false); } else { embedBuilder.AddField($"Will appear in {minutesLeft} minutes!", $"Spawn at {bossTime.ToString("HH:mm")}", false); } //Image string imagePath = $"src/MK.Modules/BlackDesert/BossTimer/Data/Images/{bossName.ToLower()}.png"; embedBuilder.ThumbnailUrl = $"attachment://{bossName.ToLower()}.png"; await channel.SendFileAsync(imagePath, "", false, embedBuilder.Build()); }
public async void EraseMessages() { SocketTextChannel channel = MKManager.GetInstance().client.GetChannel(Config.BossChannelID) as SocketTextChannel; var messages = await channel.GetMessagesAsync().FlattenAsync(); await channel.DeleteMessagesAsync(messages); }