Ejemplo n.º 1
0
        private async Task OnMessageUpdated(Cacheable <IMessage, ulong> messageCache, SocketMessage messageAfter,
                                            ISocketMessageChannel messageChannel)
        {
            if (!(messageAfter is SocketUserMessage message))
            {
                return;
            }

            if (message.Source != MessageSource.User)
            {
                return;
            }
            var guildId = await _servers.GetLogMessageChannel(((SocketGuildChannel)messageChannel).Guild.Id);

            var user    = messageAfter.Author;
            var content = messageCache.Value.Content;

            if (_client.GetChannel(guildId) is ISocketMessageChannel logChannel &&
                messageCache.HasValue &&
                !messageCache.Value.IsPinned &&
                !messageCache.Value.IsTTS)
            {
                await EventExtension.MessageUpdatedEmbed(user, logChannel, messageChannel, content, messageAfter);
            }
        }