i am making a bot that downloads the text files sent from users to gather some data is it possible to download those files or save them? i am using Pycharm
Asked
Active
Viewed 210 times
-4
-
You can indeed store text in a JSON for example. – Dominik May 21 '21 at 12:16
1 Answers
0
You could go by using message.attachments and using save():
await message.attachments[0].save()
Then reading the file which can be done by using open(message.attachments[0].filename, "r")
unless you use another file name then you can read it and store it in a JSON file or even a database.

Axisnix
- 2,822
- 5
- 19
- 41
-
-
@AXEL you could try to use .read() and maybe use https://stackoverflow.com/questions/606191/convert-bytes-to-a-string – Axisnix May 21 '21 at 13:35