Layer 224
method Users
account.createTheme#652e4400 flags:# slug:string title:string document:flags.2?InputDocument settings:flags.3?Vector<InputThemeSettings> = Theme;

Parameters

Name Type Description
Slug string Unique theme ID used to generate theme deep links, can be empty to autogenerate a random ID.
Title string Theme name
Document flags.2?InputDocument Theme file
Settings Vector<InputThemeSettings> Theme settings, multiple values can be provided for the different base themes (day/night mode, etc).

Returns

Theme

Gogram Example

// AccountCreateTheme - using Params struct
result, err := client.AccountCreateTheme(&tg.AccountCreateThemeParams{
    Slug: "Hello, World!",
    Title: "Hello, World!",

    // Optional fields:
    // Document: &tg.InputDocument{ID: int64(5678901234567890), AccessHash: int64(1234567890123456), FileReference: []byte{0x01, 0x02}},
    // Settings: []tg.InputThemeSettings{&tg.InputThemeSettings{}},
})
if err != nil {
    // handle error
}
// result is *tg.Theme

Possible Errors

Code Type Description
400 THEME_MIME_INVALID The theme's MIME type is invalid.
400 THEME_TITLE_INVALID The specified theme title is invalid.