-
-
Notifications
You must be signed in to change notification settings - Fork 113
/
invite.ts
88 lines (84 loc) · 2.03 KB
/
invite.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
/**
* Types extracted from https://discord.com/developers/docs/resources/invite
*/
import type { APIPartialChannel } from './channel.ts';
import type { APIPartialGuild } from './guild.ts';
import type { APIUser } from './user.ts';
/**
* https://discord.com/developers/docs/resources/invite#invite-object
*/
export interface APIInvite {
/**
* The invite code (unique ID)
*/
code: string;
/**
* The guild this invite is for
*
* See https://discord.com/developers/docs/resources/guild#guild-object
*/
guild?: APIPartialGuild;
/**
* The channel this invite is for
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
channel?: Required<APIPartialChannel>;
/**
* The user who created the invite
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
inviter?: APIUser;
/**
* The target user for this invite
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
target_user?: APIUser;
/**
* The type of user target for this invite
*
* See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
*/
target_user_type?: InviteTargetUserType;
/**
* Approximate count of online members (only present when `target_user` is set)
*/
approximate_presence_count?: number;
/**
* Approximate count of total members
*/
approximate_member_count?: number;
}
/**
* https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
*/
export enum InviteTargetUserType {
STREAM = 1,
}
/**
* https://discord.com/developers/docs/resources/invite#invite-metadata-object
*/
export interface APIExtendedInvite extends APIInvite {
/**
* Number of times this invite has been used
*/
uses: number;
/**
* Max number of times this invite can be used
*/
max_uses: number;
/**
* Duration (in seconds) after which the invite expires
*/
max_age: number;
/**
* Whether this invite only grants temporary membership
*/
temporary: boolean;
/**
* When this invite was created
*/
created_at: string;
}