t

ackcord.commands

MessageParserInstances

trait MessageParserInstances extends AnyRef

Source
MessageParser.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MessageParserInstances
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. val allStringsParser: MessageParser[List[String]]

    A parser that will return all the strings passed to it.

  2. implicit val booleanParser: MessageParser[Boolean]
  3. implicit val byteParser: MessageParser[Byte]
  4. implicit val channelParser: MessageParser[Channel]
  5. val channelRegex: Regex
  6. implicit val doubleParser: MessageParser[Double]
  7. implicit val emojiParser: MessageParser[Emoji]
  8. val emojiRegex: Regex
  9. def fail[A](e: String): MessageParser[A]

    A message parser that always fails.

    A message parser that always fails.

    e

    The error to return

  10. implicit val floatParser: MessageParser[Float]
  11. def fromEither[A](f: (String) => Either[String, A]): MessageParser[A]

    Parse a string into a try, where the left contains the error message

    Parse a string into a try, where the left contains the error message

    A

    The type to parse

    f

    The function to transform the string with.

  12. def fromString[A](f: (String) => A): MessageParser[A]

    Create a parser from a string

    Create a parser from a string

    A

    The type to parse

    f

    The function to transform the string with

  13. def fromTry[A](f: (String) => Try[A]): MessageParser[A]

    Parse a string with a try

    Parse a string with a try

    A

    The type to parse

    f

    The function to transform the string with.

  14. implicit val guildChannelParser: MessageParser[GuildChannel]
  15. implicit val intParser: MessageParser[Int]
  16. def literal(lit: String, caseSensitive: Boolean = true): MessageParser[String]

    Matches a literal string

    Matches a literal string

    lit

    The string to match

    caseSensitive

    If the match should be case insensitive

  17. implicit val longParser: MessageParser[Long]
  18. implicit val notUsedParser: MessageParser[NotUsed]

    A parser that will only succeed if there are no strings left.

  19. def oneOf[A](seq: Seq[MessageParser[A]]): MessageParser[A]

    Matches one of the parsers passed in

    Matches one of the parsers passed in

    seq

    The parsers to try

  20. implicit def optional[A](implicit parser: MessageParser[A]): MessageParser[Option[A]]
  21. def orElseWith[A, B, C](parse1: MessageParser[A], parse2: MessageParser[B])(combine: (Either[A, B]) => C): MessageParser[C]
  22. implicit val remainingStringParser: MessageParser[RemainingAsString]
  23. implicit val roleParser: MessageParser[Role]
  24. val roleRegex: Regex
  25. implicit val shortParser: MessageParser[Short]
  26. def startsWith(prefix: String, caseSensitive: Boolean = true, consumeAll: Boolean = false): MessageParser[String]

    Matches a string that starts with a prefix

    Matches a string that starts with a prefix

    prefix

    The prefix to look for

    caseSensitive

    If the matching should be case sensitive

    consumeAll

    If the whole string should be consumed if only part of it was matched

  27. implicit val stringParser: MessageParser[String]
  28. implicit val textChannelParser: MessageParser[TextChannel]
  29. implicit val textGuildChannelParser: MessageParser[TextGuildChannel]
  30. def unit: MessageParser[Unit]
  31. implicit val userParser: MessageParser[User]
  32. val userRegex: Regex
  33. def withTry[A](f: (String) => A): MessageParser[A]

    Parse a string with a function that can throw

    Parse a string with a function that can throw

    A

    The type to parse

    f

    The function to transform the string with. This can throw an exception

  34. def withTryCustomError[A](errorMessage: (String) => String)(f: (String) => A): MessageParser[A]

    Same as withTry but with a custom error.

    Same as withTry but with a custom error.

    A

    The type to parse

    errorMessage

    The error message to use

    f

    The function to transform the string with.