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(
334
334
"username" : form .name or "Python Discord Forms" ,
335
335
}
336
336
337
- if form .webhook .thread_id :
338
- hook ["thread_id" ] = form .webhook .thread_id
339
-
340
337
# Set hook message
341
338
message = form .webhook .message
342
339
if message :
@@ -354,9 +351,14 @@ async def send_submission_webhook(
354
351
355
352
hook ["content" ] = message .replace ("_USER_MENTION_" , mention )
356
353
354
+ params = {}
355
+
356
+ if form .webhook .thread_id :
357
+ params ["thread_id" ] = form .webhook .thread_id
358
+
357
359
# Post hook
358
360
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 )
360
362
r .raise_for_status ()
361
363
362
364
@staticmethod
@@ -368,7 +370,7 @@ async def assign_role(form: Form, request_user: User) -> None:
368
370
369
371
url = (
370
372
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 } "
372
374
)
373
375
374
376
async with httpx .AsyncClient () as client :
You can’t perform that action at this time.
0 commit comments