haystackfs icon indicating copy to clipboard operation
haystackfs copied to clipboard

Store DM file metadata in mongo db

Open ThomasWu931 opened this issue 2 years ago • 1 comments

Problem

Files provided in direct messages with the bot are not being stored within the mongo db client.

Solution

This issue is caused by these 2 chunks of code: one, and two. Since dms lack a message.guild field, an error will be raised in the 1st snippet because ur trying to access message.guild.id in the first snippet. This raises an error in the console and prevents dm files from being saved within the mongoDB client. However, this error isn't caught because the 2nd snippet ignores the error in try-except block.

Solution is to rewrite the ternary operator in snipper one.

Next Steps

NA

ThomasWu931 avatar Sep 02 '22 21:09 ThomasWu931

This is a good idea

dhrumilp15 avatar Oct 16 '23 07:10 dhrumilp15