dreamworkAPI
Ctrl K
GitHub
libraryDocs / steam / workshop

steam.workshop

librarysharedmenusource

The Steam Workshop API library.

Functions

steam.workshop.downloadDownloads the item from the Steam Workshop.
steam.workshop.downloadIconDownloads the icon of the Steam Workshop item and returns the absolute path to the file.
steam.workshop.fetchInfoFetches a detailed information about a specific Steam Workshop item or collection.
steam.workshop.getCollectionDetailsReturns the details of a Steam Workshop collection's.
steam.workshop.getItemDetailsReturns the details of a Steam Workshop item's.
steam.workshop.getPublishedReturns a list of publications published by the client.
steam.workshop.isAddonEnabledReturns whether the addon should be mounted on local server start-up.
steam.workshop.isItemSubscribedReturns whether the publication is subscribed.
steam.workshop.isValidIDChecks if the given Steam Workshop item ID is valid.
steam.workshop.markAsCompletedMarks the Steam Workshop item as completed.
steam.workshop.markAsPlayedMarks the Steam Workshop item as played.
steam.workshop.openPageOpens the page of the addon in the Steam Workshop.
steam.workshop.publishItemPublishes file to Steam Workshop.
steam.workshop.qickSearchPerforms a quick search for publications.
steam.workshop.reloadRefreshes local Steam Workshop addons.
steam.workshop.searchPerforms a search for publications.
steam.workshop.setAddonEnabledSets whether the addon should be mounted on local server start-up.
steam.workshop.setItemSubscribedSubscribes or unsubscribes the publication.
steam.workshop.updateItemUpdates an file on Steam Workshop.
steam.workshop.voteVotes for the Steam Workshop item.

#steam.workshop.download

sharedmenuasyncsource
async function steam.workshop.download(wsid: string, timeout: number): string

Downloads the item from the Steam Workshop.

Parameters
NameTypeDescription
wsidstringThe workshop ID of the addon.
timeoutnumberThe timeout in seconds, if nil then the default timeout will be used.
Returns
TypeNameDescription
stringfile_pathThe absolute path to the downloaded addon .gma.

#steam.workshop.downloadIcon

menuasyncsource
async function steam.workshop.downloadIcon(wsid: string, uncompress?: boolean, timeout?: number): string

Downloads the icon of the Steam Workshop item and returns the absolute path to the file.

Parameters
NameTypeDescription
wsidstringThe workshop ID of the addon.
uncompressoptionalbooleanWhether the icon should be uncompressed, true by default.
timeoutoptionalnumberThe timeout in seconds, if nil then the default timeout will be used.
Returns
TypeNameDescription
stringfile_pathThe absolute path to the icon file.

#steam.workshop.fetchInfo

sharedmenuasyncnodiscardsource
async function steam.workshop.fetchInfo(wsid: string, timeout?: number): steam.workshop.ItemInfo

Fetches a detailed information about a specific Steam Workshop item or collection.

Parameters
NameTypeDescription
wsidstringThe workshop ID of the item/collection.
timeoutoptionalnumberThe timeout in seconds, if nil then the default timeout will be used.
Returns
TypeNameDescription
steam.workshop.ItemInfoinfoThe details of the item/collection.

#steam.workshop.getCollectionDetails

sharedmenuasyncnodiscardsource
async function steam.workshop.getCollectionDetails(ids: string[], id_count?: integer, timeout?: number): steam.workshop.Collection.Details[], integer

Returns the details of a Steam Workshop collection's.

Parameters
NameTypeDescription
idsstring[]The Steam Workshop item ID's.
id_countoptionalintegerThe number of Steam Workshop item ID's.
timeoutoptionalnumberThe timeout in seconds, if nil then the default timeout will be used.
Returns
TypeNameDescription
steam.workshop.Collection.Details[]itemsThe details of the Steam Workshop collections.
integeritem_countThe number of Steam Workshop collections.

#steam.workshop.getItemDetails

sharedmenuasyncnodiscardsource
async function steam.workshop.getItemDetails(ids: string[], id_count?: integer, timeout?: number): steam.workshop.Item.Details[], integer

Returns the details of a Steam Workshop item's.

Parameters
NameTypeDescription
idsstring[]The Steam Workshop item ID's.
id_countoptionalintegerThe number of Steam Workshop item ID's.
timeoutoptionalnumberThe timeout in seconds, if nil then the default timeout will be used.
Returns
TypeNameDescription
steam.workshop.Item.Details[]itemsThe details of the Steam Workshop items.
integeritem_countThe number of Steam Workshop items.

#steam.workshop.getPublished

sharedmenuasyncnodiscardsource
async function steam.workshop.getPublished(wtype: steam.workshop.Item.SearchType, wtags?: string[], woffset?: integer, timeout?: number): string[], integer, integer

Returns a list of publications published by the client.

Parameters
NameTypeDescription
wtypesteam.workshop.Item.SearchTypeThe type of the search.
wtagsoptionalstring[]The tags of the search.
woffsetoptionalintegerThe offset of the search.
timeoutoptionalnumberThe timeout in seconds of the search, if nil then the default timeout will be used.
Returns
TypeNameDescription
string[]idsThe found publications IDs.
integeritem_countThe length of the publications found array (#publications).
integertotalThe total number of publications found.

#steam.workshop.isAddonEnabled

clientmenunodiscardsource
function steam.workshop.isAddonEnabled(wsid: string): boolean

Returns whether the addon should be mounted on local server start-up.

Parameters
NameTypeDescription
wsidstringThe workshop ID of the addon.
Returns
TypeNameDescription
booleantrue if the addon is enabled, false otherwise.
See also

#steam.workshop.isItemSubscribed

clientmenunodiscardsource
function steam.workshop.isItemSubscribed(wsid: string): boolean

Returns whether the publication is subscribed.

Parameters
NameTypeDescription
wsidstringThe workshop ID of the addon.
Returns
TypeNameDescription
booleantrue if client has subscribed to the item, false otherwise.
See also

#steam.workshop.isValidID

sharedmenunodiscardsource
function steam.workshop.isValidID(id?: string): boolean

Checks if the given Steam Workshop item ID is valid.

Parameters
NameTypeDescription
idoptionalstring
Returns
TypeNameDescription
boolean

#steam.workshop.markAsCompleted

menusource
function steam.workshop.markAsCompleted(wsid: string)

Marks the Steam Workshop item as completed.

Parameters
NameTypeDescription
wsidstringThe workshop ID of the addon.

#steam.workshop.markAsPlayed

menusource
function steam.workshop.markAsPlayed(wsid: string)

Marks the Steam Workshop item as played.

Parameters
NameTypeDescription
wsidstringThe workshop ID of the addon.

#steam.workshop.openPage

clientmenusource
function steam.workshop.openPage(wsid: string)

Opens the page of the addon in the Steam Workshop.

Parameters
NameTypeDescription
wsidstringThe workshop ID of the addon.

#steam.workshop.publishItem

menuasyncsource
async function steam.workshop.publishItem(filePath: string, imagePath: string, title: string, description?: string, tags: string[], changeLog?: string, timeout: number | nil | false): string

Publishes file to Steam Workshop.

Parameters
NameTypeDescription
filePathstringThe absolute path to the addon file.
imagePathstringThe absolute path to the image file.
titlestringThe title of the addon.
descriptionoptionalstringThe description of the addon.
tagsstring[]The tags for the addon.
changeLogoptionalstringThe changelog of the publication.
timeoutnumber | nil | falseThe timeout in seconds, if nil then the default timeout will be used.
Returns
TypeNameDescription
stringworkshop_idThe workshop ID of the published addon.

#steam.workshop.qickSearch

sharedmenuasyncnodiscardsource
async function steam.workshop.qickSearch(wtype: steam.workshop.Item.SearchType, wtags?: string[], woffset?: integer, timeout?: number): string[], integer, integer

Performs a quick search for publications.

Parameters
NameTypeDescription
wtypesteam.workshop.Item.SearchTypeThe type of the search.
wtagsoptionalstring[]The tags of the search.
woffsetoptionalintegerThe offset of the search.
timeoutoptionalnumberThe timeout in seconds of the search, if nil then the default timeout will be used.
Returns
TypeNameDescription
string[]itemsThe found publications.
integeritem_countThe length of the publications found array (#publications).
integertotalThe total number of publications found.

#steam.workshop.reload

menusource
function steam.workshop.reload()

Refreshes local Steam Workshop addons.

This function should be called after changing the list of enabled addons.

See also

#steam.workshop.search

sharedmenuasyncnodiscardsource
async function steam.workshop.search(params: steam.workshop.Item.SearchParams, timeout: number): string[], integer, integer

Performs a search for publications.

Parameters
NameTypeDescription
paramssteam.workshop.Item.SearchParamsThe search parameters.
timeoutnumberThe timeout in seconds, if nil then the default timeout will be used.
Returns
TypeNameDescription
string[]idsThe IDs of the found publications.
integerid_countThe length of the ids array (#ids).
integertotalThe total number of found publications.

#steam.workshop.setAddonEnabled

menusource
function steam.workshop.setAddonEnabled(wsid: string, enabled: boolean)

Sets whether the addon should be mounted on local server start-up.

Parameters
NameTypeDescription
wsidstringThe workshop ID of the addon.
enabledbooleantrue to enable the addon, false to disable it.
See also

#steam.workshop.setItemSubscribed

menusource
function steam.workshop.setItemSubscribed(wsid: string, subscribed: boolean)

Subscribes or unsubscribes the publication.

Parameters
NameTypeDescription
wsidstringThe workshop ID of the addon.
subscribedbooleantrue to subscribe, false to unsubscribe.
See also

#steam.workshop.updateItem

menuasyncsource
async function steam.workshop.updateItem(filePath: string, imagePath: string, title: string, description?: string, tags: string[], wsid: string, changeLog?: string, timeout: number | nil | false): boolean

Updates an file on Steam Workshop.

Parameters
NameTypeDescription
filePathstringThe absolute path to the addon file.
imagePathstringThe absolute path to the image file.
titlestringThe title of the addon.
descriptionoptionalstringThe description of the addon.
tagsstring[]The tags for the addon.
wsidstringThe workshop ID of the addon.
changeLogoptionalstringThe changelog of the publication.
timeoutnumber | nil | falseThe timeout in seconds, if nil then the default timeout will be used.
Returns
TypeNameDescription
booleansuccesstrue if the update was successful, false otherwise.

#steam.workshop.vote

menusource
function steam.workshop.vote(wsid: string, vote: boolean)

Votes for the Steam Workshop item.

Parameters
NameTypeDescription
wsidstringThe workshop ID of the addon.
votebooleantrue to vote for, false to vote against.
Generated from the dreamwork meta branch.