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:
WallPaper | WallPaperNoFile |
Parameters
file | InputFile | |
mime_type | string | |
settings | WallPaperSettings | |
for_chat | flag | This argument defaults to None and can be omitted. |
Known RPC errors
This request can cause 2 known errors:
WallpaperFileInvalidError | The given file cannot be used as a wallpaper. |
WallpaperMimeInvalidError | The 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())