mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-03 11:47:28 +01:00
Limit text length sent to discord webhook
This commit is contained in:
parent
8db31ebfa9
commit
6b04324ee5
@ -30,11 +30,11 @@ def post_discord_webhook(username: Optional[str], content: str, is_queue: bool,
|
||||
return
|
||||
|
||||
json = {
|
||||
"content": content,
|
||||
"content": content[0:2000],
|
||||
}
|
||||
|
||||
if username:
|
||||
json["username"] = username
|
||||
json["username"] = username[0:80]
|
||||
user = User.query.filter_by(username=username).first()
|
||||
if user:
|
||||
json["avatar_url"] = user.get_profile_pic_url().replace("/./", "/")
|
||||
@ -43,8 +43,8 @@ def post_discord_webhook(username: Optional[str], content: str, is_queue: bool,
|
||||
|
||||
if title:
|
||||
embed = {
|
||||
"title": title,
|
||||
"description": description,
|
||||
"title": title[0:256],
|
||||
"description": description[0:4000],
|
||||
}
|
||||
|
||||
if thumbnail:
|
||||
|
Loading…
Reference in New Issue
Block a user