File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -334,9 +334,6 @@ async def send_submission_webhook(
334334 "username" : form .name or "Python Discord Forms" ,
335335 }
336336
337- if form .webhook .thread_id :
338- hook ["thread_id" ] = form .webhook .thread_id
339-
340337 # Set hook message
341338 message = form .webhook .message
342339 if message :
@@ -354,9 +351,14 @@ async def send_submission_webhook(
354351
355352 hook ["content" ] = message .replace ("_USER_MENTION_" , mention )
356353
354+ params = {}
355+
356+ if form .webhook .thread_id :
357+ params ["thread_id" ] = form .webhook .thread_id
358+
357359 # Post hook
358360 async with httpx .AsyncClient () as client :
359- r = await client .post (form .webhook .url , json = hook )
361+ r = await client .post (form .webhook .url , json = hook , params = params )
360362 r .raise_for_status ()
361363
362364 @staticmethod
@@ -368,7 +370,7 @@ async def assign_role(form: Form, request_user: User) -> None:
368370
369371 url = (
370372 f"{ constants .DISCORD_API_BASE_URL } /guilds/{ constants .DISCORD_GUILD } "
371- f"/members/{ request_user .payload ["id" ]} /roles/{ form .discord_role } "
373+ f"/members/{ request_user .payload ['id' ]} /roles/{ form .discord_role } "
372374 )
373375
374376 async with httpx .AsyncClient () as client :
You can’t perform that action at this time.
0 commit comments