# Buggy code
def send_msg(self, msg: Dict[str, Any]) -> None:
    """Send a message to telegram channel"""
    try:
        if msg["type"] == RPCMessageType.BUY_NOTIFICATION:
            valuedict = self._config["webhook"].get("webhookbuy", None)
        elif msg["type"] == RPCMessageType.SELL_NOTIFICATION:
            valuedict = self._config["webhook"].get("webhooksell", None)
        elif msg["type"] == RPCMessageType.STATUS_NOTIFICATION:
            valuedict = self._config["webhook"].get("webhookstatus", None)
        else:
            raise NotImplementedError("Unknown message type: {}".format(msg["type"]))
        if not valuedict:
            logger.info("Message type %s not configured for webhooks", msg["type"])
            return

        payload = {key: value.format(**msg) for (key, value) in valuedict.items()}
        self._send_msg(payload)
    except KeyError as exc:
        logger.exception(
            "Problem calling Webhook. Please check your webhook configuration. "
            "Exception: %s",
            exc,
        )


# Traceback (NotImplementedError)
source .env/bin/activate; freqtrade -c config-Strategy110.json -s Strategy110 --strategy-path /home/freqtrade/freqtrade/user_data/strategies/
2019-08-29 22:59:24,229 - freqtrade.loggers - INFO - Verbosity set to 0
2019-08-29 22:59:24,230 - freqtrade.configuration.configuration - INFO - Using additional Strategy lookup path: /home/freqtrade/freqtrade/user_data/strategies/
2019-08-29 22:59:24,230 - freqtrade.configuration.configuration - INFO - Dry run is enabled
2019-08-29 22:59:24,230 - freqtrade.configuration.configuration - INFO - Using DB: "sqlite:///strategy1110.dryrun.sqlite"
2019-08-29 22:59:24,230 - freqtrade.configuration.configuration - WARNING - `forcebuy` RPC message enabled.
2019-08-29 22:59:24,230 - freqtrade.configuration.check_exchange - INFO - Checking exchange...
2019-08-29 22:59:24,230 - freqtrade.configuration.check_exchange - INFO - Exchange "binance" is officially supported by the Freqtrade development team.
2019-08-29 22:59:24,230 - freqtrade.configuration.configuration - INFO - Using max_open_trades: 2 ...
2019-08-29 22:59:24,230 - freqtrade.configuration.configuration - INFO - Using data directory: user_data/data/binance ...
2019-08-29 22:59:24,230 - freqtrade.configuration.configuration - INFO - Runmode set to RunMode.DRY_RUN.
2019-08-29 22:59:24,230 - freqtrade.freqtradebot - INFO - Starting freqtrade 2019.7-dev
2019-08-29 22:59:24,234 - freqtrade.resolvers.iresolver - INFO - Using resolved strategy Strategy110 from '/home/freqtrade/freqtrade/user_data/strategies/Strategy110.py'...
-- (redaction) --
2019-08-29 22:59:24,236 - freqtrade.rpc.rpc_manager - INFO - Enabling rpc.telegram ...
2019-08-29 22:59:24,273 - freqtrade.rpc.telegram - INFO - rpc.telegram is listening for following commands: [['status'], ['profit'], ['balance'], ['start'], ['stop'], ['forcesell'], ['forcebuy'], ['performance'], ['daily'], ['count'], ['reload_conf'], ['stopbuy'], ['whitelist'], ['blacklist'], ['edge'], ['help'], ['version']]
2019-08-29 22:59:24,284 - freqtrade.rpc.rpc_manager - INFO - Enabling rpc.webhook ...
2019-08-29 22:59:24,285 - freqtrade.rpc.rpc_manager - INFO - Enabling rpc.api_server
2019-08-29 22:59:24,325 - freqtrade.rpc.api_server - INFO - Starting HTTP Server at 127.0.0.1:10110
2019-08-29 22:59:24,325 - freqtrade.exchange.exchange - INFO - Instance is running with dry_run enabled
2019-08-29 22:59:24,326 - freqtrade.rpc.api_server - INFO - Starting Local Rest Server.
2019-08-29 22:59:24,326 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'enableRateLimit': True}
2019-08-29 22:59:24,327 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'enableRateLimit': True, 'rateLimit': 200}
2019-08-29 22:59:24,334 - freqtrade.exchange.exchange - INFO - Using Exchange "Binance"
2019-08-29 22:59:24,738 - freqtrade.resolvers.exchange_resolver - INFO - Using resolved exchange 'Binance'...
2019-08-29 22:59:24,738 - freqtrade.wallets - INFO - Wallets synced.
2019-08-29 22:59:24,738 - freqtrade.resolvers.iresolver - WARNING - Path "/home/freqtrade/freqtrade/user_data/pairlist" does not exist.
2019-08-29 22:59:24,739 - freqtrade.resolvers.iresolver - INFO - Using resolved pairlist StaticPairList from '/home/freqtrade/freqtrade/freqtrade/pairlist/StaticPairList.py'...
2019-08-29 22:59:24,748 - freqtrade.rpc.rpc_manager - INFO - Sending rpc message: {'type': status, 'status': 'running'}
2019-08-29 22:59:25,442 - freqtrade.worker - INFO - Changing state to: RUNNING
2019-08-29 22:59:25,442 - freqtrade.rpc.rpc_manager - INFO - Sending rpc message: {'type': warning, 'status': 'Dry run is enabled. All trades are simulated.'}
2019-08-29 22:59:25,699 - freqtrade - ERROR - Fatal exception!
Traceback (most recent call last):
File "/home/freqtrade/freqtrade/freqtrade/main.py", line 49, in main
worker.run()
File "/home/freqtrade/freqtrade/freqtrade/worker.py", line 72, in run
state = self._worker(old_state=state)
File "/home/freqtrade/freqtrade/freqtrade/worker.py", line 94, in _worker
self.freqtrade.startup()
File "/home/freqtrade/freqtrade/freqtrade/freqtradebot.py", line 103, in startup
self.rpc.startup_messages(self.config, self.pairlists)
File "/home/freqtrade/freqtrade/freqtrade/rpc/rpc_manager.py", line 65, in startup_messages
'status': 'Dry run is enabled. All trades are simulated.'
File "/home/freqtrade/freqtrade/freqtrade/rpc/rpc_manager.py", line 59, in send_msg
mod.send_msg(msg)
File "/home/freqtrade/freqtrade/freqtrade/rpc/webhook.py", line 49, in send_msg
raise NotImplementedError('Unknown message type: {}'.format(msg['type']))
NotImplementedError: Unknown message type: RPCMessageType.WARNING_NOTIFICATION
2019-08-29 22:59:25,699 - freqtrade.rpc.rpc_manager - INFO - Sending rpc message: {'type': status, 'status': 'process died'}
2019-08-29 22:59:26,006 - freqtrade.freqtradebot - INFO - Cleaning up modules ...
2019-08-29 22:59:26,006 - freqtrade.rpc.rpc_manager - INFO - Cleaning up rpc modules ...
2019-08-29 22:59:26,006 - freqtrade.rpc.api_server - INFO - Stopping API Server
2019-08-29 22:59:26,330 - freqtrade.rpc.api_server - INFO - Local Rest Server started.

# Fixed code
def send_msg(self, msg: Dict[str, Any]) -> None:
    """Send a message to telegram channel"""
    try:
        if msg["type"] == RPCMessageType.BUY_NOTIFICATION:
            valuedict = self._config["webhook"].get("webhookbuy", None)
        elif msg["type"] == RPCMessageType.SELL_NOTIFICATION:
            valuedict = self._config["webhook"].get("webhooksell", None)
        elif msg["type"] in (
            RPCMessageType.STATUS_NOTIFICATION,
            RPCMessageType.CUSTOM_NOTIFICATION,
            RPCMessageType.WARNING_NOTIFICATION,
        ):
            valuedict = self._config["webhook"].get("webhookstatus", None)
        else:
            raise NotImplementedError("Unknown message type: {}".format(msg["type"]))
        if not valuedict:
            logger.info("Message type %s not configured for webhooks", msg["type"])
            return

        payload = {key: value.format(**msg) for (key, value) in valuedict.items()}
        self._send_msg(payload)
    except KeyError as exc:
        logger.exception(
            "Problem calling Webhook. Please check your webhook configuration. "
            "Exception: %s",
            exc,
        )