Package 

Class CommandAvailabilityKt

    • Method Summary

      Modifier and Type Method Description
      final static Boolean isAvailableFor(Command $self, MessageAction action) Whether this Command is selectable in the composer given the currently-active composer action:
      • Edit → always false.

      • Reply → false for commands in the moderation_set (e.g. /mute, /ban); true otherwise.

      • null or any other action → true.

      final static List<Command> sortedByAvailability(List<Command> $self, MessageAction action) Returns a new list sorted by, in order:
      • Availability for action (available first).

      • Universal commands (set != "moderation_set") before contextual ones.

      The sort is stable, so within each group the input order is preserved.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isAvailableFor

         final static Boolean isAvailableFor(Command $self, MessageAction action)

        Whether this Command is selectable in the composer given the currently-active composer action:

        • Edit → always false.

        • Reply → false for commands in the moderation_set (e.g. /mute, /ban); true otherwise.

        • null or any other action → true.

        Parameters:
        action - The composer action currently active, or null when the composer is in its default state.
      • sortedByAvailability

         final static List<Command> sortedByAvailability(List<Command> $self, MessageAction action)

        Returns a new list sorted by, in order:

        • Availability for action (available first).

        • Universal commands (set != "moderation_set") before contextual ones.

        The sort is stable, so within each group the input order is preserved.

        Parameters:
        action - The composer action currently active, or null when the composer is in its default state.