-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathguild.d.ts
121 lines (117 loc) · 2.87 KB
/
guild.d.ts
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/**
* Request and response structures related to the `/guilds` resource.
*
* Typings relevant to guild interfaces on the Pylon API.
*
* @module
*/
import { RESTPostAPIGuildsJSONBody } from 'discord-api-types/rest/v8/guild.ts';
import { APIUnavailableGuild } from 'discord-api-types/payloads/v8/guild.ts';
import { DeploymentStructures } from './deployment.d.ts';
/**
* Not an API resource, this namespace behaves as a set of templates and other
* base types.
*/
export namespace GuildStructures {
/**
* Base guild payload.
*/
export type Payload = {
/**
* The guild's ID.
*/
id: string;
/**
* The guild's username
*/
name: string;
/**
* The guild's icon ID, UUID without hyphens.
* Null if non set.
*/
icon: string | null;
};
}
/**
* Schemas for `GET /guilds`.
*/
export namespace GET {
/**
* Response schema for `GET /guilds/:id`.
*
* Returns some guild info (everything the v8 Discord API normally gives you) as well as a list of deployments.
*/
export type Guild<Raw extends boolean = true> = RESTPostAPIGuildsJSONBody & {
deployments: Array<
DeploymentStructures.Base & {
/**
* Unused.
*/
last_updated_at: null;
/**
* Deployment configurations.
*/
config: Raw extends true ? string : DeploymentStructures.Config;
/**
* A boolean version of {@linkcode Deployment.Structures.DeploymentStatus}.
*/
disabled: boolean;
}
>;
/**
* Region of the guild, deprecated because the API uses a deprecated version of the Discord API. (v8)
*/
region: `deprecated`;
/**
* `true` if the guild is unavailable due to an outage.
*/
unavailable: APIUnavailableGuild['unavailable'];
};
/**
* Response schema for `GET /guilds/:id/stats`.
*
* Return some statistics of a script container. Some values are undefined when information is not available.
*/
export type Stats = Array<{
/**
* Date (Unix timestamp) in seconds of when statistics were captured.
*/
date: number;
/**
* Milliseconds of used cpu time.
*/
cpuMs?: number;
/**
* Milliseconds of script execution time.
*/
executionMs?: number;
/**
* Function calls across all scripts.
*/
hostFunctionCalls?: number;
/**
* Discord API caches across all scripts.
*/
discordCacheRequests?: number;
/**
* Discord API requests across all scripts.
*/
discordApiRequests?: number;
/**
* Events followed across all scripts.
*/
events?: number;
/**
* Calculated average of cpuMs.
*/
cpuMsAvg?: number;
/**
* Calculated average of executionMs.
*/
executionMsAvg?: number;
/**
* Total KV store requests across all scripts.
*/
kvOperations?: number;
}>;
}