-
-
Notifications
You must be signed in to change notification settings - Fork 114
/
user.ts
138 lines (123 loc) · 3.62 KB
/
user.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import type { Permissions, Snowflake } from '../../globals.ts';
import type {
APIChannel,
APIConnection,
APIGuildMember,
APIUser,
APIApplicationRoleConnection,
GuildFeature,
} from '../../payloads/v10/mod.ts';
/**
* https://discord.com/developers/docs/resources/user#get-current-user
*/
export type RESTGetAPICurrentUserResult = APIUser;
/**
* https://discord.com/developers/docs/resources/user#get-user
*/
export type RESTGetAPIUserResult = APIUser;
/**
* https://discord.com/developers/docs/resources/user#get-current-user-guild-member
*/
export type RESTGetCurrentUserGuildMemberResult = APIGuildMember;
/**
* https://discord.com/developers/docs/resources/user#modify-current-user
*/
export interface RESTPatchAPICurrentUserJSONBody {
/**
* User's username, if changed may cause the user's discriminator to be randomized
*/
username?: string | undefined;
/**
* If passed, modifies the user's avatar
*/
avatar?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/user#modify-current-user
*/
export type RESTPatchAPICurrentUserResult = APIUser;
/**
* https://discord.com/developers/docs/resources/user#get-current-user-guilds
*/
export interface RESTGetAPICurrentUserGuildsQuery {
/**
* Get guilds before this guild ID
*/
before?: Snowflake;
/**
* Get guilds after this guild ID
*/
after?: Snowflake;
/**
* Max number of guilds to return (1-200)
*
* @default 200
*/
limit?: number;
/**
* Include approximate member and presence counts in response
*
* @default false
*/
with_counts?: boolean;
}
export interface RESTAPIPartialCurrentUserGuild {
id: Snowflake;
name: string;
icon: string | null;
owner: boolean;
features: GuildFeature[];
permissions: Permissions;
approximate_member_count?: number;
approximate_presence_count?: number;
}
/**
* https://discord.com/developers/docs/resources/user#get-current-user-guilds
*/
export type RESTGetAPICurrentUserGuildsResult = RESTAPIPartialCurrentUserGuild[];
/**
* https://discord.com/developers/docs/resources/user#leave-guild
*/
export type RESTDeleteAPICurrentUserGuildResult = never;
/**
* https://discord.com/developers/docs/resources/user#create-dm
*/
export interface RESTPostAPICurrentUserCreateDMChannelJSONBody {
/**
* The recipient to open a DM channel with
*/
recipient_id: string;
}
/**
* https://discord.com/developers/docs/resources/user#create-dm
*/
export type RESTPostAPICurrentUserCreateDMChannelResult = APIChannel;
/**
* https://discord.com/developers/docs/resources/user#get-user-connections
*/
export type RESTGetAPICurrentUserConnectionsResult = APIConnection[];
/**
* https://discord.com/developers/docs/resources/user#get-user-application-role-connection
*/
export type RESTGetAPICurrentUserApplicationRoleConnectionResult = APIApplicationRoleConnection;
/**
* https://discord.com/developers/docs/resources/user#update-user-application-role-connection
*/
export interface RESTPutAPICurrentUserApplicationRoleConnectionJSONBody {
/**
* The vanity name of the platform a bot has connected (max 50 characters)
*/
platform_name?: string | undefined;
/**
* The username on the platform a bot has connected (max 100 characters)
*/
platform_username?: string | undefined;
/**
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
*/
metadata?: Record<string, string | number> | undefined;
}
/**
* https://discord.com/developers/docs/resources/user#update-user-application-role-connection
*/
export type RESTPutAPICurrentUserApplicationRoleConnectionResult = APIApplicationRoleConnection;