MessageComponentType.parse constructor

MessageComponentType.parse(
  1. int value
)

Parse a MessageComponentType from an int.

The value must be a valid message component type.

Implementation

factory MessageComponentType.parse(int value) => MessageComponentType.values.firstWhere(
      (type) => type.value == value,
      orElse: () => throw FormatException('Unknown message component type', value),
    );