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

@@ -2,7 +2,7 @@
This module contains class to manage RPC communications (Telegram, Slack, ...)
"""
import logging
from typing import List
from typing import List, Dict
from freqtrade.rpc.rpc import RPC
@@ -32,11 +32,14 @@ class RPCManager(object):
mod.cleanup()
del mod
def send_msg(self, msg: str) -> None:
def send_msg(self, msg: Dict[str, str]) -> None:
"""
Send given markdown message to all registered rpc modules
:param msg: message
:return: None
Send given message to all registered rpc modules.
A message consists of one or more key value pairs of strings.
e.g.:
{
'status': 'stopping bot'
}
"""
logger.info('Sending rpc message: %s', msg)
for mod in self.registered_modules: