本文整理汇总了Python中src.server.sessionhandler.SESSIONS.start_bot_session方法的典型用法代码示例。如果您正苦于以下问题:Python SESSIONS.start_bot_session方法的具体用法?Python SESSIONS.start_bot_session怎么用?Python SESSIONS.start_bot_session使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类src.server.sessionhandler.SESSIONS
的用法示例。
在下文中一共展示了SESSIONS.start_bot_session方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: start
# 需要导入模块: from src.server.sessionhandler import SESSIONS [as 别名]
# 或者: from src.server.sessionhandler.SESSIONS import start_bot_session [as 别名]
def start(self, ev_channel=None, rss_url=None, rss_rate=None):
"""
Start by telling the portal to start a new RSS session
ev_channel - key of the Evennia channel to connect to
rss_url - full URL to the RSS feed to subscribe to
rss_update_rate - how often for the feedreader to update
"""
global _SESSIONS
if not _SESSIONS:
from src.server.sessionhandler import SESSIONS as _SESSIONS
if ev_channel:
# connect to Evennia channel
channel = search.channel_search(ev_channel)
if not channel:
raise RuntimeError("Evennia Channel '%s' not found." % ev_channel)
channel = channel[0]
self.db.ev_channel = channel
if rss_url:
self.db.rss_url = rss_url
if rss_rate:
self.db.rss_rate = rss_rate
# instruct the server and portal to create a new session with
# the stored configuration
configdict = {"uid": self.dbid, "url": self.db.rss_url, "rate": self.db.rss_rate}
_SESSIONS.start_bot_session("src.server.portal.rss.RSSBotFactory", configdict)