From a8b35394ba233f29ebe009f0b80db7e1367ddea8 Mon Sep 17 00:00:00 2001 From: git-bruh Date: Wed, 2 Dec 2020 20:03:12 +0530 Subject: [PATCH] 80 character limit for Discord webhook username --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index a3bf6b3..13dc5be 100644 --- a/main.py +++ b/main.py @@ -122,9 +122,10 @@ class MatrixClient(nio.AsyncClient): if not hook: hook = await channel.create_webhook(name=hook_name) + # Username must be between 1 and 80 characters in length # 'wait=True' allows us to store the sent message try: - hook = await hook.send(username=author, avatar_url=avatar, + hook = await hook.send(username=author[:80], avatar_url=avatar, content=message, wait=True) message_store[event_id] = hook except discord.errors.HTTPException as e: