trait MessageParserInstances extends AnyRef
- Alphabetic
- By Inheritance
- MessageParserInstances
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- val allStringsParser: MessageParser[List[String]]
A parser that will return all the strings passed to it.
- implicit val booleanParser: MessageParser[Boolean]
- implicit val byteParser: MessageParser[Byte]
- implicit val channelParser: MessageParser[Channel]
- val channelRegex: Regex
- implicit val doubleParser: MessageParser[Double]
- implicit val emojiParser: MessageParser[Emoji]
- val emojiRegex: Regex
- def fail[A](e: String): MessageParser[A]
A message parser that always fails.
A message parser that always fails.
- e
The error to return
- implicit val floatParser: MessageParser[Float]
- 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.
- 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
- 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.
- implicit val guildChannelParser: MessageParser[GuildChannel]
- implicit val intParser: MessageParser[Int]
- 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
- implicit val longParser: MessageParser[Long]
- implicit val notUsedParser: MessageParser[NotUsed]
A parser that will only succeed if there are no strings left.
- 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
- implicit def optional[A](implicit parser: MessageParser[A]): MessageParser[Option[A]]
- def orElseWith[A, B, C](parse1: MessageParser[A], parse2: MessageParser[B])(combine: (Either[A, B]) => C): MessageParser[C]
- implicit val remainingStringParser: MessageParser[RemainingAsString]
- implicit val roleParser: MessageParser[Role]
- val roleRegex: Regex
- implicit val shortParser: MessageParser[Short]
- 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
- implicit val stringParser: MessageParser[String]
- implicit val textChannelParser: MessageParser[TextChannel]
- implicit val textGuildChannelParser: MessageParser[TextGuildChannel]
- def unit: MessageParser[Unit]
- implicit val userParser: MessageParser[User]
- val userRegex: Regex
- 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
- 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.