code: public static long getEffectivePermission(Channel channel, Role role)
      {
          Checks.notNull(channel, "Channel");
          Checks.notNull(role, "Role");
  
          Guild guild = channel.getGuild();
          if (!guild.equals(role.getGuild()))
              throw new IllegalArgumentException("Provided channel and role are not of the same guild!");
  
          long permissions = role.getPermissionsRaw() | guild.getPublicRole().getPermissionsRaw();
  
          PermissionOverride publicOverride = channel.getPermissionOverride(guild.getPublicRole());
          PermissionOverride roleOverride = channel.getPermissionOverride(role);
  
          if (publicOverride != null)
          {
              permissions &= ~publicOverride.getDeniedRaw();
              permissions |= publicOverride.getAllowedRaw();
          }
  
          if (roleOverride != null)
          {
              permissions &= ~roleOverride.getDeniedRaw();
              permissions |= roleOverride.getAllowedRaw();
          }
  
          return permissions;
      }
docs: Gets the {@code long} representation of the effective permissions allowed for this {@link net.dv8tion.jda.core.entities.Role Role}
  in this {@link net.dv8tion.jda.core.entities.Channel Channel}. This can be used in conjunction with
  {@link net.dv8tion.jda.core.Permission#getPermissions(long) Permission.getPermissions(long)} to easily get a list of all
  {@link net.dv8tion.jda.core.Permission Permissions} that this role can use in this {@link net.dv8tion.jda.core.entities.Channel Channel}.
  
  @param  channel
  The {@link net.dv8tion.jda.core.entities.Channel Channel} in which permissions are being checked.
  @param  role
  The {@link net.dv8tion.jda.core.entities.Role Role} whose permissions are being checked.
  
  @throws IllegalArgumentException
  if any of the provided parameters is {@code null}
  or the provided entities are not from the same guild
  
  @return The {@code long} representation of the effective permissions that this {@link net.dv8tion.jda.core.entities.Role Role}
  has in this {@link net.dv8tion.jda.core.entities.Channel Channel}