@satorijs/adapter-discord 3.4.2 → 3.4.3
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.js +102 -43
- package/lib/index.js.map +4 -4
- package/lib/types/application-role-connection.d.ts +51 -0
- package/lib/types/application.d.ts +20 -3
- package/lib/types/audit-log.d.ts +19 -5
- package/lib/types/auto-moderation.d.ts +2 -0
- package/lib/types/ban.d.ts +5 -5
- package/lib/types/channel.d.ts +66 -4
- package/lib/types/command.d.ts +43 -7
- package/lib/types/component.d.ts +33 -31
- package/lib/types/emoji.d.ts +1 -1
- package/lib/types/gateway.d.ts +11 -11
- package/lib/types/guild-member.d.ts +8 -4
- package/lib/types/guild.d.ts +24 -26
- package/lib/types/index.d.ts +1 -0
- package/lib/types/integration.d.ts +6 -6
- package/lib/types/interaction.d.ts +78 -45
- package/lib/types/invite.d.ts +5 -3
- package/lib/types/message.d.ts +15 -5
- package/lib/types/presence.d.ts +23 -24
- package/lib/types/reaction.d.ts +4 -4
- package/lib/types/role.d.ts +12 -4
- package/lib/types/scheduled-event.d.ts +6 -0
- package/lib/types/stage-instance.d.ts +4 -0
- package/lib/types/sticker.d.ts +4 -3
- package/lib/types/thread.d.ts +50 -7
- package/lib/types/user.d.ts +13 -2
- package/lib/types/voice.d.ts +1 -1
- package/lib/types/webhook.d.ts +6 -2
- package/package.json +2 -2
package/lib/types/sticker.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface Sticker {
|
|
|
12
12
|
/** autocomplete/suggestion tags for the sticker (max 200 characters) */
|
|
13
13
|
tags: string;
|
|
14
14
|
/** Deprecated previously the sticker asset hash, now an empty string */
|
|
15
|
-
asset
|
|
15
|
+
asset?: string;
|
|
16
16
|
/** type of sticker */
|
|
17
17
|
type: Sticker.Type;
|
|
18
18
|
/** type of sticker format */
|
|
@@ -38,7 +38,8 @@ export declare namespace Sticker {
|
|
|
38
38
|
enum FormatType {
|
|
39
39
|
PNG = 1,
|
|
40
40
|
APNG = 2,
|
|
41
|
-
LOTTIE = 3
|
|
41
|
+
LOTTIE = 3,
|
|
42
|
+
GIF = 4
|
|
42
43
|
}
|
|
43
44
|
/** https://discord.com/developers/docs/resources/sticker#sticker-item-object-sticker-item-structure */
|
|
44
45
|
interface Item {
|
|
@@ -67,7 +68,7 @@ export declare namespace Sticker {
|
|
|
67
68
|
banner_asset_id: snowflake;
|
|
68
69
|
}
|
|
69
70
|
namespace Event {
|
|
70
|
-
/** https://discord.com/developers/docs/topics/gateway#guild-stickers-update-guild-stickers-update-event-fields */
|
|
71
|
+
/** https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update-guild-stickers-update-event-fields */
|
|
71
72
|
interface Update {
|
|
72
73
|
/** id of the guild */
|
|
73
74
|
guild_id: snowflake;
|
package/lib/types/thread.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Channel, integer, snowflake, timestamp } from '.';
|
|
1
|
+
import { AllowedMentions, Attachment, Channel, Component, Embed, GuildMember, integer, snowflake, timestamp } from '.';
|
|
2
2
|
declare module './channel' {
|
|
3
3
|
interface Channel {
|
|
4
4
|
/** an approximate count of messages in a thread, stops counting at 50 */
|
|
@@ -23,6 +23,8 @@ export interface ThreadMember {
|
|
|
23
23
|
join_timestamp: timestamp;
|
|
24
24
|
/** any user-thread settings, currently only used for notifications */
|
|
25
25
|
flags: integer;
|
|
26
|
+
/** additional information about the user */
|
|
27
|
+
member?: GuildMember;
|
|
26
28
|
}
|
|
27
29
|
/** https://discord.com/developers/docs/resources/channel#thread-metadata-object-thread-metadata-structure */
|
|
28
30
|
export interface ThreadMetadata {
|
|
@@ -36,6 +38,8 @@ export interface ThreadMetadata {
|
|
|
36
38
|
locked: boolean;
|
|
37
39
|
/** whether non-moderators can add other non-moderators to a thread; only available on private threads */
|
|
38
40
|
invitable?: boolean;
|
|
41
|
+
/** timestamp when the thread was created; only populated for threads created after 2022-01-09 */
|
|
42
|
+
create_timestamp?: timestamp;
|
|
39
43
|
}
|
|
40
44
|
/** @see https://discord.com/developers/docs/resources/guild#list-active-guild-threads */
|
|
41
45
|
export interface ListActiveGuildThreadsResult {
|
|
@@ -47,8 +51,8 @@ export interface ListActiveGuildThreadsResult {
|
|
|
47
51
|
export interface Thread extends Channel {
|
|
48
52
|
}
|
|
49
53
|
export declare namespace Thread {
|
|
50
|
-
/** https://discord.com/developers/docs/resources/channel#start-thread-
|
|
51
|
-
interface
|
|
54
|
+
/** https://discord.com/developers/docs/resources/channel#start-thread-from-message */
|
|
55
|
+
interface StartFromMessageParams {
|
|
52
56
|
/** 1-100 character channel name */
|
|
53
57
|
name: string;
|
|
54
58
|
/** duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 */
|
|
@@ -69,6 +73,40 @@ export declare namespace Thread {
|
|
|
69
73
|
/** amount of seconds a user has to wait before sending another message (0-21600) */
|
|
70
74
|
rate_limit_per_user?: integer;
|
|
71
75
|
}
|
|
76
|
+
/** https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel-forum-thread-message-params-object */
|
|
77
|
+
interface StartThreadInFormChannelParams {
|
|
78
|
+
/** 1-100 character channel name */
|
|
79
|
+
name: string;
|
|
80
|
+
/** duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 */
|
|
81
|
+
auto_archive_duration?: integer;
|
|
82
|
+
/** amount of seconds a user has to wait before sending another message (0-21600) */
|
|
83
|
+
rate_limit_per_user?: integer;
|
|
84
|
+
/** contents of the first message in the forum thread */
|
|
85
|
+
message: FormThreadMessageParams;
|
|
86
|
+
/** the IDs of the set of tags that have been applied to a thread in a GUILD_FORUM channel */
|
|
87
|
+
applied_tags?: snowflake[];
|
|
88
|
+
}
|
|
89
|
+
/** https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel-forum-thread-message-params-object */
|
|
90
|
+
interface FormThreadMessageParams {
|
|
91
|
+
/** Message contents (up to 2000 characters) */
|
|
92
|
+
content?: string;
|
|
93
|
+
/** Embedded rich content (up to 6000 characters) */
|
|
94
|
+
embeds?: Embed[];
|
|
95
|
+
/** Allowed mentions for the message */
|
|
96
|
+
allowed_mentions?: AllowedMentions;
|
|
97
|
+
/** Components to include with the message */
|
|
98
|
+
components?: Component[];
|
|
99
|
+
/** IDs of up to 3 stickers in the server to send in the message */
|
|
100
|
+
sticker_ids?: snowflake[];
|
|
101
|
+
/** Contents of the file being sent. */
|
|
102
|
+
files: any[];
|
|
103
|
+
/** JSON-encoded body of non-file params, only for multipart/form-data requests. */
|
|
104
|
+
payload_json?: string;
|
|
105
|
+
/** Attachment objects with filename and description. */
|
|
106
|
+
attachments?: Partial<Attachment>[];
|
|
107
|
+
/** Message flags combined as a bitfield (only SUPPRESS_EMBEDS can be set) */
|
|
108
|
+
flags?: integer;
|
|
109
|
+
}
|
|
72
110
|
/** https://discord.com/developers/docs/resources/channel#list-active-threads-response-body */
|
|
73
111
|
interface List {
|
|
74
112
|
/** the active threads */
|
|
@@ -100,7 +138,7 @@ export declare namespace Thread {
|
|
|
100
138
|
limit?: integer;
|
|
101
139
|
}
|
|
102
140
|
namespace Event {
|
|
103
|
-
/** https://discord.com/developers/docs/topics/gateway#thread-list-sync-thread-list-sync-event-fields */
|
|
141
|
+
/** https://discord.com/developers/docs/topics/gateway-events#thread-list-sync-thread-list-sync-event-fields */
|
|
104
142
|
interface ListSync {
|
|
105
143
|
/** the id of the guild */
|
|
106
144
|
guild_id: snowflake;
|
|
@@ -113,7 +151,7 @@ export declare namespace Thread {
|
|
|
113
151
|
}
|
|
114
152
|
interface MemberUpdate extends ThreadMember {
|
|
115
153
|
}
|
|
116
|
-
/** https://discord.com/developers/docs/topics/gateway#thread-members-update-thread-members-update-event-fields */
|
|
154
|
+
/** https://discord.com/developers/docs/topics/gateway-events#thread-members-update-thread-members-update-event-fields */
|
|
117
155
|
interface MembersUpdate {
|
|
118
156
|
/** the id of the thread */
|
|
119
157
|
id: snowflake;
|
|
@@ -147,9 +185,14 @@ declare module './internal' {
|
|
|
147
185
|
listActiveGuildThreads(guild_id: snowflake): Promise<ListActiveGuildThreadsResult>;
|
|
148
186
|
/**
|
|
149
187
|
* 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.
|
|
150
|
-
* @see https://discord.com/developers/docs/resources/channel#start-thread-
|
|
188
|
+
* @see https://discord.com/developers/docs/resources/channel#start-thread-from-message
|
|
189
|
+
*/
|
|
190
|
+
startThreadFromMessage(channel_id: snowflake, message_id: snowflake, params: Thread.StartFromMessageParams): Promise<Channel>;
|
|
191
|
+
/**
|
|
192
|
+
* Creates a new thread in a forum channel, and sends a message within the created thread. Returns a channel, with a nested message object, on success, and a 400 BAD REQUEST on invalid parameters. Fires a Thread Create and Message Create Gateway event.
|
|
193
|
+
* @see https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
|
|
151
194
|
*/
|
|
152
|
-
|
|
195
|
+
startThreadInForumChannel(channel_id: snowflake, params: Thread.StartThreadInFormChannelParams): Promise<Channel>;
|
|
153
196
|
/**
|
|
154
197
|
* 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.
|
|
155
198
|
* @see https://discord.com/developers/docs/resources/channel#start-thread-without-message
|
package/lib/types/user.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export interface User {
|
|
|
28
28
|
/** the flags on a user's account */
|
|
29
29
|
flags?: integer;
|
|
30
30
|
/** the type of Nitro subscription on a user's account */
|
|
31
|
-
premium_type?:
|
|
31
|
+
premium_type?: PremiumType;
|
|
32
32
|
/** the public flags on a user's account */
|
|
33
33
|
public_flags?: integer;
|
|
34
34
|
}
|
|
@@ -58,7 +58,16 @@ export declare enum UserFlag {
|
|
|
58
58
|
BUG_HUNTER_LEVEL_2 = 16384,
|
|
59
59
|
VERIFIED_BOT = 65536,
|
|
60
60
|
EARLY_VERIFIED_BOT_DEVELOPER = 131072,
|
|
61
|
-
DISCORD_CERTIFIED_MODERATOR = 262144
|
|
61
|
+
DISCORD_CERTIFIED_MODERATOR = 262144,
|
|
62
|
+
BOT_HTTP_INTERACTIONS = 524288,
|
|
63
|
+
ACTIVE_DEVELOPER = 4194304
|
|
64
|
+
}
|
|
65
|
+
/** https://discord.com/developers/docs/resources/user#user-object-premium-types */
|
|
66
|
+
export declare enum PremiumType {
|
|
67
|
+
NONE = 0,
|
|
68
|
+
NITRO_CLASSIC = 1,
|
|
69
|
+
NITRO = 2,
|
|
70
|
+
NITRO_BASIC = 3
|
|
62
71
|
}
|
|
63
72
|
/** https://discord.com/developers/docs/resources/user#connection-object-connection-structure */
|
|
64
73
|
export interface Connection {
|
|
@@ -78,6 +87,8 @@ export interface Connection {
|
|
|
78
87
|
friend_sync: boolean;
|
|
79
88
|
/** whether activities related to this connection will be shown in presence updates */
|
|
80
89
|
show_activity: boolean;
|
|
90
|
+
/** whether this connection has a corresponding third party OAuth2 token */
|
|
91
|
+
two_way_link: boolean;
|
|
81
92
|
/** visibility of this connection */
|
|
82
93
|
visibility: integer;
|
|
83
94
|
}
|
package/lib/types/voice.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export interface VoiceRegion {
|
|
|
59
59
|
}
|
|
60
60
|
export interface VoiceStateUpdateEvent extends VoiceState {
|
|
61
61
|
}
|
|
62
|
-
/** https://discord.com/developers/docs/topics/gateway#voice-server-update-voice-server-update-event-fields */
|
|
62
|
+
/** https://discord.com/developers/docs/topics/gateway-events#voice-server-update-voice-server-update-event-fields */
|
|
63
63
|
export interface VoiceServerUpdateEvent {
|
|
64
64
|
/** voice connection token */
|
|
65
65
|
token: string;
|
package/lib/types/webhook.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AllowedMentions, Attachment, Channel, Component, Embed, Guild, Message, snowflake, User } from '.';
|
|
1
|
+
import { AllowedMentions, Attachment, Channel, Component, Embed, Guild, integer, Message, snowflake, User } from '.';
|
|
2
2
|
/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure */
|
|
3
3
|
export interface Webhook {
|
|
4
4
|
/** the id of the webhook */
|
|
@@ -81,6 +81,10 @@ export declare namespace Webhook {
|
|
|
81
81
|
payload_json: string;
|
|
82
82
|
/** attachment objects with filename and description */
|
|
83
83
|
attachments: Partial<Attachment>[];
|
|
84
|
+
/** message flags combined as a bitfield (only SUPPRESS_EMBEDS can be set) */
|
|
85
|
+
flags: integer;
|
|
86
|
+
/** name of thread to create (requires the webhook channel to be a forum channel) */
|
|
87
|
+
thread_name: string;
|
|
84
88
|
}
|
|
85
89
|
/** https://discord.com/developers/docs/resources/webhook#get-webhook-message-query-string-params */
|
|
86
90
|
interface MessageParams {
|
|
@@ -105,7 +109,7 @@ export declare namespace Webhook {
|
|
|
105
109
|
attachments: Partial<Attachment>[];
|
|
106
110
|
}
|
|
107
111
|
}
|
|
108
|
-
/** https://discord.com/developers/docs/topics/gateway#webhooks-update-
|
|
112
|
+
/** https://discord.com/developers/docs/topics/gateway-events#webhooks-update-webhooks-update-event-fields */
|
|
109
113
|
export interface WebhooksUpdateEvent {
|
|
110
114
|
/** id of the guild */
|
|
111
115
|
guild_id: snowflake;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@satorijs/adapter-discord",
|
|
3
3
|
"description": "Discord Adapter for Satorijs",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.3",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"satori"
|
|
30
30
|
],
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@satorijs/satori": "^2.0
|
|
32
|
+
"@satorijs/satori": "^2.1.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"file-type": "^16.5.4",
|