use of org.javacord.api.event.channel.server.ServerChannelChangeOverwrittenPermissionsEvent in project Javacord by BtoBastian.
the class ChannelUpdateHandler method dispatchServerChannelChangeOverwrittenPermissionsEvent.
/**
* Dispatches a ServerChannelChangeOverwrittenPermissionsEvent.
*
* @param channel The channel of the event.
* @param newPermissions The new overwritten permissions.
* @param oldPermissions The old overwritten permissions.
* @param entityId The id of the entity.
* @param entity The entity of the event.
*/
private void dispatchServerChannelChangeOverwrittenPermissionsEvent(ServerChannel channel, Permissions newPermissions, Permissions oldPermissions, long entityId, DiscordEntity entity) {
if (newPermissions.equals(oldPermissions)) {
// any of its values. We don't need to dispatch an event for this.
return;
}
ServerChannelChangeOverwrittenPermissionsEvent event = new ServerChannelChangeOverwrittenPermissionsEventImpl(channel, newPermissions, oldPermissions, entityId, entity);
api.getEventDispatcher().dispatchServerChannelChangeOverwrittenPermissionsEvent((DispatchQueueSelector) channel.getServer(), (entity instanceof Role) ? (Role) entity : null, channel.getServer(), channel, (entity instanceof User) ? (User) entity : null, event);
}
Aggregations