80 character limit for Discord webhook username
This commit is contained in:
parent
28f57eef08
commit
a8b35394ba
1 changed files with 2 additions and 1 deletions
3
main.py
3
main.py
|
@ -122,9 +122,10 @@ class MatrixClient(nio.AsyncClient):
|
||||||
if not hook:
|
if not hook:
|
||||||
hook = await channel.create_webhook(name=hook_name)
|
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
|
# 'wait=True' allows us to store the sent message
|
||||||
try:
|
try:
|
||||||
hook = await hook.send(username=author, avatar_url=avatar,
|
hook = await hook.send(username=author[:80], avatar_url=avatar,
|
||||||
content=message, wait=True)
|
content=message, wait=True)
|
||||||
message_store[event_id] = hook
|
message_store[event_id] = hook
|
||||||
except discord.errors.HTTPException as e:
|
except discord.errors.HTTPException as e:
|
||||||
|
|
Loading…
Reference in a new issue