Add API Context to Plugin Context
updated idea of @zbarahal’s PR (PR #20) to reflect the current master.
This commit is contained in:
parent
f785ed9a14
commit
1fb557b178
4 changed files with 21 additions and 4 deletions
|
@ -1,9 +1,12 @@
|
|||
#!/usr/bin/env python
|
||||
import sys
|
||||
import os
|
||||
sys.path.append(os.getcwd())
|
||||
|
||||
from argparse import ArgumentParser
|
||||
|
||||
import yaml
|
||||
from rtmbot import RtmBot
|
||||
import client
|
||||
|
||||
|
||||
def parse_args():
|
||||
|
@ -19,7 +22,7 @@ def parse_args():
|
|||
# load args with config path
|
||||
args = parse_args()
|
||||
config = yaml.load(open(args.config or 'rtmbot.conf', 'r'))
|
||||
bot = RtmBot(config)
|
||||
bot = client.init(config)
|
||||
try:
|
||||
bot.start()
|
||||
except KeyboardInterrupt:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue