public void AddMessage(DiscordMessage message) { DiscordChannel channel = Convert.ChangeType(message.Channel(), typeof(DiscordChannel)); messageHistoryCache.Add(message); if(currentChannel == message.Channel()) Dispatcher.Invoke(() => AppendMessage(message)); }
public void RemoveMessage(DiscordMessage m) { RemoveMessage(m.id, (m.Channel() as DiscordChannel).ID); }
public void AppendMessage(DiscordMessage message) { if(message.author != null && App.ClientConfiguration.Settings.IgnoredUserIDs.Contains(message.author.ID)) { return; } DiscordChannel channel = message.Channel() as DiscordChannel; var markdownParser = new Markdown(channel.parent, null); var blocks = markdownParser.Transform(message, $"{message.id};{channel.ID}"); richTextBox.Document.Blocks.AddRange(blocks); ToolTip = $"Sent at {message.timestamp}"; MessageIDs.Add(message.id); Messages.Add(message); }