use dict as argument for rpc.send_msg

This commit is contained in:
gcarq
2018-06-25 00:04:27 +02:00
parent 96a405feb7
commit 4cb1aa1d97
8 changed files with 89 additions and 68 deletions

View File

@@ -4,7 +4,7 @@
This module manage Telegram communication
"""
import logging
from typing import Any, Callable
from typing import Any, Callable, Dict
from tabulate import tabulate
from telegram import Bot, ParseMode, ReplyKeyboardMarkup, Update
@@ -110,9 +110,9 @@ class Telegram(RPC):
"""
self._updater.stop()
def send_msg(self, msg: str) -> None:
def send_msg(self, msg: Dict[str, str]) -> None:
""" Send a message to telegram channel """
self._send_msg(msg)
self._send_msg('*Status:* `{status}`'.format(**msg))
@authorized_only
def _status(self, bot: Bot, update: Update) -> None: