UNPKG

tiny-essentials

Version:

Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.

27 lines 1.14 kB
/** * Retrieves the authenticated user's linked connections from the Discord API. * * This includes external accounts the user has connected to their Discord profile, * such as Steam, Twitch, YouTube, GitHub, etc. * * Requires the `connections` scope to be present in the OAuth2 token. * * @param {string} access_token - The OAuth2 access token used to authenticate the user. * * @returns {Promise<Array<Record<string, any>>>} Resolves with an array of connection objects. * * @throws {Record<string, any>} If the request fails, rejects with an error object containing `code` and `message`. * * @see {@link https://discord.com/developers/docs/resources/user#get-user-connections} Discord API Reference * * @example * getUserConnections('your_access_token') * .then(connections => { * connections.forEach(conn => { * console.log(`${conn.type}: ${conn.name}`); * }); * }) * .catch(err => console.error('Failed to get connections:', err)); */ export default function getUserConnections(access_token: string): Promise<Array<Record<string, any>>>; //# sourceMappingURL=getUserConnections.d.mts.map