本文整理汇总了Python中state.State.forceState方法的典型用法代码示例。如果您正苦于以下问题:Python State.forceState方法的具体用法?Python State.forceState怎么用?Python State.forceState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类state.State
的用法示例。
在下文中一共展示了State.forceState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: respond
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import forceState [as 别名]
def respond(context):
State.forceState(SolicitUser,{'_nick': context['_nick']})
solicitations = ["Do you want to hear some gossip?",
"Would you like me to tell you some gossip?",
"I know something really interesting. Would you like to hear about it?",
"I have some gossip, would you like me to share it with you?"]
rand_ndx = random.randint(0, len(solicitations) - 1)
return "Midnight. " + solicitations[rand_ndx]
示例2: respond
# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import forceState [as 别名]
def respond(context):
if context['type'] == 'well_being':
InquiryState.responce_type = 1
State.forceState(SolicitUser,{'_nick': context['_nick']})
solicitations = ["Do you want to hear some gossip?",
"Would you like me to tell you some gossip?",
"I know something really interesting. Would you like to hear about it?",
"I have some gossip, would you like me to share it with you?"]
rand_ndx = random.randint(0, len(solicitations) - 1)
responses = ["I\'m doing awful. Thanks for asking. But maybe you could help. ",
"I am doing great, I keep hearing all these interesting rumors. ",
"Not bad, Could be better "]
rand_ndy = random.randint(0, len(responses) - 1)
return responses[rand_ndy] + solicitations[rand_ndx]
else:
InquiryState.responce_type = 0
return 'Not much, what\'s up with you?'