addon.account

Available in userscripts ✔️
Available in persistent scripts ✔️
Available in popup scripts ✔️
Required manifest permissions None

Description

Allows addons to execute actions in the currently logged in Scratch user.

Methods

getMsgCount

Return value Promise<Number | null>

Gets the unread message count of the currently logged in user.
The promise will resolve to null if addon.auth.isLoggedIn is false.

getMessages

Available in userscripts
Available in popup scripts
Parameter Type Required Description
opts Object No
Property Type Required Default Description
offset Number No 0 Offset to use when requesting to Scratch API.
Return value Promise<ScratchApiMessage[] | null>

Gets recent Scratch messages of the currently logged in user.
The promise will resolve to null if addon.auth.isLoggedIn is false.
Can only return up to 40 messages at a time.

clearMessages

Available in userscripts
Available in popup scripts
Return value Promise<void>

Clears the unread message count of the currently logged in user.


Last updated at 12 July 2021 by Hans5958 on commit d07183b. Improve this page.