DiscordPHP Documentation

ArrayTokenStore
in package
implements TokenStoreInterface

FinalYes

Keeps tokens in memory, for as long as the process runs.

The default. Every user has to authorize again after a restart, so give Discord a durable store — see CacheTokenStore — before relying on it.

Tags
since
10.59.0

Table of Contents

Interfaces

TokenStoreInterface
Where users' OAuth2 tokens are kept between restarts.

Properties

$tokens  : array<string, AccessToken>

Methods

delete()  : PromiseInterface<string|int, bool>
get()  : PromiseInterface<string|int, ?AccessToken>
set()  : PromiseInterface<string|int, bool>

Properties

Methods

delete()

public delete(string $key) : PromiseInterface<string|int, bool>
Parameters
$key : string

What the token was stored under.

Return values
PromiseInterface<string|int, bool>

get()

public get(string $key) : PromiseInterface<string|int, ?AccessToken>
Parameters
$key : string

What the token was stored under.

Return values
PromiseInterface<string|int, ?AccessToken> —

The token, or null if none is stored.

set()

public set(string $key, AccessToken $token) : PromiseInterface<string|int, bool>
Parameters
$key : string

What to store the token under.

$token : AccessToken

The token.

Return values
PromiseInterface<string|int, bool>
On this page

Search results