stdin2discord: get webhook url from env var
Some checks failed
Push commit / report (push) Failing after 3s
Some checks failed
Push commit / report (push) Failing after 3s
This commit is contained in:
parent
222796d9ad
commit
c874a29c5a
@ -1,12 +1,13 @@
|
|||||||
import sys
|
import sys
|
||||||
import requests
|
import requests
|
||||||
|
import os
|
||||||
|
|
||||||
def send(_msg: str):
|
def send(_msg: str):
|
||||||
if len(_msg) == 0:
|
if len(_msg) == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
r = requests.post(
|
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'),
|
data=f'content=```diff\n{requests.utils.quote(_msg)}```'.encode('utf-8'),
|
||||||
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
|
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user