def start(self):
try:
self.torrent_client = transmissionrpc.Client(
self.config.get('transmission', 'rpc_host'),
port=self.config.get('transmission', 'rpc_port'),
user=self.config['transmission']['rpc_user'],
password=self.config['transmission']['rpc_password'])
except transmissionrpc.error.TransmissionError:
print("ERROR: Couldn't connect to Transmission. Check rpc configuration.")
sys.exit()
try:
self.bot = telepot.Bot(self.config.get('telegram', 'bot_token'))
self.bot.setWebhook('') # Remove existent webhook
self.bot.message_loop(
self.handle_mesasge,
relax=self.config.getint('telegram', 'polling_interval'))
except telepot.exception.TelegramError:
print("ERROR: Couldn't start Telegram bot. Check telegram bot configuration.")
sys.exit()
transmission-telegram-remote.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录