diff --git a/stdin2discord.py b/stdin2discord.py index a55f99f..a6cc8ba 100644 --- a/stdin2discord.py +++ b/stdin2discord.py @@ -11,12 +11,17 @@ def send(_msg: str): data=f'content=```diff\n{requests.utils.quote(_msg)}```'.encode('utf-8'), headers = {'Content-Type': 'application/x-www-form-urlencoded'} ) - r.raise_for_status() + try: + r.raise_for_status() + + except Exception: + print(r.text) + raise msg = '' for line in sys.stdin: - if len(msg + line) >= 2000: + if len(msg + line) >= 1900: send(msg) msg = ''