UploadWallPaperRequest

Only users can use this request. See code examples.

---functions---
account.uploadWallPaper#e39a8f03 flags:# for_chat:flags.0?true file:InputFile mime_type:string settings:WallPaperSettings = WallPaper

Returns

WallPaper

This type can be an instance of either:

WallPaperWallPaperNoFile

Parameters

fileInputFile
mime_typestring
settingsWallPaperSettings
for_chatflagThis argument defaults to None and can be omitted.

Known RPC errors

This request can cause 2 known errors:

WallpaperFileInvalidErrorThe given file cannot be used as a wallpaper.
WallpaperMimeInvalidErrorThe specified wallpaper MIME type is invalid.

You can import these from telethon.errors.

Example

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.account.UploadWallPaperRequest(
        file=client.upload_file('/path/to/file.jpg'),
        mime_type='some string here',
        settings=types.WallPaperSettings(
            blur=True,
            motion=True,
            background_color=42,
            second_background_color=42,
            third_background_color=42,
            fourth_background_color=42,
            intensity=42,
            rotation=42,
            emoticon='some string here'
        ),
        for_chat=True
    ))
    print(result.stringify())