aboutsummaryrefslogtreecommitdiff
path: root/modules/role/templates
diff options
context:
space:
mode:
Diffstat (limited to 'modules/role/templates')
-rw-r--r--modules/role/templates/cryptoportfolio/api_logger.py.erb3
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()
9http = urllib3.PoolManager() 9http = urllib3.PoolManager()
10 10
11webhook_url = "<%= @slack_logger %>" 11webhook_url = "<%= @slack_logger %>"
12webhook_username = "<%= @slack_logger_username %>"
12webhook_icon = "https://git.immae.eu/releases/logger.png" 13webhook_icon = "https://git.immae.eu/releases/logger.png"
13 14
14def send_to_discord(message): 15def 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')