catto.js 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/User.js +10 -3
  2. package/package.json +1 -1
package/User.js CHANGED
@@ -1,7 +1,10 @@
1
1
  var request = require("./request");
2
2
  var Application = require("./Application");
3
- module.exports = class {
3
+ class User {
4
4
  constructor(options, bot) {
5
+ if (options instanceof User) {
6
+ options = options.options;
7
+ }
5
8
  if (options.global_name) {
6
9
  options.globalName = options.global_name;
7
10
  }
@@ -69,8 +72,10 @@ module.exports = class {
69
72
  avataru = `https://cdn.discordapp.com/avatars/${this.id}/${avataru}.gif?size=4096`;
70
73
  } else if (avataru) {
71
74
  avataru = `https://cdn.discordapp.com/avatars/${this.id}/${avataru}.webp?size=4096`;
72
- } else {
75
+ } else if (this.discrim) {
73
76
  avataru = `https://cdn.discordapp.com/embed/avatars/${(parseInt(this.discrim) % 5).toString()}.png`;
77
+ } else {
78
+ avataru = `https://cdn.discordapp.com/embed/avatars/${(parseInt((BigInt(this.id) >> 22n).toString()) % 6).toString()}.png`;
74
79
  }
75
80
  return avataru;
76
81
  }
@@ -245,4 +250,6 @@ module.exports = class {
245
250
  })).body);
246
251
  }
247
252
  }
248
- };
253
+ }
254
+
255
+ module.exports = User;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catto.js",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Universal module for everything.",
5
5
  "main": "index.js",
6
6
  "scripts": {