@velliajs/discord 1.0.4 → 1.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velliajs/discord",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Discord Bot Libray By Valera",
5
5
  "scripts": {
6
6
  "test": "yarn docs:test && yarn test:typescript",
@@ -9,11 +9,6 @@ const Invite = require('../structures/Invite');
9
9
 
10
10
 
11
11
  class DataResolver extends null {
12
-
13
-
14
-
15
-
16
-
17
12
  static resolveCode(data, regex) {
18
13
  return regex.exec(data)?.[1] ?? data;
19
14
  }
@@ -39,21 +34,11 @@ class DataResolver extends null {
39
34
  return this.resolveBase64(file.data);
40
35
  }
41
36
 
42
-
43
-
44
-
45
37
  static resolveBase64(data) {
46
38
  if (Buffer.isBuffer(data)) return `data:image/jpg;base64,${data.toString('base64')}`;
47
39
  return data;
48
40
  }
49
41
 
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
42
  static async resolveFile(resource) {
58
43
  if (Buffer.isBuffer(resource)) return { data: resource };
59
44
 
@@ -64,7 +49,7 @@ class DataResolver extends null {
64
49
  }
65
50
 
66
51
  if (typeof resource === 'string') {
67
- if (/^https?:\/\
52
+ if (/^https?:\/\//.test(resource)) {
68
53
  const res = await fetch(resource);
69
54
  return { data: Buffer.from(await res.arrayBuffer()), contentType: res.headers.get('content-type') };
70
55
  }