Mixins

Downloadable

class aiogram.types.mixins.Downloadable[source]

Bases: object

Mixin for files

async download(destination=None, timeout=30, chunk_size=65536, seek=True, make_dirs=True)[source]

Download file

Parameters
  • destination – filename or instance of io.IOBase. For e. g. io.BytesIO

  • timeout – Integer

  • chunk_size – Integer

  • seek – Boolean - go to start of file when downloading is finished.

  • make_dirs – Make dirs if not exist

Returns

destination

async get_file()[source]

Get file information

Returns

aiogram.types.File

async get_url()[source]

Get file url.

Attention!! This method has security vulnerabilities for the reason that result contains bot’s access token in open form. Use at your own risk!

Returns

url