Skip to content

normaliseRoute

normaliseRoute(route): string

Defined in: packages/discordjs/src/util.ts:56

Normalises a REST route before it is stored or used as a metric label, so it holds only route words and placeholders: snowflakes become :id (including 20-digit IDs that @discordjs/rest does not template), invite and template codes :code, webhook and interaction tokens :token and any other value :param. The query string is dropped, an encoded @ is written plainly (/guilds/:id/members/@me), and the result is capped at 200 characters.

string

string