typeParameterRequired static method

TeleverseException typeParameterRequired(
  1. String method,
  2. Type type,
  3. List<Type> expected
)

Exception thrown when the timeout exception occurs.

Implementation

static TeleverseException typeParameterRequired(
  String method,
  Type type,
  List<Type> expected,
) {
  return TeleverseException(
    "Type Parameter Required.",
    description:
        "Televerse is a strictly typed library and does not allows usage of dynamic types. This exception is thrown either\n"
        "   1. when you do not mention type parameter when it is required or\n"
        "   2. when you've passed the type [$type] where types [${expected.join(', ')}] are expected.\n\n"
        "If you are using the `Context.$method` method, try `ctx.$method<bool>(...)` for inline messages or `ctx.$method<Message>(...)` otherwise.",
    type: TeleverseExceptionType.invalidParameter,
  );
}