Working with Files
As mentioned earlier,
The module folder is your little kingdom. You can do whatever you want in it: organize your code into as many files as you need. Need some additional files? Upload them! Need to store something? Create your own storage there! Just make sure to specify what needs to be included and what doesn't in
.rimtubignore.
To work with files, you only need one thing — the path to the module folder. You can get it using mod.path.
Examples of Working with Files
ModuleHelper/__init__.py, line 290
path = await r.download(mod.path / r.document.file_name)
PremiumEmojiTools/__init__.py, lines 138-139
file_path = mod.path / f'{int(time.time())}{generate_random_identifier(5)}.tgs'
out_path = mod.path / f'{int(time.time())}{generate_random_identifier(5)}.gif'
PremiumEmojiTools/__init__.py, line 157
try_(os.remove(out_path))
PremiumEmojiTools/tgs_gif_converter.py, lines 156-158
try_(os.remove(path))
try_(os.remove(watermarked_path))
try_(os.remove(json_path))