本文整理匯總了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()