haystackfs
haystackfs copied to clipboard
Store DM file metadata in mongo db
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
This is a good idea