@koishijs/plugin-adapter-discord 2.1.2 → 3.1.0
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/lib/index.d.ts +3 -14
- package/lib/index.js +21 -1544
- package/lib/index.js.map +4 -4
- package/package.json +10 -22
- package/lib/bot.d.ts +0 -64
- package/lib/sender.d.ts +0 -36
- package/lib/types/application.d.ts +0 -84
- package/lib/types/audit-log.d.ts +0 -128
- package/lib/types/ban.d.ts +0 -67
- package/lib/types/channel.d.ts +0 -368
- package/lib/types/command.d.ts +0 -214
- package/lib/types/component.d.ts +0 -84
- package/lib/types/device.d.ts +0 -41
- package/lib/types/emoji.d.ts +0 -63
- package/lib/types/gateway.d.ts +0 -248
- package/lib/types/guild-member.d.ts +0 -216
- package/lib/types/guild-scheduled-event.d.ts +0 -167
- package/lib/types/guild-template.d.ts +0 -88
- package/lib/types/guild.d.ts +0 -419
- package/lib/types/index.d.ts +0 -31
- package/lib/types/integration.d.ts +0 -111
- package/lib/types/interaction.d.ts +0 -182
- package/lib/types/internal.d.ts +0 -8
- package/lib/types/invite.d.ts +0 -163
- package/lib/types/message.d.ts +0 -404
- package/lib/types/presence.d.ts +0 -151
- package/lib/types/reaction.d.ts +0 -114
- package/lib/types/role.d.ts +0 -221
- package/lib/types/scheduled-event.d.ts +0 -167
- package/lib/types/stage-instance.d.ts +0 -78
- package/lib/types/sticker.d.ts +0 -149
- package/lib/types/team.d.ts +0 -30
- package/lib/types/thread.d.ts +0 -201
- package/lib/types/user.d.ts +0 -122
- package/lib/types/voice.d.ts +0 -102
- package/lib/types/webhook.d.ts +0 -199
- package/lib/types.d.ts +0 -354
- package/lib/utils.d.ts +0 -15
- package/lib/ws.d.ts +0 -26
package/lib/types/thread.d.ts
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { Channel, integer, snowflake, timestamp } from '.';
|
|
2
|
-
declare module './channel' {
|
|
3
|
-
interface Channel {
|
|
4
|
-
/** an approximate count of messages in a thread, stops counting at 50 */
|
|
5
|
-
message_count?: integer;
|
|
6
|
-
/** an approximate count of users in a thread, stops counting at 50 */
|
|
7
|
-
member_count?: integer;
|
|
8
|
-
/** thread-specific fields not needed by other channels */
|
|
9
|
-
thread_metadata?: ThreadMetadata;
|
|
10
|
-
/** thread member object for the current user, if they have joined the thread, only included on certain API endpoints */
|
|
11
|
-
member?: ThreadMember;
|
|
12
|
-
/** default duration for newly created threads, in minutes, to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 */
|
|
13
|
-
default_auto_archive_duration?: integer;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
/** https://discord.com/developers/docs/resources/channel#thread-member-object-thread-member-structure */
|
|
17
|
-
export interface ThreadMember {
|
|
18
|
-
/** the id of the thread */
|
|
19
|
-
id?: snowflake;
|
|
20
|
-
/** the id of the user */
|
|
21
|
-
user_id?: snowflake;
|
|
22
|
-
/** the time the current user last joined the thread */
|
|
23
|
-
join_timestamp: timestamp;
|
|
24
|
-
/** any user-thread settings, currently only used for notifications */
|
|
25
|
-
flags: integer;
|
|
26
|
-
}
|
|
27
|
-
/** https://discord.com/developers/docs/resources/channel#thread-metadata-object-thread-metadata-structure */
|
|
28
|
-
export interface ThreadMetadata {
|
|
29
|
-
/** whether the thread is archived */
|
|
30
|
-
archived: boolean;
|
|
31
|
-
/** duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 */
|
|
32
|
-
auto_archive_duration: integer;
|
|
33
|
-
/** timestamp when the thread's archive status was last changed, used for calculating recent activity */
|
|
34
|
-
archive_timestamp: timestamp;
|
|
35
|
-
/** whether the thread is locked; when a thread is locked, only users with MANAGE_THREADS can unarchive it */
|
|
36
|
-
locked: boolean;
|
|
37
|
-
/** whether non-moderators can add other non-moderators to a thread; only available on private threads */
|
|
38
|
-
invitable?: boolean;
|
|
39
|
-
}
|
|
40
|
-
export interface Thread extends Channel {
|
|
41
|
-
}
|
|
42
|
-
export declare namespace Thread {
|
|
43
|
-
/** https://discord.com/developers/docs/resources/channel#start-thread-with-message-json-params */
|
|
44
|
-
interface StartWithMessageParams {
|
|
45
|
-
/** 1-100 character channel name */
|
|
46
|
-
name: string;
|
|
47
|
-
/** duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 */
|
|
48
|
-
auto_archive_duration?: integer;
|
|
49
|
-
/** amount of seconds a user has to wait before sending another message (0-21600) */
|
|
50
|
-
rate_limit_per_user?: integer;
|
|
51
|
-
}
|
|
52
|
-
/** https://discord.com/developers/docs/resources/channel#start-thread-without-message-json-params */
|
|
53
|
-
interface StartWithoutMessageParams {
|
|
54
|
-
/** 1-100 character channel name */
|
|
55
|
-
name: string;
|
|
56
|
-
/** duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 */
|
|
57
|
-
auto_archive_duration?: integer;
|
|
58
|
-
/** the type of thread to create */
|
|
59
|
-
type?: integer;
|
|
60
|
-
/** whether non-moderators can add other non-moderators to a thread; only available when creating a private thread */
|
|
61
|
-
invitable?: boolean;
|
|
62
|
-
/** amount of seconds a user has to wait before sending another message (0-21600) */
|
|
63
|
-
rate_limit_per_user?: integer;
|
|
64
|
-
}
|
|
65
|
-
/** https://discord.com/developers/docs/resources/channel#list-active-threads-response-body */
|
|
66
|
-
interface List {
|
|
67
|
-
/** the active threads */
|
|
68
|
-
threads: Channel[];
|
|
69
|
-
/** a thread member object for each returned thread the current user has joined */
|
|
70
|
-
members: ThreadMember[];
|
|
71
|
-
/** whether there are potentially additional threads that could be returned on a subsequent call */
|
|
72
|
-
has_more: boolean;
|
|
73
|
-
}
|
|
74
|
-
/** https://discord.com/developers/docs/resources/channel#list-public-archived-threads-query-string-params */
|
|
75
|
-
interface ListPublicArchivedParams {
|
|
76
|
-
/** returns threads before this timestamp */
|
|
77
|
-
before?: timestamp;
|
|
78
|
-
/** optional maximum number of threads to return */
|
|
79
|
-
limit?: integer;
|
|
80
|
-
}
|
|
81
|
-
/** https://discord.com/developers/docs/resources/channel#list-private-archived-threads-query-string-params */
|
|
82
|
-
interface ListPrivateArchivedParams {
|
|
83
|
-
/** returns threads before this timestamp */
|
|
84
|
-
before?: timestamp;
|
|
85
|
-
/** optional maximum number of threads to return */
|
|
86
|
-
limit?: integer;
|
|
87
|
-
}
|
|
88
|
-
/** https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads-query-string-params */
|
|
89
|
-
interface ListJoinedPrivateArchivedParams {
|
|
90
|
-
/** returns threads before this id */
|
|
91
|
-
before?: snowflake;
|
|
92
|
-
/** optional maximum number of threads to return */
|
|
93
|
-
limit?: integer;
|
|
94
|
-
}
|
|
95
|
-
namespace Event {
|
|
96
|
-
/** https://discord.com/developers/docs/topics/gateway#thread-list-sync-thread-list-sync-event-fields */
|
|
97
|
-
interface ListSync {
|
|
98
|
-
/** the id of the guild */
|
|
99
|
-
guild_id: snowflake;
|
|
100
|
-
/** the parent channel ids whose threads are being synced. If omitted, then threads were synced for the entire guild. This array may contain channel_ids that have no active threads as well, so you know to clear that data. */
|
|
101
|
-
channel_ids?: snowflake[];
|
|
102
|
-
/** all active threads in the given channels that the current user can access */
|
|
103
|
-
threads: Channel[];
|
|
104
|
-
/** all thread member objects from the synced threads for the current user, indicating which threads the current user has been added to */
|
|
105
|
-
members: ThreadMember[];
|
|
106
|
-
}
|
|
107
|
-
interface MemberUpdate extends ThreadMember {
|
|
108
|
-
}
|
|
109
|
-
/** https://discord.com/developers/docs/topics/gateway#thread-members-update-thread-members-update-event-fields */
|
|
110
|
-
interface MembersUpdate {
|
|
111
|
-
/** the id of the thread */
|
|
112
|
-
id: snowflake;
|
|
113
|
-
/** the id of the guild */
|
|
114
|
-
guild_id: snowflake;
|
|
115
|
-
/** the approximate number of members in the thread, capped at 50 */
|
|
116
|
-
member_count: integer;
|
|
117
|
-
/** the users who were added to the thread */
|
|
118
|
-
added_members?: ThreadMember[];
|
|
119
|
-
/** the id of the users who were removed from the thread */
|
|
120
|
-
removed_member_ids?: snowflake[];
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
declare module './gateway' {
|
|
125
|
-
interface GatewayEvents {
|
|
126
|
-
/** sent when gaining access to a channel, contains all active threads in that channel */
|
|
127
|
-
THREAD_LIST_SYNC: Thread.Event.ListSync;
|
|
128
|
-
/** thread member for the current user was updated */
|
|
129
|
-
THREAD_MEMBER_UPDATE: Thread.Event.MemberUpdate;
|
|
130
|
-
/** some user(s) were added to or removed from a thread */
|
|
131
|
-
THREAD_MEMBERS_UPDATE: Thread.Event.MembersUpdate;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
declare module './internal' {
|
|
135
|
-
interface Internal {
|
|
136
|
-
/**
|
|
137
|
-
* Returns all active threads in the guild, including public and private threads. Threads are ordered by their id, in descending order.
|
|
138
|
-
* @see https://discord.com/developers/docs/resources/guild#list-active-threads
|
|
139
|
-
*/
|
|
140
|
-
/**
|
|
141
|
-
* Creates a new thread from an existing message. Returns a channel on success, and a 400 BAD REQUEST on invalid parameters. Fires a Thread Create Gateway event.
|
|
142
|
-
* @see https://discord.com/developers/docs/resources/channel#start-thread-with-message
|
|
143
|
-
*/
|
|
144
|
-
startThreadWithMessage(channel_id: snowflake, message_id: snowflake, params: Thread.StartWithMessageParams): Promise<Channel>;
|
|
145
|
-
/**
|
|
146
|
-
* Creates a new thread that is not connected to an existing message. The created thread defaults to a GUILD_PRIVATE_THREAD*. Returns a channel on success, and a 400 BAD REQUEST on invalid parameters. Fires a Thread Create Gateway event.
|
|
147
|
-
* @see https://discord.com/developers/docs/resources/channel#start-thread-without-message
|
|
148
|
-
*/
|
|
149
|
-
startThreadWithoutMessage(channel_id: snowflake, params: Thread.StartWithoutMessageParams): Promise<Channel>;
|
|
150
|
-
/**
|
|
151
|
-
* Adds the current user to a thread. Also requires the thread is not archived. Returns a 204 empty response on success. Fires a Thread Members Update Gateway event.
|
|
152
|
-
* @see https://discord.com/developers/docs/resources/channel#join-thread
|
|
153
|
-
*/
|
|
154
|
-
joinThread(channel_id: snowflake): Promise<void>;
|
|
155
|
-
/**
|
|
156
|
-
* Adds another member to a thread. Requires the ability to send messages in the thread. Also requires the thread is not archived. Returns a 204 empty response if the member is successfully added or was already a member of the thread. Fires a Thread Members Update Gateway event.
|
|
157
|
-
* @see https://discord.com/developers/docs/resources/channel#add-thread-member
|
|
158
|
-
*/
|
|
159
|
-
addThreadMember(channel_id: snowflake, user_id: snowflake): Promise<void>;
|
|
160
|
-
/**
|
|
161
|
-
* Removes the current user from a thread. Also requires the thread is not archived. Returns a 204 empty response on success. Fires a Thread Members Update Gateway event.
|
|
162
|
-
* @see https://discord.com/developers/docs/resources/channel#leave-thread
|
|
163
|
-
*/
|
|
164
|
-
leaveThread(channel_id: snowflake): Promise<void>;
|
|
165
|
-
/**
|
|
166
|
-
* Removes another member from a thread. Requires the MANAGE_THREADS permission, or the creator of the thread if it is a GUILD_PRIVATE_THREAD. Also requires the thread is not archived. Returns a 204 empty response on success. Fires a Thread Members Update Gateway event.
|
|
167
|
-
* @see https://discord.com/developers/docs/resources/channel#remove-thread-member
|
|
168
|
-
*/
|
|
169
|
-
removeThreadMember(channel_id: snowflake, user_id: snowflake): Promise<void>;
|
|
170
|
-
/**
|
|
171
|
-
* Returns a thread member object for the specified user if they are a member of the thread, returns a 404 response otherwise.
|
|
172
|
-
* @see https://discord.com/developers/docs/resources/channel#get-thread-member
|
|
173
|
-
*/
|
|
174
|
-
getThreadMember(channel_id: snowflake, user_id: snowflake): Promise<ThreadMember>;
|
|
175
|
-
/**
|
|
176
|
-
* Returns array of thread members objects that are members of the thread.
|
|
177
|
-
* @see https://discord.com/developers/docs/resources/channel#list-thread-members
|
|
178
|
-
*/
|
|
179
|
-
listThreadMembers(channel_id: snowflake): Promise<ThreadMember[]>;
|
|
180
|
-
/**
|
|
181
|
-
* Returns all active threads in the channel, including public and private threads. Threads are ordered by their id, in descending order.
|
|
182
|
-
* @see https://discord.com/developers/docs/resources/channel#list-active-threads
|
|
183
|
-
*/
|
|
184
|
-
listActiveThreads(channel_id: snowflake): Promise<Thread.List>;
|
|
185
|
-
/**
|
|
186
|
-
* Returns archived threads in the channel that are public. When called on a GUILD_TEXT channel, returns threads of type GUILD_PUBLIC_THREAD. When called on a GUILD_NEWS channel returns threads of type GUILD_NEWS_THREAD. Threads are ordered by archive_timestamp, in descending order. Requires the READ_MESSAGE_HISTORY permission.
|
|
187
|
-
* @see https://discord.com/developers/docs/resources/channel#list-public-archived-threads
|
|
188
|
-
*/
|
|
189
|
-
listPublicArchivedThreads(channel_id: snowflake, params?: Thread.ListPublicArchivedParams): Promise<Thread.List>;
|
|
190
|
-
/**
|
|
191
|
-
* Returns archived threads in the channel that are of type GUILD_PRIVATE_THREAD. Threads are ordered by archive_timestamp, in descending order. Requires both the READ_MESSAGE_HISTORY and MANAGE_THREADS permissions.
|
|
192
|
-
* @see https://discord.com/developers/docs/resources/channel#list-private-archived-threads
|
|
193
|
-
*/
|
|
194
|
-
listPrivateArchivedThreads(channel_id: snowflake, params?: Thread.ListPrivateArchivedParams): Promise<Thread.List>;
|
|
195
|
-
/**
|
|
196
|
-
* Returns archived threads in the channel that are of type GUILD_PRIVATE_THREAD, and the user has joined. Threads are ordered by their id, in descending order. Requires the READ_MESSAGE_HISTORY permission.
|
|
197
|
-
* @see https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads
|
|
198
|
-
*/
|
|
199
|
-
listJoinedPrivateArchivedThreads(channel_id: snowflake, params?: Thread.ListJoinedPrivateArchivedParams): Promise<Thread.List>;
|
|
200
|
-
}
|
|
201
|
-
}
|
package/lib/types/user.d.ts
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { integer, Integration, snowflake } from '.';
|
|
2
|
-
/** https://discord.com/developers/docs/resources/user#user-object-user-structure */
|
|
3
|
-
export interface User {
|
|
4
|
-
/** the user's id */
|
|
5
|
-
id: snowflake;
|
|
6
|
-
/** the user's username, not unique across the platform */
|
|
7
|
-
username: string;
|
|
8
|
-
/** the user's 4-digit discord-tag */
|
|
9
|
-
discriminator: string;
|
|
10
|
-
/** the user's avatar hash */
|
|
11
|
-
avatar?: string;
|
|
12
|
-
/** whether the user belongs to an OAuth2 application */
|
|
13
|
-
bot?: boolean;
|
|
14
|
-
/** whether the user is an Official Discord System user (part of the urgent message system) */
|
|
15
|
-
system?: boolean;
|
|
16
|
-
/** whether the user has two factor enabled on their account */
|
|
17
|
-
mfa_enabled?: boolean;
|
|
18
|
-
/** the user's banner hash */
|
|
19
|
-
banner?: string;
|
|
20
|
-
/** the user's banner color encoded as an integer representation of hexadecimal color code */
|
|
21
|
-
accent_color?: integer;
|
|
22
|
-
/** the user's chosen language option */
|
|
23
|
-
locale?: string;
|
|
24
|
-
/** whether the email on this account has been verified */
|
|
25
|
-
verified?: boolean;
|
|
26
|
-
/** the user's email */
|
|
27
|
-
email?: string;
|
|
28
|
-
/** the flags on a user's account */
|
|
29
|
-
flags?: integer;
|
|
30
|
-
/** the type of Nitro subscription on a user's account */
|
|
31
|
-
premium_type?: integer;
|
|
32
|
-
/** the public flags on a user's account */
|
|
33
|
-
public_flags?: integer;
|
|
34
|
-
}
|
|
35
|
-
export declare namespace User {
|
|
36
|
-
namespace Params {
|
|
37
|
-
/** https://discord.com/developers/docs/resources/user#modify-current-user-json-params */
|
|
38
|
-
interface Modify {
|
|
39
|
-
/** user's username, if changed may cause the user's discriminator to be randomized. */
|
|
40
|
-
username: string;
|
|
41
|
-
/** if passed, modifies the user's avatar */
|
|
42
|
-
avatar?: string;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
/** https://discord.com/developers/docs/resources/user#user-object-user-flags */
|
|
47
|
-
export declare enum UserFlag {
|
|
48
|
-
NONE = 0,
|
|
49
|
-
DISCORD_EMPLOYEE = 1,
|
|
50
|
-
PARTNERED_SERVER_OWNER = 2,
|
|
51
|
-
HYPESQUAD_EVENTS = 4,
|
|
52
|
-
BUG_HUNTER_LEVEL_1 = 8,
|
|
53
|
-
HOUSE_BRAVERY = 64,
|
|
54
|
-
HOUSE_BRILLIANCE = 128,
|
|
55
|
-
HOUSE_BALANCE = 256,
|
|
56
|
-
EARLY_SUPPORTER = 512,
|
|
57
|
-
TEAM_USER = 1024,
|
|
58
|
-
BUG_HUNTER_LEVEL_2 = 16384,
|
|
59
|
-
VERIFIED_BOT = 65536,
|
|
60
|
-
EARLY_VERIFIED_BOT_DEVELOPER = 131072,
|
|
61
|
-
DISCORD_CERTIFIED_MODERATOR = 262144
|
|
62
|
-
}
|
|
63
|
-
/** https://discord.com/developers/docs/resources/user#connection-object-connection-structure */
|
|
64
|
-
export interface Connection {
|
|
65
|
-
/** id of the connection account */
|
|
66
|
-
id: string;
|
|
67
|
-
/** the username of the connection account */
|
|
68
|
-
name: string;
|
|
69
|
-
/** the service of the connection (twitch, youtube) */
|
|
70
|
-
type: string;
|
|
71
|
-
/** whether the connection is revoked */
|
|
72
|
-
revoked?: boolean;
|
|
73
|
-
/** an array of partial server integrations */
|
|
74
|
-
integrations?: Partial<Integration>[];
|
|
75
|
-
/** whether the connection is verified */
|
|
76
|
-
verified: boolean;
|
|
77
|
-
/** whether friend sync is enabled for this connection */
|
|
78
|
-
friend_sync: boolean;
|
|
79
|
-
/** whether activities related to this connection will be shown in presence updates */
|
|
80
|
-
show_activity: boolean;
|
|
81
|
-
/** visibility of this connection */
|
|
82
|
-
visibility: integer;
|
|
83
|
-
}
|
|
84
|
-
/** https://discord.com/developers/docs/resources/user#connection-object-visibility-types */
|
|
85
|
-
export declare enum VisibilityType {
|
|
86
|
-
/** invisible to everyone except the user themselves */
|
|
87
|
-
NONE = 0,
|
|
88
|
-
/** visible to everyone */
|
|
89
|
-
EVERYONE = 1
|
|
90
|
-
}
|
|
91
|
-
export interface UserUpdateEvent extends User {
|
|
92
|
-
}
|
|
93
|
-
declare module './gateway' {
|
|
94
|
-
interface GatewayEvents {
|
|
95
|
-
/** properties about the user changed */
|
|
96
|
-
USER_UPDATE: UserUpdateEvent;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
declare module './internal' {
|
|
100
|
-
interface Internal {
|
|
101
|
-
/**
|
|
102
|
-
* Returns the user object of the requester's account. For OAuth2, this requires the identify scope, which will return the object without an email, and optionally the email scope, which returns the object with an email.
|
|
103
|
-
* @see https://discord.com/developers/docs/resources/user#get-current-user
|
|
104
|
-
*/
|
|
105
|
-
getCurrentUser(): Promise<User>;
|
|
106
|
-
/**
|
|
107
|
-
* Returns a user object for a given user ID.
|
|
108
|
-
* @see https://discord.com/developers/docs/resources/user#get-user
|
|
109
|
-
*/
|
|
110
|
-
getUser(id: snowflake): Promise<User>;
|
|
111
|
-
/**
|
|
112
|
-
* Modify the requester's user account settings. Returns a user object on success.
|
|
113
|
-
* @see https://discord.com/developers/docs/resources/user#modify-current-user
|
|
114
|
-
*/
|
|
115
|
-
modifyCurrentUser(params: User.Params.Modify): Promise<User>;
|
|
116
|
-
/**
|
|
117
|
-
* Returns a list of connection objects. Requires the connections OAuth2 scope.
|
|
118
|
-
* @see https://discord.com/developers/docs/resources/user#get-user-connections
|
|
119
|
-
*/
|
|
120
|
-
getUserConnections(): Promise<Connection[]>;
|
|
121
|
-
}
|
|
122
|
-
}
|
package/lib/types/voice.d.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { GuildMember, snowflake, timestamp } from '.';
|
|
2
|
-
/** https://discord.com/developers/docs/resources/voice#voice-state-object-voice-state-structure */
|
|
3
|
-
export interface VoiceState {
|
|
4
|
-
/** the guild id this voice state is for */
|
|
5
|
-
guild_id?: snowflake;
|
|
6
|
-
/** the channel id this user is connected to */
|
|
7
|
-
channel_id?: snowflake;
|
|
8
|
-
/** the user id this voice state is for */
|
|
9
|
-
user_id: snowflake;
|
|
10
|
-
/** the guild member this voice state is for */
|
|
11
|
-
member?: GuildMember;
|
|
12
|
-
/** the session id for this voice state */
|
|
13
|
-
session_id: string;
|
|
14
|
-
/** whether this user is deafened by the server */
|
|
15
|
-
deaf: boolean;
|
|
16
|
-
/** whether this user is muted by the server */
|
|
17
|
-
mute: boolean;
|
|
18
|
-
/** whether this user is locally deafened */
|
|
19
|
-
self_deaf: boolean;
|
|
20
|
-
/** whether this user is locally muted */
|
|
21
|
-
self_mute: boolean;
|
|
22
|
-
/** whether this user is streaming using "Go Live" */
|
|
23
|
-
self_stream?: boolean;
|
|
24
|
-
/** whether this user's camera is enabled */
|
|
25
|
-
self_video: boolean;
|
|
26
|
-
/** whether this user is muted by the current user */
|
|
27
|
-
suppress: boolean;
|
|
28
|
-
/** the time at which the user requested to speak */
|
|
29
|
-
request_to_speak_timestamp?: timestamp;
|
|
30
|
-
}
|
|
31
|
-
export declare namespace VoiceState {
|
|
32
|
-
namespace Params {
|
|
33
|
-
/** https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state-json-params */
|
|
34
|
-
interface ModifyCurrent extends Modify {
|
|
35
|
-
/** sets the user's request to speak */
|
|
36
|
-
request_to_speak_timestamp?: timestamp;
|
|
37
|
-
}
|
|
38
|
-
/** https://discord.com/developers/docs/resources/guild#modify-user-voice-state-json-params */
|
|
39
|
-
interface Modify {
|
|
40
|
-
/** the id of the channel the user is currently in */
|
|
41
|
-
channel_id: snowflake;
|
|
42
|
-
/** toggles the user's suppress state */
|
|
43
|
-
suppress?: boolean;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
/** https://discord.com/developers/docs/resources/voice#voice-region-object-voice-region-structure */
|
|
48
|
-
export interface VoiceRegion {
|
|
49
|
-
/** unique ID for the region */
|
|
50
|
-
id: string;
|
|
51
|
-
/** name of the region */
|
|
52
|
-
name: string;
|
|
53
|
-
/** true for a single server that is closest to the current user's client */
|
|
54
|
-
optimal: boolean;
|
|
55
|
-
/** whether this is a deprecated voice region (avoid switching to these) */
|
|
56
|
-
deprecated: boolean;
|
|
57
|
-
/** whether this is a custom voice region (used for events/etc) */
|
|
58
|
-
custom: boolean;
|
|
59
|
-
}
|
|
60
|
-
export interface VoiceStateUpdateEvent extends VoiceState {
|
|
61
|
-
}
|
|
62
|
-
/** https://discord.com/developers/docs/topics/gateway#voice-server-update-voice-server-update-event-fields */
|
|
63
|
-
export interface VoiceServerUpdateEvent {
|
|
64
|
-
/** voice connection token */
|
|
65
|
-
token: string;
|
|
66
|
-
/** the guild this voice server update is for */
|
|
67
|
-
guild_id: snowflake;
|
|
68
|
-
/** the voice server host */
|
|
69
|
-
endpoint?: string;
|
|
70
|
-
}
|
|
71
|
-
declare module './gateway' {
|
|
72
|
-
interface GatewayEvents {
|
|
73
|
-
/** someone joined, left, or moved a voice channel */
|
|
74
|
-
VOICE_STATE_UPDATE: VoiceStateUpdateEvent;
|
|
75
|
-
/** guild's voice server was updated */
|
|
76
|
-
VOICE_SERVER_UPDATE: VoiceServerUpdateEvent;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
declare module './internal' {
|
|
80
|
-
interface Internal {
|
|
81
|
-
/**
|
|
82
|
-
* Returns an array of voice region objects that can be used when setting a voice or stage channel's rtc_region.
|
|
83
|
-
* @see https://discord.com/developers/docs/resources/voice#list-voice-regions
|
|
84
|
-
*/
|
|
85
|
-
listVoiceRegions(): Promise<VoiceRegion[]>;
|
|
86
|
-
/**
|
|
87
|
-
* Returns a list of voice region objects for the guild. Unlike the similar /voice route, this returns VIP servers when the guild is VIP-enabled.
|
|
88
|
-
* @see https://discord.com/developers/docs/resources/guild#get-guild-voice-regions
|
|
89
|
-
*/
|
|
90
|
-
getGuildVoiceRegions(guild_id: snowflake): Promise<VoiceRegion[]>;
|
|
91
|
-
/**
|
|
92
|
-
* Updates the current user's voice state.
|
|
93
|
-
* @see https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
|
94
|
-
*/
|
|
95
|
-
modifyCurrentUserVoiceState(guild_id: snowflake, params: VoiceState.Params.ModifyCurrent): Promise<VoiceState>;
|
|
96
|
-
/**
|
|
97
|
-
* Updates another user's voice state.
|
|
98
|
-
* @see https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
|
99
|
-
*/
|
|
100
|
-
modifyUserVoiceState(guild_id: snowflake, user_id: snowflake, params: VoiceState.Params.Modify): Promise<VoiceState>;
|
|
101
|
-
}
|
|
102
|
-
}
|
package/lib/types/webhook.d.ts
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { AllowedMentions, Attachment, Channel, Component, Embed, Guild, Message, snowflake, User } from '.';
|
|
2
|
-
/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure */
|
|
3
|
-
export interface Webhook {
|
|
4
|
-
/** the id of the webhook */
|
|
5
|
-
id: snowflake;
|
|
6
|
-
/** the type of the webhook */
|
|
7
|
-
type: Webhook.Type;
|
|
8
|
-
/** the guild id this webhook is for, if any */
|
|
9
|
-
guild_id?: snowflake;
|
|
10
|
-
/** the channel id this webhook is for, if any */
|
|
11
|
-
channel_id?: snowflake;
|
|
12
|
-
/** the user this webhook was created by (not returned when getting a webhook with its token) */
|
|
13
|
-
user?: User;
|
|
14
|
-
/** the default name of the webhook */
|
|
15
|
-
name?: string;
|
|
16
|
-
/** the default user avatar hash of the webhook */
|
|
17
|
-
avatar?: string;
|
|
18
|
-
/** the secure token of the webhook (returned for Incoming Webhooks) */
|
|
19
|
-
token?: string;
|
|
20
|
-
/** the bot/OAuth2 application that created this webhook */
|
|
21
|
-
application_id?: snowflake;
|
|
22
|
-
/** the guild of the channel that this webhook is following (returned for Channel Follower Webhooks) */
|
|
23
|
-
source_guild?: Partial<Guild>;
|
|
24
|
-
/** the channel that this webhook is following (returned for Channel Follower Webhooks) */
|
|
25
|
-
source_channel?: Partial<Channel>;
|
|
26
|
-
/** the url used for executing the webhook (returned by the webhooks OAuth2 flow) */
|
|
27
|
-
url?: string;
|
|
28
|
-
}
|
|
29
|
-
export declare namespace Webhook {
|
|
30
|
-
/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types */
|
|
31
|
-
enum Type {
|
|
32
|
-
/** Incoming Webhooks can post messages to channels with a generated token */
|
|
33
|
-
INCOMING = 1,
|
|
34
|
-
/** Channel Follower Webhooks are internal webhooks used with Channel Following to post new messages into channels */
|
|
35
|
-
CHANNEL_FOLLOWER = 2,
|
|
36
|
-
/** Application webhooks are webhooks used with Interactions */
|
|
37
|
-
APPLICATION = 3
|
|
38
|
-
}
|
|
39
|
-
/** https://discord.com/developers/docs/resources/webhook#create-webhook-json-params */
|
|
40
|
-
interface CreateParams {
|
|
41
|
-
/** name of the webhook (1-80 characters) */
|
|
42
|
-
name: string;
|
|
43
|
-
/** image for the default webhook avatar */
|
|
44
|
-
avatar?: string;
|
|
45
|
-
}
|
|
46
|
-
/** https://discord.com/developers/docs/resources/webhook#modify-webhook-json-params */
|
|
47
|
-
interface ModifyParams {
|
|
48
|
-
/** the default name of the webhook */
|
|
49
|
-
name: string;
|
|
50
|
-
/** image for the default webhook avatar */
|
|
51
|
-
avatar?: string;
|
|
52
|
-
/** the new channel id this webhook should be moved to */
|
|
53
|
-
channel_id: snowflake;
|
|
54
|
-
}
|
|
55
|
-
/** https://discord.com/developers/docs/resources/webhook#execute-webhook-query-string-params */
|
|
56
|
-
interface ExecuteParams {
|
|
57
|
-
/** waits for server confirmation of message send before response, and returns the created message body (defaults to false; when false a message that is not saved does not return an error) */
|
|
58
|
-
wait: boolean;
|
|
59
|
-
/** Send a message to the specified thread within a webhook's channel. The thread will automatically be unarchived. */
|
|
60
|
-
thread_id: snowflake;
|
|
61
|
-
}
|
|
62
|
-
/** https://discord.com/developers/docs/resources/webhook#execute-webhook-jsonform-params */
|
|
63
|
-
interface ExecuteBody {
|
|
64
|
-
/** the message contents (up to 2000 characters) */
|
|
65
|
-
content: string;
|
|
66
|
-
/** override the default username of the webhook */
|
|
67
|
-
username: string;
|
|
68
|
-
/** override the default avatar of the webhook */
|
|
69
|
-
avatar_url: string;
|
|
70
|
-
/** true if this is a TTS message */
|
|
71
|
-
tts: boolean;
|
|
72
|
-
/** embedded rich content */
|
|
73
|
-
embeds: Embed[];
|
|
74
|
-
/** allowed mentions for the message */
|
|
75
|
-
allowed_mentions: AllowedMentions;
|
|
76
|
-
/** the components to include with the message */
|
|
77
|
-
components: Component[];
|
|
78
|
-
/** the contents of the file being sent */
|
|
79
|
-
files: any;
|
|
80
|
-
/** JSON encoded body of non-file params */
|
|
81
|
-
payload_json: string;
|
|
82
|
-
/** attachment objects with filename and description */
|
|
83
|
-
attachments: Partial<Attachment>[];
|
|
84
|
-
}
|
|
85
|
-
/** https://discord.com/developers/docs/resources/webhook#get-webhook-message-query-string-params */
|
|
86
|
-
interface MessageParams {
|
|
87
|
-
/** id of the thread the message is in */
|
|
88
|
-
thread_id: snowflake;
|
|
89
|
-
}
|
|
90
|
-
/** https://discord.com/developers/docs/resources/webhook#edit-webhook-message-jsonform-params */
|
|
91
|
-
interface MessageBody {
|
|
92
|
-
/** the message contents (up to 2000 characters) */
|
|
93
|
-
content: string;
|
|
94
|
-
/** embedded rich content */
|
|
95
|
-
embeds: Embed[];
|
|
96
|
-
/** allowed mentions for the message */
|
|
97
|
-
allowed_mentions: AllowedMentions;
|
|
98
|
-
/** the components to include with the message */
|
|
99
|
-
components: Component[];
|
|
100
|
-
/** the contents of the file being sent/edited */
|
|
101
|
-
files: any;
|
|
102
|
-
/** JSON encoded body of non-file params (multipart/form-data only) */
|
|
103
|
-
payload_json: string;
|
|
104
|
-
/** attached files to keep and possible descriptions for new files */
|
|
105
|
-
attachments: Partial<Attachment>[];
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
/** https://discord.com/developers/docs/topics/gateway#webhooks-update-webhook-update-event-fields */
|
|
109
|
-
export interface WebhooksUpdateEvent {
|
|
110
|
-
/** id of the guild */
|
|
111
|
-
guild_id: snowflake;
|
|
112
|
-
/** id of the channel */
|
|
113
|
-
channel_id: snowflake;
|
|
114
|
-
}
|
|
115
|
-
declare module './gateway' {
|
|
116
|
-
interface GatewayEvents {
|
|
117
|
-
/** guild channel webhook was created, update, or deleted */
|
|
118
|
-
WEBHOOKS_UPDATE: WebhooksUpdateEvent;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
declare module './internal' {
|
|
122
|
-
interface Internal {
|
|
123
|
-
/**
|
|
124
|
-
* Create a new webhook. Requires the MANAGE_WEBHOOKS permission. Returns a webhook object on success. Webhook names follow our naming restrictions that can be found in our Usernames and Nicknames documentation, with the following additional stipulations:
|
|
125
|
-
* @see https://discord.com/developers/docs/resources/webhook#create-webhook
|
|
126
|
-
*/
|
|
127
|
-
createWebhook(channel_id: snowflake, params: Webhook.CreateParams): Promise<Webhook>;
|
|
128
|
-
/**
|
|
129
|
-
* Returns a list of channel webhook objects. Requires the MANAGE_WEBHOOKS permission.
|
|
130
|
-
* @see https://discord.com/developers/docs/resources/webhook#get-channel-webhooks
|
|
131
|
-
*/
|
|
132
|
-
getChannelWebhooks(channel_id: snowflake): Promise<Webhook[]>;
|
|
133
|
-
/**
|
|
134
|
-
* Returns a list of guild webhook objects. Requires the MANAGE_WEBHOOKS permission.
|
|
135
|
-
* @see https://discord.com/developers/docs/resources/webhook#get-guild-webhooks
|
|
136
|
-
*/
|
|
137
|
-
getGuildWebhooks(guild_id: snowflake): Promise<Webhook[]>;
|
|
138
|
-
/**
|
|
139
|
-
* Returns the new webhook object for the given id.
|
|
140
|
-
* @see https://discord.com/developers/docs/resources/webhook#get-webhook
|
|
141
|
-
*/
|
|
142
|
-
getWebhook(webhook_id: snowflake): Promise<Webhook>;
|
|
143
|
-
/**
|
|
144
|
-
* Same as above, except this call does not require authentication and returns no user in the webhook object.
|
|
145
|
-
* @see https://discord.com/developers/docs/resources/webhook#get-webhook-with-token
|
|
146
|
-
*/
|
|
147
|
-
getWebhookWithToken(webhook_id: snowflake, token: string): Promise<Webhook>;
|
|
148
|
-
/**
|
|
149
|
-
* Modify a webhook. Requires the MANAGE_WEBHOOKS permission. Returns the updated webhook object on success.
|
|
150
|
-
* @see https://discord.com/developers/docs/resources/webhook#modify-webhook
|
|
151
|
-
*/
|
|
152
|
-
modifyWebhook(webhook_id: snowflake, params: Webhook.ModifyParams): Promise<Webhook>;
|
|
153
|
-
/**
|
|
154
|
-
* Same as above, except this call does not require authentication, does not accept a channel_id parameter in the body, and does not return a user in the webhook object.
|
|
155
|
-
* @see https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token
|
|
156
|
-
*/
|
|
157
|
-
modifyWebhookWithToken(webhook_id: snowflake, token: string, params: Webhook.ModifyParams): Promise<Webhook>;
|
|
158
|
-
/**
|
|
159
|
-
* Delete a webhook permanently. Requires the MANAGE_WEBHOOKS permission. Returns a 204 No Content response on success.
|
|
160
|
-
* @see https://discord.com/developers/docs/resources/webhook#delete-webhook
|
|
161
|
-
*/
|
|
162
|
-
deleteWebhook(webhook_id: snowflake): Promise<void>;
|
|
163
|
-
/**
|
|
164
|
-
* Same as above, except this call does not require authentication.
|
|
165
|
-
* @see https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token
|
|
166
|
-
*/
|
|
167
|
-
deleteWebhookwithToken(webhook_id: snowflake, token: string): Promise<void>;
|
|
168
|
-
/**
|
|
169
|
-
* Refer to Uploading Files for details on attachments and multipart/form-data requests.
|
|
170
|
-
* @see https://discord.com/developers/docs/resources/webhook#execute-webhook
|
|
171
|
-
*/
|
|
172
|
-
executeWebhook(webhook_id: snowflake, token: string, body: Webhook.ExecuteBody, query: Webhook.ExecuteParams): Promise<void>;
|
|
173
|
-
/**
|
|
174
|
-
* Refer to Slack's documentation for more information. We do not support Slack's channel, icon_emoji, mrkdwn, or mrkdwn_in properties.
|
|
175
|
-
* @see https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook
|
|
176
|
-
*/
|
|
177
|
-
executeSlackCompatibleWebhook(webhook_id: snowflake, token: string, body: null, query: Webhook.ExecuteParams): Promise<void>;
|
|
178
|
-
/**
|
|
179
|
-
* Add a new webhook to your GitHub repo (in the repo's settings), and use this endpoint as the "Payload URL." You can choose what events your Discord channel receives by choosing the "Let me select individual events" option and selecting individual events for the new webhook you're configuring.
|
|
180
|
-
* @see https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook
|
|
181
|
-
*/
|
|
182
|
-
executeGitHubCompatibleWebhook(webhook_id: snowflake, token: string, body: null, query: Webhook.ExecuteParams): Promise<void>;
|
|
183
|
-
/**
|
|
184
|
-
* Returns a previously-sent webhook message from the same token. Returns a message object on success.
|
|
185
|
-
* @see https://discord.com/developers/docs/resources/webhook#get-webhook-message
|
|
186
|
-
*/
|
|
187
|
-
getWebhookMessage(webhook_id: snowflake, token: string, message_id: snowflake, params: Webhook.MessageParams): Promise<Message>;
|
|
188
|
-
/**
|
|
189
|
-
* Edits a previously-sent webhook message from the same token. Returns a message object on success.
|
|
190
|
-
* @see https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
|
191
|
-
*/
|
|
192
|
-
editWebhookMessage(webhook_id: snowflake, token: string, message_id: snowflake, body: Webhook.MessageBody, query: Webhook.MessageParams): Promise<void>;
|
|
193
|
-
/**
|
|
194
|
-
* Deletes a message that was created by the webhook. Returns a 204 No Content response on success.
|
|
195
|
-
* @see https://discord.com/developers/docs/resources/webhook#delete-webhook-message
|
|
196
|
-
*/
|
|
197
|
-
deleteWebhookMessage(webhook_id: snowflake, token: string, message_id: snowflake, params: Webhook.MessageParams): Promise<void>;
|
|
198
|
-
}
|
|
199
|
-
}
|