Class Dialogue
表示一段对话
其本质上是一个FSM, 其状态由一字符串表示
FSM的初始状态为BEGIN, 可以自由设置中间状态
当FSM进入某个没有定义操作的状态时, FSM停止并回收
Inheritance
System.Object
Dialogue
Namespace: cqhttp.Cyan.Utils
Assembly: cqhttp.Cyan.dll
Syntax
public class Dialogue : object
Constructors
| Improve this Doc View SourceDialogue(Boolean)
表示一段对话
Declaration
public Dialogue(bool blockEvent = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | blockEvent | 是否在处理消息时进行阻断, 不交由其它逻辑进行处理 |
Properties
| Improve this Doc View SourceblockEvent
Declaration
public bool blockEvent { get; }
Property Value
Type | Description |
---|---|
System.Boolean | 是否在处理消息时进行阻断, 不交由其它逻辑进行处理 也就是说, 若此值为真, 则OnEvent与OnEventAsync不会收到被这一FSM处理过的上报消息事件 |
Item[String]
用于设置某一状态下FSM的行为。
Declaration
public Func<CQApiClient, Message, Task<string>> this[string state_name] { set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | state_name |
Property Value
Type | Description |
---|---|
Func<CQApiClient, Message, Task<System.String>> |