Skip to content

Fetching Roles

nutmeg edited this page Feb 22, 2023 · 4 revisions

Run Down

Fetching roles is taking an id or a mention (@role or <@&id>) and returning the role's info
If the role does not exist it returns null

Fetching Roles

Unfortunately roles can only be fetched with the guild
Role fetching is called with PSClient.fetchRole() and it uses the guild to return the role's info
It also has an optional guild value if you wish to use it and it defaults to ctx.guild

let role = await PSClient.fetchRole(role);

// or for guild

let role = await PSClient.fetchRole(role, guild);

Fetch Role Related Functions

PSClient.fetchRole

  • Description: Fetches the info for a role using the guild
  • Setup: await PSClient.fetchRole(role, ?guild)
  • Aliases: fetchGuildRole
  • Returns: Guild Role

Clone this wiki locally