• Retrieves the roles of a user in a specific guild.

    Parameters

    • token: string

      The token used for authentication with the Discord API.

    • guildId: string

      The ID of the guild from which to retrieve the user's roles.

    • userId: string

      The ID of the user whose roles are to be retrieved.

    Returns Promise<string[]>

    A promise that resolves to an array of role IDs.

    Throws

    Will throw an error if there is a problem retrieving the user's roles.

    Example

    const token = 'your_discord_token_here';
    const guildId = 'your_guild_id_here';
    const userId = 'your_user_id_here';

    const run = async () => {
    try {
    const roles = await getUserRoles(token, guildId, userId);
    console.log('User roles:', roles);
    } catch (error) {
    console.error(`Error: ${error.message}`);
    }
    }

    run();

Generated using TypeDoc