Class VoiceChannelUpdatePositionEvent

  • All Implemented Interfaces:
    UpdateEvent<VoiceChannel,​java.lang.Integer>

    public class VoiceChannelUpdatePositionEvent
    extends GenericVoiceChannelUpdateEvent<java.lang.Integer>
    Indicates that a VoiceChannel's position changed.

    Can be used to get affected VoiceChannel, affected Guild and previous position.

    Identifier: position

    • Constructor Detail

      • VoiceChannelUpdatePositionEvent

        public VoiceChannelUpdatePositionEvent​(JDA api,
                                               long responseNumber,
                                               VoiceChannel channel,
                                               int oldPosition)
    • Method Detail

      • getOldPosition

        public int getOldPosition()
        The old position
        Returns:
        The old position
      • getNewPosition

        public int getNewPosition()
        The new position
        Returns:
        The new position
      • getPropertyIdentifier

        public java.lang.String getPropertyIdentifier()
        Description copied from interface: UpdateEvent
        The field name for the updated property

        Example

        
         @Override
         public void onGenericRoleUpdate(GenericRoleUpdateEvent event)
         {
             switch (event.getPropertyIdentifier())
             {
             case RoleUpdateColorEvent.IDENTIFIER:
                 System.out.printf("Updated color for role: %s%n", event);
                 break;
             case RoleUpdatePositionEvent.IDENTIFIER:
                 RoleUpdatePositionEvent update = (RoleUpdatePositionEvent) event;
                 System.out.printf("Updated position for role: %s raw(%s->%s)%n", event, update.getOldPositionRaw(), update.getNewPositionRaw());
                 break;
             default: return;
             }
         }
         
        Returns:
        The name of the updated property
      • getOldValue

        public java.lang.Integer getOldValue()
        Description copied from interface: UpdateEvent
        The old value
        Returns:
        The old value
      • getNewValue

        public java.lang.Integer getNewValue()
        Description copied from interface: UpdateEvent
        The new value
        Returns:
        The new value