@@ -1175,6 +1175,7 @@ async def create(
1175
1175
message : discord .Message = None ,
1176
1176
creator : typing .Union [discord .Member , discord .User ] = None ,
1177
1177
category : discord .CategoryChannel = None ,
1178
+ manual_trigger : bool = True ,
1178
1179
) -> Thread :
1179
1180
"""Creates a Modmail thread"""
1180
1181
@@ -1215,8 +1216,12 @@ async def create(
1215
1216
self .bot .config .set ("fallback_category_id" , category .id )
1216
1217
await self .bot .config .update ()
1217
1218
1218
- if message and self .bot .config ["confirm_thread_creation" ]:
1219
- confirm = await message .channel .send (
1219
+ if (message or not manual_trigger ) and self .bot .config ["confirm_thread_creation" ]:
1220
+ if not manual_trigger :
1221
+ destination = recipient
1222
+ else :
1223
+ destination = message .channel
1224
+ confirm = await destination .send (
1220
1225
embed = discord .Embed (
1221
1226
title = self .bot .config ["confirm_thread_creation_title" ],
1222
1227
description = self .bot .config ["confirm_thread_response" ],
@@ -1231,7 +1236,7 @@ async def create(
1231
1236
try :
1232
1237
r , _ = await self .bot .wait_for (
1233
1238
"reaction_add" ,
1234
- check = lambda r , u : u .id == message . author .id
1239
+ check = lambda r , u : u .id == recipient .id
1235
1240
and r .message .id == confirm .id
1236
1241
and r .message .channel .id == confirm .channel .id
1237
1242
and str (r .emoji ) in (accept_emoji , deny_emoji ),
@@ -1243,7 +1248,7 @@ async def create(
1243
1248
await confirm .remove_reaction (accept_emoji , self .bot .user )
1244
1249
await asyncio .sleep (0.2 )
1245
1250
await confirm .remove_reaction (deny_emoji , self .bot .user )
1246
- await message . channel .send (
1251
+ await destination .send (
1247
1252
embed = discord .Embed (
1248
1253
title = "Cancelled" , description = "Timed out" , color = self .bot .error_color
1249
1254
)
@@ -1257,7 +1262,7 @@ async def create(
1257
1262
await confirm .remove_reaction (accept_emoji , self .bot .user )
1258
1263
await asyncio .sleep (0.2 )
1259
1264
await confirm .remove_reaction (deny_emoji , self .bot .user )
1260
- await message . channel .send (
1265
+ await destination .send (
1261
1266
embed = discord .Embed (title = "Cancelled" , color = self .bot .error_color )
1262
1267
)
1263
1268
del self .cache [recipient .id ]
0 commit comments