本文整理汇总了Python中slackbot.bot.Bot方法的典型用法代码示例。如果您正苦于以下问题:Python bot.Bot方法的具体用法?Python bot.Bot怎么用?Python bot.Bot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类slackbot.bot
的用法示例。
在下文中一共展示了bot.Bot方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from slackbot import bot [as 别名]
# 或者: from slackbot.bot import Bot [as 别名]
def main():
"""???????parse???slackbot??????
1. configparser????????????
2. ??????? `alembic` ??????????????????
3. ??????????DB?????????
4. slackbot??????
"""
parser = get_argparser()
args = parser.parse_args()
conf = ConfigParser()
conf.read_file(args.config)
# ???????????? ini ????????????
conf["alembic"]['sqlalchemy.url'] = SQLALCHEMY_URL
conf["alembic"]['sqlalchemy.echo'] = SQLALCHEMY_ECHO
if SQLALCHEMY_POOL_SIZE:
conf["alembic"]['sqlalchemy.pool_size'] = SQLALCHEMY_POOL_SIZE
if not conf.has_section('alembic'):
raise NoSectionError('alembic')
init_dbsession(conf['alembic'])
bot = Bot()
bot.run()
示例2: run_bot
# 需要导入模块: from slackbot import bot [as 别名]
# 或者: from slackbot.bot import Bot [as 别名]
def run_bot():
bot = Bot()
bot.run()
示例3: main
# 需要导入模块: from slackbot import bot [as 别名]
# 或者: from slackbot.bot import Bot [as 别名]
def main():
bot = Bot()
bot.run()
示例4: __get_slackclient
# 需要导入模块: from slackbot import bot [as 别名]
# 或者: from slackbot.bot import Bot [as 别名]
def __get_slackclient(self):
stack = inspect.stack()
for frame in [f[0] for f in stack]:
if 'self' in frame.f_locals:
instance = frame.f_locals['self']
if isinstance(instance, Bot):
return instance._client
示例5: main
# 需要导入模块: from slackbot import bot [as 别名]
# 或者: from slackbot.bot import Bot [as 别名]
def main():
kw = {
'format': '[%(asctime)s] | %(name)s | %(levelname)s | %(message)s',
'datefmt': '%m/%d/%Y %H:%M:%S',
'level': logging.DEBUG if settings.DEBUG else logging.INFO,
'stream': sys.stdout,
}
logging.basicConfig(**kw)
logging.getLogger('requests.packages.urllib3.connectionpool')\
.setLevel(logging.WARNING)
bot = Bot()
bot.run()
示例6: main
# 需要导入模块: from slackbot import bot [as 别名]
# 或者: from slackbot.bot import Bot [as 别名]
def main():
kw = {
'format': '[%(asctime)s] %(message)s',
'datefmt': '%m/%d/%Y %H:%M:%S',
'level': logging.DEBUG if settings.DEBUG else logging.INFO,
'stream': sys.stdout,
}
logging.basicConfig(**kw)
logging.getLogger('requests.packages.urllib3.connectionpool').setLevel(logging.WARNING)
bot = Bot()
bot.run()
示例7: main
# 需要导入模块: from slackbot import bot [as 别名]
# 或者: from slackbot.bot import Bot [as 别名]
def main():
rtm_reaction_loop = threading.Thread(target=connect)
rtm_reaction_loop.start()
bot = Bot()
bot.run()