From c874a29c5a943c8f75a76e49c560d52d5c4c6c6e Mon Sep 17 00:00:00 2001 From: a31 Date: Sat, 9 Sep 2023 18:43:48 +0300 Subject: [PATCH] stdin2discord: get webhook url from env var --- stdin2discord.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdin2discord.py b/stdin2discord.py index 007eb5f..a55f99f 100644 --- a/stdin2discord.py +++ b/stdin2discord.py @@ -1,12 +1,13 @@ import sys import requests +import os def send(_msg: str): if len(_msg) == 0: return r = requests.post( - url='https://discord.com/api/webhooks/936927833572380692/QrqoK8aVCOkGFh1L0HaHPd_Z-Usj-ubhXYvHadZyCA1Y5GOB7-0xWmuyKI9l4byvKjQ1', + url=os.environ['DISCORD_WEBHOOK'], data=f'content=```diff\n{requests.utils.quote(_msg)}```'.encode('utf-8'), headers = {'Content-Type': 'application/x-www-form-urlencoded'} )