Exemplo n.º 1
0
        private async Task OnRoleUpdated(SocketRole roleBefore, SocketRole roleAfter)
        {
            var guildId = await _servers.GetEventLogChannel(roleBefore.Guild.Id);

            if (!(_client.GetChannel(guildId) is ISocketMessageChannel logChannel))
            {
                return;
            }
            if (!Equals(roleBefore.Permissions, roleAfter.Permissions))
            {
                await EventExtension.RolePermUpdatedEmbed(roleBefore, roleAfter, logChannel);
            }
            if (!Equals(roleBefore.Name, roleAfter.Name))
            {
                await EventExtension.RoleNameUpdatedEmbed(roleBefore, roleAfter, logChannel);
            }
            if (!Equals(roleBefore.Color, roleAfter.Color))
            {
                await EventExtension.RoleColorUpdatedEmbed(roleBefore, roleAfter, logChannel);
            }
        }