Send a notification via the webhook notifier Args: new_analysis (dict): The new_analysis to send.
(self, new_analysis)
| 187 | |
| 188 | |
| 189 | def notify_webhook(self, new_analysis): |
| 190 | """Send a notification via the webhook notifier |
| 191 | |
| 192 | Args: |
| 193 | new_analysis (dict): The new_analysis to send. |
| 194 | """ |
| 195 | |
| 196 | if self.webhook_configured: |
| 197 | for exchange in new_analysis: |
| 198 | for market in new_analysis[exchange]: |
| 199 | for indicator_type in new_analysis[exchange][market]: |
| 200 | for indicator in new_analysis[exchange][market][indicator_type]: |
| 201 | for index, analysis in enumerate(new_analysis[exchange][market][indicator_type][indicator]): |
| 202 | analysis_dict = analysis['result'].to_dict(orient='records') |
| 203 | if analysis_dict: |
| 204 | new_analysis[exchange][market][indicator_type][indicator][index] = analysis_dict[-1] |
| 205 | else: |
| 206 | new_analysis[exchange][market][indicator_type][indicator][index] = '' |
| 207 | |
| 208 | self.webhook_client.notify(new_analysis) |
| 209 | |
| 210 | def notify_stdout(self, new_analysis): |
| 211 | """Send a notification via the stdout notifier |