deltachat-bot / deltabot

Delta.Chat bot written in Python
Mozilla Public License 2.0
33 stars 18 forks source link

add function to get a per-plugin folder #18

Closed adbenitez closed 4 years ago

adbenitez commented 4 years ago

plugins sometimes need a folder to place databases and other files

adbenitez commented 4 years ago

closing this for now, a possible solution, in the plugin side, to get a folder inside basedir named as the plugin:

plugin_dir = os.path.join(os.path.dirname(bot.account.db_path), __name__)
if not os.path.exists(plugin_dir):
    os.makedirs(plugin_dir)