IntegrationApplication.js
2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
'use strict';
const Application = require('./interfaces/Application');
/**
* Represents an Integration's OAuth2 Application.
* @extends {Application}
*/
class IntegrationApplication extends Application {
_patch(data) {
super._patch(data);
if ('bot' in data) {
/**
* The bot user for this application
* @type {?User}
*/
this.bot = this.client.users._add(data.bot);
} else {
this.bot ??= null;
}
if ('terms_of_service_url' in data) {
/**
* The URL of the application's terms of service
* @type {?string}
*/
this.termsOfServiceURL = data.terms_of_service_url;
} else {
this.termsOfServiceURL ??= null;
}
if ('privacy_policy_url' in data) {
/**
* The URL of the application's privacy policy
* @type {?string}
*/
this.privacyPolicyURL = data.privacy_policy_url;
} else {
this.privacyPolicyURL ??= null;
}
if ('rpc_origins' in data) {
/**
* The Array of RPC origin URLs
* @type {string[]}
*/
this.rpcOrigins = data.rpc_origins;
} else {
this.rpcOrigins ??= [];
}
if ('summary' in data) {
/**
* The application's summary
* @type {?string}
*/
this.summary = data.summary;
} else {
this.summary ??= null;
}
if ('hook' in data) {
/**
* Whether the application can be default hooked by the client
* @type {?boolean}
*/
this.hook = data.hook;
} else {
this.hook ??= null;
}
if ('cover_image' in data) {
/**
* The hash of the application's cover image
* @type {?string}
*/
this.cover = data.cover_image;
} else {
this.cover ??= null;
}
if ('verify_key' in data) {
/**
* The hex-encoded key for verification in interactions and the GameSDK's GetTicket
* @type {?string}
*/
this.verifyKey = data.verify_key;
} else {
this.verifyKey ??= null;
}
}
}
module.exports = IntegrationApplication;