80 character limit for Discord webhook username

This commit is contained in:
git-bruh 2020-12-02 20:03:12 +05:30
parent 28f57eef08
commit a8b35394ba
No known key found for this signature in database
GPG key ID: E1475C50075ADCE6

View file

@ -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: