private static async Task Client_MessageUpdated(Discord.Cacheable <Discord.IMessage, ulong> old, SocketMessage updated, ISocketMessageChannel arg3) { IMessage baseMessage = await old.GetOrDownloadAsync(); IUserMessage oldMessage = baseMessage as IUserMessage; IUserMessage newMessage = updated as IUserMessage; SocketTextChannel guildChannel = arg3 as SocketTextChannel; if ((oldMessage != null) && newMessage != null && guildChannel != null && !oldMessage.Author.IsBot && !oldMessage.Author.IsWebhook) { if (TryGetLogChannel(guildChannel.Guild, DiscordEventType.MessageUpdated, out SocketTextChannel logChannel, out EmbedBuilder embed)) { StringBuilder description = new StringBuilder($"Location: {guildChannel.Mention}\n" + $"Author: {oldMessage.Author} ({oldMessage.Author.Mention})\n" + $"Message Link: {oldMessage.GetMessageURL(guildChannel.Guild.Id)}\n"); if (newMessage.IsPinned != oldMessage.IsPinned) { description.Append("Pinned: "); description.AppendLine(newMessage.IsPinned.ToString(CultureInfo.InvariantCulture)); } bool resend = false; if (newMessage.EditedTimestamp != oldMessage.EditedTimestamp) { embed.Title = "Message edited. For a copy see below"; resend = true; } else { embed.Title = "Message updated"; } embed.Description = description.ToString(); await logChannel.SendEmbedAsync(embed); if (resend) { await logChannel.SendMessageAsync(oldMessage.Content.Replace("@everyone", "@-everyone").Replace("<@&", "<Role-").Replace("<@", ",<@User-").MaxLength(EmbedHelper.MESSAGECONTENT_MAX)); } } } }