How to use the detritus-client-rest.Endpoints.CDN function in detritus-client-rest

To help you get started, we’ve selected a few detritus-client-rest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github detritusjs / client / src / structures / application.ts View on Github external
iconUrlFormat(format?: null | string, query?: UrlQuery): null | string {
    if (!this.icon) {
      return null;
    }
    const hash = this.icon;
    format = getFormatFromHash(
      hash,
      format,
      this.client.imageFormat,
    );
    return addQuery(
      Endpoints.CDN.URL + Endpoints.CDN.APP_ICON(this.id, hash, format),
      query,
    );
  }
github detritusjs / client / src / structures / user.ts View on Github external
get defaultAvatarUrl(): string {
    return Endpoints.CDN.URL + Endpoints.CDN.AVATAR_DEFAULT(this.discriminator);
  }
github detritusjs / client / src / structures / application.ts View on Github external
splashUrlFormat(format?: null | string, query?: UrlQuery): null | string {
    if (!this.splash) {
      return null;
    }
    const hash = this.splash;
    format = getFormatFromHash(
      hash,
      format,
      this.client.imageFormat,
    );
    return addQuery(
      Endpoints.CDN.URL + Endpoints.CDN.APP_ICON(this.id, hash, format),
      query,
    );
  }
}
github detritusjs / client / src / structures / user.ts View on Github external
avatarUrlFormat(format?: null | string, query?: UrlQuery): string {
    if (!this.avatar) {
      return addQuery(this.defaultAvatarUrl, query);
    }
    const hash = this.avatar;
    format = getFormatFromHash(hash, format, this.client.imageFormat);
    return addQuery(Endpoints.CDN.URL + Endpoints.CDN.AVATAR(this.id, hash, format), query);
  }

detritus-client-rest

A minimalistic TypeScript library to interact with all, or most, of Discord's rest endpoints

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis