class Bot[F[_]] extends AnyRef
An instance which can communicate with Telegram service and interact with other Telegram users in a certain predefined way
- Alphabetic
- By Inheritance
- Bot
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def follow(scenarios: Scenario[F, Unit]*): Stream[F, Update]
Defines the behavior of the bot.
Defines the behavior of the bot.
Bot is reacting to the incoming messages following provided scenarios. When the user input is not matching/stops matching particular scenario it means that current interaction is not described with this scenario and bot will not continue acting it out.
- returns
Stream of all updates which your bot receives from Telegram service
val scenario = for { chat <- Scenario.start(command("first").chat) _ <- Scenario.eval(chat.send("first message received")) _ <- Scenario.next(command("second")) _ <- Scenario.eval(chat.send("second message received")) } user > /first bot > first message received user > something else *end of the scenario* user > /first bot > first message received user > /second bot > second message received *end of the scenario*
Each scenario is handled concurrently across all chats, which means that scenario cannot be blocked by any other scenario being in progress. All the behavior is suspended as an effect of resulting stream, without changing its elements. Also, result stream is not halted by the execution of any particular scenario.
Example: - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def updates: Stream[F, Update]
Stream of all updates which your bot receives from Telegram service
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()