Added character truncation rule to URL starting with https://discord.com/api/webhooks

diff-proposed-for-bwees
Brandon Wees 3 years ago committed by GitHub
parent 52d3d375ba
commit 234494d907
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -79,7 +79,7 @@ def process_notification(n_object, datastore):
n_title = n_title[0:payload_max_size]
n_body = n_body[0:body_limit]
elif url.startswith('discord://'):
elif url.startswith('discord://') or url.startswith('https://discord.com/api/webhooks'):
# real limit is 2000, but minus some for extra metadata
payload_max_size = 1700
body_limit = max(0, payload_max_size - len(n_title))

Loading…
Cancel
Save