Esempio n. 1
0
 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)
                            );
     }
 }
Esempio n. 2
0
        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();
                }
            }
        }
Esempio n. 3
0
        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.
                               );
        }