code: private void dispatchServerChannelChangeOverwrittenPermissionsEvent(
              ServerChannel channel, Permissions newPermissions, Permissions oldPermissions, DiscordEntity entity) {
          if (newPermissions.equals(oldPermissions)) {
              // This can be caused by adding a user/role in a channels overwritten permissions without modifying
              // any of its values. We don't need to dispatch an event for this.
              return;
          }
          ServerChannelChangeOverwrittenPermissionsEvent event =
                  new ServerChannelChangeOverwrittenPermissionsEventImpl(
                          channel, newPermissions, oldPermissions, entity);
  
          api.getEventDispatcher().dispatchServerChannelChangeOverwrittenPermissionsEvent(
                  (DispatchQueueSelector) channel.getServer(),
                  (entity instanceof Role) ? (Role) entity : null,
                  channel.getServer(),
                  channel,
                  (entity instanceof User) ? (User) entity : null,
                  event);
      }
docs: Dispatches a ServerChannelChangeOverwrittenPermissionsEvent.
  
  @param channel The channel of the event.
  @param newPermissions The new overwritten permissions.
  @param oldPermissions The old overwritten permissions.
  @param entity The entity of the event.