diff options
Diffstat (limited to 'modules/role/templates')
-rw-r--r-- | modules/role/templates/cryptoportfolio/api_logger.py.erb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/role/templates/cryptoportfolio/api_logger.py.erb b/modules/role/templates/cryptoportfolio/api_logger.py.erb index e5f0b30..3fb14a0 100644 --- a/modules/role/templates/cryptoportfolio/api_logger.py.erb +++ b/modules/role/templates/cryptoportfolio/api_logger.py.erb | |||
@@ -9,13 +9,14 @@ urllib3.disable_warnings() | |||
9 | http = urllib3.PoolManager() | 9 | http = urllib3.PoolManager() |
10 | 10 | ||
11 | webhook_url = "<%= @slack_logger %>" | 11 | webhook_url = "<%= @slack_logger %>" |
12 | webhook_username = "<%= @slack_logger_username %>" | ||
12 | webhook_icon = "https://git.immae.eu/releases/logger.png" | 13 | webhook_icon = "https://git.immae.eu/releases/logger.png" |
13 | 14 | ||
14 | def send_to_discord(message): | 15 | def send_to_discord(message): |
15 | def send_chunk(chunk): | 16 | def send_chunk(chunk): |
16 | data = { | 17 | data = { |
17 | "avatar_url": webhook_icon, | 18 | "avatar_url": webhook_icon, |
18 | "username": "Logger", | 19 | "username": webhook_username, |
19 | "content": "```\n{}\n```".format(chunk), | 20 | "content": "```\n{}\n```".format(chunk), |
20 | } | 21 | } |
21 | encoded = json.dumps(data).encode('utf-8') | 22 | encoded = json.dumps(data).encode('utf-8') |