@@ -189,6 +189,10 @@ async def reply(self, message):
189189 # to user
190190 self .send (message , self .recipient , from_mod = True )
191191 ]
192+
193+ self .bot .loop .create_task (
194+ self .bot .modmail_api .append_log (message , self .channel .id )
195+ )
192196
193197 if self .close_task is not None :
194198 # cancel closing if a thread message is sent.
@@ -207,17 +211,16 @@ async def send(self, message, destination=None, from_mod=False):
207211 await self .channel .send (embed = discord .Embed (
208212 color = discord .Color .red (),
209213 description = 'Scheduled close has been cancelled.' ))
214+
215+ if not from_mod :
216+ self .bot .loop .create_task (
217+ self .bot .modmail_api .append_log (message , self .channel .id )
218+ )
210219
211220 if not self .ready :
212221 await self .wait_until_ready ()
213222
214223 destination = destination or self .channel
215- if from_mod and not isinstance (destination , discord .User ):
216- self .bot .loop .create_task (
217- self .bot .modmail_api .append_log (message ))
218- elif not from_mod :
219- self .bot .loop .create_task (
220- self .bot .modmail_api .append_log (message , destination .id ))
221224
222225 author = message .author
223226
@@ -431,8 +434,7 @@ async def create(self, recipient, *, creator=None, category=None):
431434 thread .channel = channel
432435
433436 log_url , log_data = await asyncio .gather (
434- self .bot .modmail_api .get_log_url (recipient , channel ,
435- creator or recipient ),
437+ self .bot .modmail_api .get_log_url (recipient , channel , creator or recipient ),
436438 self .bot .modmail_api .get_user_logs (recipient .id )
437439 # self.get_dominant_color(recipient.avatar_url)
438440 )
0 commit comments