Get database url from database object

This commit is contained in:
Davte 2019-07-21 20:08:01 +02:00
parent cb64443af2
commit b1c7ee4299
2 changed files with 2 additions and 3 deletions

View File

@ -14,7 +14,7 @@ __author__ = "Davide Testa"
__email__ = "davide@davte.it"
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
__license__ = "GNU General Public License v3.0"
__version__ = "2.1.26"
__version__ = "2.1.27"
__maintainer__ = "Davide Testa"
__contact__ = "t.me/davte"

View File

@ -679,10 +679,9 @@ async def _send_bot_database(bot, update, user_record):
update=update, user_record=user_record,
db_type=bot.db_url.partition(':///')[0]
)
database_name = extract(bot.db_url, starter='data/')
await bot.send_document(
chat_id=user_record['telegram_id'],
document_path=f'{{path}}/data/{database_name}',
document_path=extract(bot.db.url, starter='sqlite:///'),
caption=bot.get_message(
'admin', 'db_command', 'file_caption',
update=update, user_record=user_record