public override async Task OnMessageDeleted(MessageContext context) { if (!context.User.IsBot && !MessageSystem.MessageIgnored(context.Message.Id)) { await TrySendEmbed(context, embed => embed .WithTitle($"Message deleted in #{context.Channel.Name}") .WithDescription(context.Message.Content) ); } }
public async Task Delete() { ulong id = message.Id; if (!MessageSystem.MessageIgnored(id)) { MessageSystem.IgnoreMessage(id); if (socketTextChannel == null || server.CurrentUser.HasChannelPermission(socketTextChannel, DiscordPermission.ManageMessages)) { await message.DeleteAsync(); } } }
public override async Task OnMessageUpdated(MessageContext context, IMessage oldMessage) { if (context.User.IsBot || MessageSystem.MessageIgnored(oldMessage.Id)) { return; } var newMessage = context.Message; if (newMessage.Content == oldMessage.Content) { return; } await TrySendEmbed(context, embed => embed .WithTitle($"Message updated in #{context.Channel.Name}") .WithDescription($"**Before:** {oldMessage.Content}\r\n**After:** ឵ {newMessage.Content}\r\n[[Jump to message]]({newMessage.GetJumpUrl()})") //TODO: This uses blank characters that should be put into an util method. ); }