@@ -167,8 +167,15 @@ def append_log(self, message, channel_id='', type='thread_message'):
167
167
},
168
168
# message properties
169
169
'content' : message .content ,
170
- 'attachments' : [i .url for i in message .attachments ],
171
- 'type' : type
170
+ 'type' : type ,
171
+ 'attachments' : [
172
+ {
173
+ 'id' : a .id ,
174
+ 'filename' : a .filename ,
175
+ 'is_image' : a .width is not None ,
176
+ 'size' : a .size ,
177
+ 'url' : a .url
178
+ } for a in message .attachments ]
172
179
}
173
180
}
174
181
return self .request (self .logs + f'/{ channel_id } ' , method = 'PATCH' , payload = payload )
@@ -253,18 +260,23 @@ async def append_log(self, message, channel_id='', type='thread_message'):
253
260
payload = {
254
261
'timestamp' : str (message .created_at ),
255
262
'message_id' : str (message .id ),
256
- # author
257
263
'author' : {
258
264
'id' : str (message .author .id ),
259
265
'name' : message .author .name ,
260
266
'discriminator' : message .author .discriminator ,
261
267
'avatar_url' : message .author .avatar_url ,
262
268
'mod' : not isinstance (message .channel , discord .DMChannel ),
263
269
},
264
- # message properties
265
270
'content' : message .content ,
266
- 'attachments' : [i .url for i in message .attachments ],
267
- 'type' : type
271
+ 'type' : type ,
272
+ 'attachments' : [
273
+ {
274
+ 'id' : a .id ,
275
+ 'filename' : a .filename ,
276
+ 'is_image' : a .width is not None ,
277
+ 'size' : a .size ,
278
+ 'url' : a .url
279
+ } for a in message .attachments ]
268
280
}
269
281
270
282
return await self .logs .find_one_and_update (
0 commit comments