dfx 0.45.9 → 0.46.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/DiscordREST.d.ts +2 -1
- package/DiscordREST.d.ts.map +1 -1
- package/DiscordREST.js +6 -2
- package/DiscordREST.js.map +1 -1
- package/Helpers/permissions.d.ts +2 -2
- package/Helpers/permissions.d.ts.map +1 -1
- package/Interactions/builder.d.ts +4 -3
- package/Interactions/builder.d.ts.map +1 -1
- package/Interactions/builder.js.map +1 -1
- package/Interactions/gateway.js.map +1 -1
- package/package.json +6 -6
- package/src/DiscordREST.ts +8 -2
- package/src/Interactions/builder.ts +2 -1
- package/src/Interactions/gateway.ts +1 -1
- package/src/package.json +6 -6
- package/src/types.ts +33 -3
- package/types.d.ts +17 -6
- package/types.d.ts.map +1 -1
- package/types.js +12 -5
- package/types.js.map +1 -1
package/DiscordREST.d.ts
CHANGED
|
@@ -6,8 +6,9 @@ import { Log } from "./Log.js";
|
|
|
6
6
|
import { RateLimitStore } from "./RateLimit.js";
|
|
7
7
|
export declare class DiscordRESTError {
|
|
8
8
|
readonly error: Http.HttpClientError;
|
|
9
|
+
readonly body?: unknown;
|
|
9
10
|
readonly _tag = "DiscordRESTError";
|
|
10
|
-
constructor(error: Http.HttpClientError);
|
|
11
|
+
constructor(error: Http.HttpClientError, body?: unknown);
|
|
11
12
|
}
|
|
12
13
|
export { ResponseDecodeError } from "@effect-http/client";
|
|
13
14
|
export interface DiscordREST extends Discord.Endpoints<Partial<Http.MakeOptions>> {
|
package/DiscordREST.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscordREST.d.ts","sourceRoot":"","sources":["src/DiscordREST.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,IAAI,MAAM,qBAAqB,CAAA;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAgB,MAAM,wBAAwB,CAAA;AAMvE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAGL,cAAc,EAEf,MAAM,gBAAgB,CAAA;AAGvB,qBAAa,gBAAgB;IAEf,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,eAAe;
|
|
1
|
+
{"version":3,"file":"DiscordREST.d.ts","sourceRoot":"","sources":["src/DiscordREST.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,IAAI,MAAM,qBAAqB,CAAA;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAgB,MAAM,wBAAwB,CAAA;AAMvE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAGL,cAAc,EAEf,MAAM,gBAAgB,CAAA;AAGvB,qBAAa,gBAAgB;IAEf,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,eAAe;IAAE,QAAQ,CAAC,IAAI,CAAC;IADhE,QAAQ,CAAC,IAAI,sBAAqB;gBACb,KAAK,EAAE,IAAI,CAAC,eAAe,EAAW,IAAI,CAAC,SAAS;CAC1E;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AA2LzD,MAAM,WAAW,WACf,SAAQ,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACpD,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,OAAO,EAC7B,OAAO,EAAE,IAAI,CAAC,OAAO,KAClB,MAAM,CAAC,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAA;CAC1D;AAED,eAAO,MAAM,WAAW,8DAAqB,CAAA;AAC7C,eAAO,MAAM,eAAe,kIACwB,CAAA"}
|
package/DiscordREST.js
CHANGED
|
@@ -17,9 +17,11 @@ import { LiveRateLimiter, RateLimitStore, RateLimiter, } from "./RateLimit.js";
|
|
|
17
17
|
import Pkg from "./package.json" assert { type: "json" };
|
|
18
18
|
export class DiscordRESTError {
|
|
19
19
|
error;
|
|
20
|
+
body;
|
|
20
21
|
_tag = "DiscordRESTError";
|
|
21
|
-
constructor(error) {
|
|
22
|
+
constructor(error, body) {
|
|
22
23
|
this.error = error;
|
|
24
|
+
this.body = body;
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
export { ResponseDecodeError } from "@effect-http/client";
|
|
@@ -72,7 +74,9 @@ const make = tsplus_module_3.flatMap(DiscordConfig, ({ token, rest }) => tsplus_
|
|
|
72
74
|
const httpExecutor = tsplus_module_7.catchAll(tsplus_module_7.contramap(tsplus_module_7.filterStatusOk(http.execute), _ => tsplus_module_1.setHeaders(tsplus_module_1.updateUrl(_, _ => `${rest.baseUrl}${_}`), {
|
|
73
75
|
Authorization: `Bot ${tsplus_module_6.value(token)}`,
|
|
74
76
|
"User-Agent": `DiscordBot (https://github.com/tim-smart/dfx, ${Pkg.version})`,
|
|
75
|
-
})),
|
|
77
|
+
})), error => error._tag === "StatusCodeError"
|
|
78
|
+
? tsplus_module_3.flatMap(tsplus_module_3.mapError(error.response.json, _ => new DiscordRESTError(_)), body => tsplus_module_3.fail(new DiscordRESTError(error, body)))
|
|
79
|
+
: tsplus_module_3.fail(new DiscordRESTError(error)));
|
|
76
80
|
const executor = (request) => tsplus_module_3.catchTag(tsplus_module_3.flatMap(requestRateLimit(request.url, request), () => tsplus_module_3.flatMap(globalRateLimit, () => tsplus_module_3.flatMap(httpExecutor(request), response => tsplus_module_3.map(updateBuckets(request, response), () => response)))), "DiscordRESTError", e => {
|
|
77
81
|
if (e.error._tag !== "StatusCodeError") {
|
|
78
82
|
return tsplus_module_3.fail(e);
|
package/DiscordREST.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscordREST.js","sourceRoot":"","sources":["src/DiscordREST.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,KAAK,IAAI,MAAM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AAC,OAAO,EAAE;gBACZ,IAAI,MAAM,EAAE;oBACV,OAAO,GAAG,6BAAA,OAAO,EAAc,MAAa,CAAC,CAAA;iBAC9C;aACF;iBAAM,IACL,MAAM;gBACN,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM;gBAC5B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,cAAc,EAC1C;gBACA,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;aACxE;iBAAM,IAAI,MAAM,EAAE;gBACjB,OAAO,GAAG,yBAAA,OAAO,EAAU,MAAM,CAAC,CAAA;aACnC;YAED,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAA;QAC1B,CAAC,CACF,CAAA;QAED,OAAO;YACL,GAAG,MAAM;YACT,QAAQ;SACT,CAAA;;MACD,CAAA;AASF,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAA,GAAG,EAAe,CAAA;AAC7C,MAAM,CAAC,MAAM,eAAe,4BACP,wBAAa,WAAW,EAAE,IAAI,CAAC,EAAlD,eAAe,CAAmC,CAAA"}
|
package/Helpers/permissions.d.ts
CHANGED
|
@@ -10,11 +10,11 @@ export declare const has: (flag: string | bigint) => (bits: string | bigint) =>
|
|
|
10
10
|
/**
|
|
11
11
|
* Convert a permissions bitfield to a list of flag names.
|
|
12
12
|
*/
|
|
13
|
-
export declare const toList: (bitfield: bigint) => ("CREATE_INSTANT_INVITE" | "KICK_MEMBERS" | "BAN_MEMBERS" | "ADMINISTRATOR" | "MANAGE_CHANNELS" | "MANAGE_GUILD" | "ADD_REACTIONS" | "VIEW_AUDIT_LOG" | "PRIORITY_SPEAKER" | "STREAM" | "VIEW_CHANNEL" | "SEND_MESSAGES" | "SEND_TTS_MESSAGES" | "MANAGE_MESSAGES" | "EMBED_LINKS" | "ATTACH_FILES" | "READ_MESSAGE_HISTORY" | "MENTION_EVERYONE" | "USE_EXTERNAL_EMOJIS" | "VIEW_GUILD_INSIGHTS" | "CONNECT" | "SPEAK" | "MUTE_MEMBERS" | "DEAFEN_MEMBERS" | "MOVE_MEMBERS" | "USE_VAD" | "CHANGE_NICKNAME" | "MANAGE_NICKNAMES" | "MANAGE_ROLES" | "MANAGE_WEBHOOKS" | "MANAGE_GUILD_EXPRESSIONS" | "USE_APPLICATION_COMMANDS" | "REQUEST_TO_SPEAK" | "MANAGE_EVENTS" | "MANAGE_THREADS" | "CREATE_PUBLIC_THREADS" | "CREATE_PRIVATE_THREADS" | "USE_EXTERNAL_STICKERS" | "SEND_MESSAGES_IN_THREADS" | "USE_EMBEDDED_ACTIVITIES" | "MODERATE_MEMBERS" | "VIEW_CREATOR_MONETIZATION_ANALYTICS" | "USE_SOUNDBOARD" | "SEND_VOICE_MESSAGES")[];
|
|
13
|
+
export declare const toList: (bitfield: bigint) => ("CREATE_INSTANT_INVITE" | "KICK_MEMBERS" | "BAN_MEMBERS" | "ADMINISTRATOR" | "MANAGE_CHANNELS" | "MANAGE_GUILD" | "ADD_REACTIONS" | "VIEW_AUDIT_LOG" | "PRIORITY_SPEAKER" | "STREAM" | "VIEW_CHANNEL" | "SEND_MESSAGES" | "SEND_TTS_MESSAGES" | "MANAGE_MESSAGES" | "EMBED_LINKS" | "ATTACH_FILES" | "READ_MESSAGE_HISTORY" | "MENTION_EVERYONE" | "USE_EXTERNAL_EMOJIS" | "VIEW_GUILD_INSIGHTS" | "CONNECT" | "SPEAK" | "MUTE_MEMBERS" | "DEAFEN_MEMBERS" | "MOVE_MEMBERS" | "USE_VAD" | "CHANGE_NICKNAME" | "MANAGE_NICKNAMES" | "MANAGE_ROLES" | "MANAGE_WEBHOOKS" | "MANAGE_GUILD_EXPRESSIONS" | "USE_APPLICATION_COMMANDS" | "REQUEST_TO_SPEAK" | "MANAGE_EVENTS" | "MANAGE_THREADS" | "CREATE_PUBLIC_THREADS" | "CREATE_PRIVATE_THREADS" | "USE_EXTERNAL_STICKERS" | "SEND_MESSAGES_IN_THREADS" | "USE_EMBEDDED_ACTIVITIES" | "MODERATE_MEMBERS" | "VIEW_CREATOR_MONETIZATION_ANALYTICS" | "USE_SOUNDBOARD" | "USE_EXTERNAL_SOUNDS" | "SEND_VOICE_MESSAGES")[];
|
|
14
14
|
/**
|
|
15
15
|
* Convert a list of flag names to a bitfield.
|
|
16
16
|
*/
|
|
17
|
-
export declare const fromList: (list: ("CREATE_INSTANT_INVITE" | "KICK_MEMBERS" | "BAN_MEMBERS" | "ADMINISTRATOR" | "MANAGE_CHANNELS" | "MANAGE_GUILD" | "ADD_REACTIONS" | "VIEW_AUDIT_LOG" | "PRIORITY_SPEAKER" | "STREAM" | "VIEW_CHANNEL" | "SEND_MESSAGES" | "SEND_TTS_MESSAGES" | "MANAGE_MESSAGES" | "EMBED_LINKS" | "ATTACH_FILES" | "READ_MESSAGE_HISTORY" | "MENTION_EVERYONE" | "USE_EXTERNAL_EMOJIS" | "VIEW_GUILD_INSIGHTS" | "CONNECT" | "SPEAK" | "MUTE_MEMBERS" | "DEAFEN_MEMBERS" | "MOVE_MEMBERS" | "USE_VAD" | "CHANGE_NICKNAME" | "MANAGE_NICKNAMES" | "MANAGE_ROLES" | "MANAGE_WEBHOOKS" | "MANAGE_GUILD_EXPRESSIONS" | "USE_APPLICATION_COMMANDS" | "REQUEST_TO_SPEAK" | "MANAGE_EVENTS" | "MANAGE_THREADS" | "CREATE_PUBLIC_THREADS" | "CREATE_PRIVATE_THREADS" | "USE_EXTERNAL_STICKERS" | "SEND_MESSAGES_IN_THREADS" | "USE_EMBEDDED_ACTIVITIES" | "MODERATE_MEMBERS" | "VIEW_CREATOR_MONETIZATION_ANALYTICS" | "USE_SOUNDBOARD" | "SEND_VOICE_MESSAGES")[]) => bigint;
|
|
17
|
+
export declare const fromList: (list: ("CREATE_INSTANT_INVITE" | "KICK_MEMBERS" | "BAN_MEMBERS" | "ADMINISTRATOR" | "MANAGE_CHANNELS" | "MANAGE_GUILD" | "ADD_REACTIONS" | "VIEW_AUDIT_LOG" | "PRIORITY_SPEAKER" | "STREAM" | "VIEW_CHANNEL" | "SEND_MESSAGES" | "SEND_TTS_MESSAGES" | "MANAGE_MESSAGES" | "EMBED_LINKS" | "ATTACH_FILES" | "READ_MESSAGE_HISTORY" | "MENTION_EVERYONE" | "USE_EXTERNAL_EMOJIS" | "VIEW_GUILD_INSIGHTS" | "CONNECT" | "SPEAK" | "MUTE_MEMBERS" | "DEAFEN_MEMBERS" | "MOVE_MEMBERS" | "USE_VAD" | "CHANGE_NICKNAME" | "MANAGE_NICKNAMES" | "MANAGE_ROLES" | "MANAGE_WEBHOOKS" | "MANAGE_GUILD_EXPRESSIONS" | "USE_APPLICATION_COMMANDS" | "REQUEST_TO_SPEAK" | "MANAGE_EVENTS" | "MANAGE_THREADS" | "CREATE_PUBLIC_THREADS" | "CREATE_PRIVATE_THREADS" | "USE_EXTERNAL_STICKERS" | "SEND_MESSAGES_IN_THREADS" | "USE_EMBEDDED_ACTIVITIES" | "MODERATE_MEMBERS" | "VIEW_CREATOR_MONETIZATION_ANALYTICS" | "USE_SOUNDBOARD" | "USE_EXTERNAL_SOUNDS" | "SEND_VOICE_MESSAGES")[]) => bigint;
|
|
18
18
|
/**
|
|
19
19
|
* Reduce a list of roles to a bitfield of all the permissions added together.
|
|
20
20
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/Helpers/permissions.ts"],"names":[],"mappings":";AAGA;;GAEG;AACH,eAAO,MAAM,GAAG,QAAoC,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,GAAG,+DAAkB,CAAA;AAElC;;GAEG;AACH,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/Helpers/permissions.ts"],"names":[],"mappings":";AAGA;;GAEG;AACH,eAAO,MAAM,GAAG,QAAoC,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,GAAG,+DAAkB,CAAA;AAElC;;GAEG;AACH,eAAO,MAAM,MAAM,67BAAuC,CAAA;AAE1D;;GAEG;AACH,eAAO,MAAM,QAAQ,y7BAA+C,CAAA;AAEpE;;GAEG;AACH,eAAO,MAAM,QAAQ,UAAW,QAAQ,IAAI,EAAE,WAI3C,CAAA;AAEH;;GAEG;AACH,eAAO,MAAM,SAAS,UACZ,QAAQ,IAAI,EAAE,cAAc,QAAQ,WAAW,WACT,CAAA;AAuBhD;;;GAGG;AACH,eAAO,MAAM,UAAU,UACb,QAAQ,IAAI,EAAE,uDACiC,QAAQ,OAAO,oBACvD,QAAQ,WAAW,GAAG,QAAQ,IAAI,WA4BhD,CAAA;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe,gBACZ,MAAM,kBAAkB,QAAQ,SAAS,EAAE,WAKtD,CAAA;AAEL,UAAU,UAAU,CAAC,CAAC;IACpB,YAAY,EAAE,CACZ,QAAQ,EAAE,MAAM,KACb,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;CACzD;AAED,eAAO,MAAM,YAAY,6CACoB,MAAM,eAEtC,QAAQ,OAAO,gBACV,QAAQ,WAAW,GAAG,QAAQ,IAAI,0DAQ9C,CAAA;AAEN,eAAO,MAAM,UAAU,6CACsB,MAAM,eACvC,QAAQ,SAAS,UAAU,QAAQ,WAAW,0DASpD,CAAA"}
|
|
@@ -3,6 +3,7 @@ import * as Http from "@effect-http/client";
|
|
|
3
3
|
import { DiscordREST } from "dfx";
|
|
4
4
|
import { Discord, Effect } from "dfx/_common";
|
|
5
5
|
import * as D from "./definitions.js";
|
|
6
|
+
import { DiscordRESTError } from "dfx/DiscordREST";
|
|
6
7
|
type ExtractTag<A> = A extends {
|
|
7
8
|
_tag: infer Tag;
|
|
8
9
|
} ? Tag extends string ? Tag : never : never;
|
|
@@ -41,9 +42,9 @@ export declare class InteractionBuilder<R, E, TE> {
|
|
|
41
42
|
}>>> | Exclude<E1, E> | Exclude<Exclude<E, {
|
|
42
43
|
_tag: T;
|
|
43
44
|
}>, E>>;
|
|
44
|
-
get syncGlobal(): Effect<DiscordREST,
|
|
45
|
-
syncGuild(appId: Discord.Snowflake, guildId: Discord.Snowflake): Effect<DiscordREST,
|
|
45
|
+
get syncGlobal(): Effect<DiscordREST, DiscordRESTError | Http.ResponseDecodeError, import("../DiscordREST/types.js").ResponseWithData<Discord.ApplicationCommand[]>>;
|
|
46
|
+
syncGuild(appId: Discord.Snowflake, guildId: Discord.Snowflake): Effect<DiscordREST, DiscordRESTError, import("../DiscordREST/types.js").ResponseWithData<Discord.ApplicationCommand[]>>;
|
|
46
47
|
}
|
|
47
|
-
export declare const builder: InteractionBuilder<never, never,
|
|
48
|
+
export declare const builder: InteractionBuilder<never, never, DiscordRESTError>;
|
|
48
49
|
export {};
|
|
49
50
|
//# sourceMappingURL=builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../src/Interactions/builder.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,IAAI,MAAM,qBAAqB,CAAA;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,CAAC,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../src/Interactions/builder.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,IAAI,MAAM,qBAAqB,CAAA;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,CAAC,MAAM,kBAAkB,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM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mBAAmB,CAAC;cAES,CAAC;;cAAD,CAAC;;cAAD,CAAC;;IAK5D,IAAI,UAAU,uJAmBb;IAED,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,SAAS;CAiB/D;AAED,eAAO,MAAM,OAAO,oDAGnB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/Interactions/builder.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,IAAI,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/Interactions/builder.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,IAAI,MAAM,qBAAqB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAWjC;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAElB;IAMA;IAPX,YACW,WAKR,EACQ,SAA+D;QAN/D,gBAAW,GAAX,WAAW,CAKnB;QACQ,cAAS,GAAT,SAAS,CAAsD;IACvE,CAAC;IAEJ,GAAG,CAAS,UAA2C;QACrD,OAAO,IAAI,kBAAkB,CAC3B,uBAAA,IAAI,CAAC,WAAW,EAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAU,CAAC,EAC9D,IAAI,CAAC,SAAS,CACf,CAAA;IACH,CAAC;IAED,MAAM,CAAc,OAAwC;QAC1D,OAAO,IAAI,kBAAkB,CAC3B,uBAAA,IAAI,CAAC,WAAW,EAAQ,OAAO,CAAC,WAAW,CAAC,EAC5C,IAAI,CAAC,SAAS,CACf,CAAA;IACH,CAAC;IAEO,kBAAkB,CACxB,CAAsD;QAEtD,O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BAAA,6BAAA,GAAG,EAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EAAS,CAAC,CAAC,EAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IAEzE,MAAM,GAAG,GAAG,CACV,OAEuB,EACvB,IAAc,EACd,EAAE,CACF,8BAAA,KAAK;SACF,IAAI,EAAE,EACQ,EAAE,CAAC,EAAE,CAAC,MAAc,CAAC,CAAC,EAAE,CAAC,8BAAA,CAAC,EAAe,OAAO,CAAC,EAAE,IAAI,EAAjD,EAAE,CAAgD,CAAC,CAAA;IAE5E,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAW,CAAA;GACjC,CAAA;AAmBF,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAA,GAAG,EAAwB,CAAA;AAC/D,MAAM,CAAC,MAAM,wBAAwB,GACnC,wBAAA,YAAY,EAAS,oBAAoB,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dfx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"./*": "./*.js"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@tim-smart/discord-api-docs-parser": "^0.5.
|
|
27
|
+
"@tim-smart/discord-api-docs-parser": "^0.5.3",
|
|
28
28
|
"@tsplus-types/effect__data": "0.12.2-3b576ba",
|
|
29
29
|
"@tsplus-types/effect__io": "0.25.9-11739c0",
|
|
30
30
|
"@tsplus-types/effect__stream": "0.21.1-3b576ba",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"typescript": "https://cdn.jsdelivr.net/npm/@tsplus/installer@0.0.171/compiler/typescript.tgz"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@effect-http/client": "^0.26.
|
|
39
|
-
"@effect/data": "^0.12.
|
|
40
|
-
"@effect/io": "~0.25.
|
|
38
|
+
"@effect-http/client": "^0.26.1",
|
|
39
|
+
"@effect/data": "^0.12.3",
|
|
40
|
+
"@effect/io": "~0.25.13",
|
|
41
41
|
"@effect/stream": "~0.21.1",
|
|
42
42
|
"tweetnacl": "^1.0.3"
|
|
43
43
|
},
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"ws": "^8.13.0"
|
|
49
49
|
},
|
|
50
50
|
"sideEffects": false,
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "32080f0932a56532233d0e2ebf38852afd0b5a00"
|
|
52
52
|
}
|
package/src/DiscordREST.ts
CHANGED
|
@@ -18,7 +18,7 @@ import Pkg from "./package.json" assert { type: "json" }
|
|
|
18
18
|
|
|
19
19
|
export class DiscordRESTError {
|
|
20
20
|
readonly _tag = "DiscordRESTError"
|
|
21
|
-
constructor(readonly error: Http.HttpClientError) {}
|
|
21
|
+
constructor(readonly error: Http.HttpClientError, readonly body?: unknown) {}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export { ResponseDecodeError } from "@effect-http/client"
|
|
@@ -113,7 +113,13 @@ const make = Do($ => {
|
|
|
113
113
|
"User-Agent": `DiscordBot (https://github.com/tim-smart/dfx, ${Pkg.version})`,
|
|
114
114
|
}),
|
|
115
115
|
)
|
|
116
|
-
.catchAll(
|
|
116
|
+
.catchAll(error =>
|
|
117
|
+
error._tag === "StatusCodeError"
|
|
118
|
+
? error.response.json
|
|
119
|
+
.mapError(_ => new DiscordRESTError(_))
|
|
120
|
+
.flatMap(body => Effect.fail(new DiscordRESTError(error, body)))
|
|
121
|
+
: Effect.fail(new DiscordRESTError(error)),
|
|
122
|
+
)
|
|
117
123
|
|
|
118
124
|
const executor = <A = unknown>(
|
|
119
125
|
request: Http.Request,
|
|
@@ -3,6 +3,7 @@ import { catchTag } from "@effect/io/Effect"
|
|
|
3
3
|
import { DiscordREST } from "dfx"
|
|
4
4
|
import { Discord, Effect } from "dfx/_common"
|
|
5
5
|
import * as D from "./definitions.js"
|
|
6
|
+
import { DiscordRESTError } from "dfx/DiscordREST"
|
|
6
7
|
|
|
7
8
|
type ExtractTag<A> = A extends { _tag: infer Tag }
|
|
8
9
|
? Tag extends string
|
|
@@ -150,7 +151,7 @@ export class InteractionBuilder<R, E, TE> {
|
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
153
|
|
|
153
|
-
export const builder = new InteractionBuilder<never, never,
|
|
154
|
+
export const builder = new InteractionBuilder<never, never, DiscordRESTError>(
|
|
154
155
|
Chunk.empty(),
|
|
155
156
|
identity as any,
|
|
156
157
|
)
|
|
@@ -83,7 +83,7 @@ export const run =
|
|
|
83
83
|
})
|
|
84
84
|
|
|
85
85
|
const makeRegistry = Do($ => {
|
|
86
|
-
const ref = $(Ref.make(builder))
|
|
86
|
+
const ref = $(Ref.make(builder as InteractionBuilder<never, never, never>))
|
|
87
87
|
const queue = $(Queue.sliding<InteractionBuilder<never, never, never>>(1))
|
|
88
88
|
|
|
89
89
|
const register = <E>(ix: InteractionBuilder<never, E, never>) =>
|
package/src/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dfx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"./*": "./*.js"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@tim-smart/discord-api-docs-parser": "^0.5.
|
|
27
|
+
"@tim-smart/discord-api-docs-parser": "^0.5.3",
|
|
28
28
|
"@tsplus-types/effect__data": "0.12.2-3b576ba",
|
|
29
29
|
"@tsplus-types/effect__io": "0.25.9-11739c0",
|
|
30
30
|
"@tsplus-types/effect__stream": "0.21.1-3b576ba",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"typescript": "https://cdn.jsdelivr.net/npm/@tsplus/installer@0.0.171/compiler/typescript.tgz"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@effect-http/client": "^0.26.
|
|
39
|
-
"@effect/data": "^0.12.
|
|
40
|
-
"@effect/io": "~0.25.
|
|
38
|
+
"@effect-http/client": "^0.26.1",
|
|
39
|
+
"@effect/data": "^0.12.3",
|
|
40
|
+
"@effect/io": "~0.25.13",
|
|
41
41
|
"@effect/stream": "~0.21.1",
|
|
42
42
|
"tweetnacl": "^1.0.3"
|
|
43
43
|
},
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"ws": "^8.13.0"
|
|
49
49
|
},
|
|
50
50
|
"sideEffects": false,
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "32080f0932a56532233d0e2ebf38852afd0b5a00"
|
|
52
52
|
}
|
package/src/types.ts
CHANGED
|
@@ -1212,10 +1212,11 @@ export function createRoutes<O = any>(
|
|
|
1212
1212
|
params,
|
|
1213
1213
|
options,
|
|
1214
1214
|
}),
|
|
1215
|
-
createFollowupMessage: (applicationId, interactionToken, options) =>
|
|
1215
|
+
createFollowupMessage: (applicationId, interactionToken, params, options) =>
|
|
1216
1216
|
fetch({
|
|
1217
1217
|
method: "POST",
|
|
1218
1218
|
url: `/webhooks/${applicationId}/${interactionToken}`,
|
|
1219
|
+
params,
|
|
1219
1220
|
options,
|
|
1220
1221
|
}),
|
|
1221
1222
|
createGlobalApplicationCommand: (applicationId, params, options) =>
|
|
@@ -1536,11 +1537,13 @@ export function createRoutes<O = any>(
|
|
|
1536
1537
|
applicationId,
|
|
1537
1538
|
interactionToken,
|
|
1538
1539
|
messageId,
|
|
1540
|
+
params,
|
|
1539
1541
|
options,
|
|
1540
1542
|
) =>
|
|
1541
1543
|
fetch({
|
|
1542
1544
|
method: "PATCH",
|
|
1543
1545
|
url: `/webhooks/${applicationId}/${interactionToken}/messages/${messageId}`,
|
|
1546
|
+
params,
|
|
1544
1547
|
options,
|
|
1545
1548
|
}),
|
|
1546
1549
|
editGlobalApplicationCommand: (applicationId, commandId, params, options) =>
|
|
@@ -1573,11 +1576,13 @@ export function createRoutes<O = any>(
|
|
|
1573
1576
|
editOriginalInteractionResponse: (
|
|
1574
1577
|
applicationId,
|
|
1575
1578
|
interactionToken,
|
|
1579
|
+
params,
|
|
1576
1580
|
options,
|
|
1577
1581
|
) =>
|
|
1578
1582
|
fetch({
|
|
1579
1583
|
method: "PATCH",
|
|
1580
1584
|
url: `/webhooks/${applicationId}/${interactionToken}/messages/@original`,
|
|
1585
|
+
params,
|
|
1581
1586
|
options,
|
|
1582
1587
|
}),
|
|
1583
1588
|
editWebhookMessage: (webhookId, webhookToken, messageId, params, options) =>
|
|
@@ -1698,10 +1703,17 @@ export function createRoutes<O = any>(
|
|
|
1698
1703
|
params,
|
|
1699
1704
|
options,
|
|
1700
1705
|
}),
|
|
1701
|
-
getFollowupMessage: (
|
|
1706
|
+
getFollowupMessage: (
|
|
1707
|
+
applicationId,
|
|
1708
|
+
interactionToken,
|
|
1709
|
+
messageId,
|
|
1710
|
+
params,
|
|
1711
|
+
options,
|
|
1712
|
+
) =>
|
|
1702
1713
|
fetch({
|
|
1703
1714
|
method: "GET",
|
|
1704
1715
|
url: `/webhooks/${applicationId}/${interactionToken}/messages/${messageId}`,
|
|
1716
|
+
params,
|
|
1705
1717
|
options,
|
|
1706
1718
|
}),
|
|
1707
1719
|
getGateway: options =>
|
|
@@ -1920,11 +1932,13 @@ export function createRoutes<O = any>(
|
|
|
1920
1932
|
getOriginalInteractionResponse: (
|
|
1921
1933
|
applicationId,
|
|
1922
1934
|
interactionToken,
|
|
1935
|
+
params,
|
|
1923
1936
|
options,
|
|
1924
1937
|
) =>
|
|
1925
1938
|
fetch({
|
|
1926
1939
|
method: "GET",
|
|
1927
1940
|
url: `/webhooks/${applicationId}/${interactionToken}/messages/@original`,
|
|
1941
|
+
params,
|
|
1928
1942
|
options,
|
|
1929
1943
|
}),
|
|
1930
1944
|
getPinnedMessages: (channelId, options) =>
|
|
@@ -2667,6 +2681,7 @@ export interface Endpoints<O> {
|
|
|
2667
2681
|
createFollowupMessage: (
|
|
2668
2682
|
applicationId: string,
|
|
2669
2683
|
interactionToken: string,
|
|
2684
|
+
params?: Partial<ExecuteWebhookParams>,
|
|
2670
2685
|
options?: O,
|
|
2671
2686
|
) => RestResponse<any>
|
|
2672
2687
|
createGlobalApplicationCommand: (
|
|
@@ -2930,6 +2945,7 @@ The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji
|
|
|
2930
2945
|
applicationId: string,
|
|
2931
2946
|
interactionToken: string,
|
|
2932
2947
|
messageId: string,
|
|
2948
|
+
params?: Partial<EditWebhookMessageParams>,
|
|
2933
2949
|
options?: O,
|
|
2934
2950
|
) => RestResponse<any>
|
|
2935
2951
|
editGlobalApplicationCommand: (
|
|
@@ -2956,6 +2972,7 @@ The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji
|
|
|
2956
2972
|
editOriginalInteractionResponse: (
|
|
2957
2973
|
applicationId: string,
|
|
2958
2974
|
interactionToken: string,
|
|
2975
|
+
params?: Partial<EditWebhookMessageParams>,
|
|
2959
2976
|
options?: O,
|
|
2960
2977
|
) => RestResponse<any>
|
|
2961
2978
|
/** Edits a previously-sent webhook message from the same token. Returns a message object on success. */
|
|
@@ -3055,6 +3072,7 @@ The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji
|
|
|
3055
3072
|
applicationId: string,
|
|
3056
3073
|
interactionToken: string,
|
|
3057
3074
|
messageId: string,
|
|
3075
|
+
params?: Partial<GetWebhookMessageParams>,
|
|
3058
3076
|
options?: O,
|
|
3059
3077
|
) => RestResponse<any>
|
|
3060
3078
|
getGateway: (options?: O) => RestResponse<any>
|
|
@@ -3216,6 +3234,7 @@ The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji
|
|
|
3216
3234
|
getOriginalInteractionResponse: (
|
|
3217
3235
|
applicationId: string,
|
|
3218
3236
|
interactionToken: string,
|
|
3237
|
+
params?: Partial<GetWebhookMessageParams>,
|
|
3219
3238
|
options?: O,
|
|
3220
3239
|
) => RestResponse<any>
|
|
3221
3240
|
/** Returns all pinned messages in the channel as an array of message objects. */
|
|
@@ -3912,6 +3931,8 @@ export interface Guild {
|
|
|
3912
3931
|
readonly stickers?: Sticker[]
|
|
3913
3932
|
/** whether the guild has the boost progress bar enabled */
|
|
3914
3933
|
readonly premium_progress_bar_enabled: boolean
|
|
3934
|
+
/** the id of the channel where admins and moderators of Community guilds receive safety alerts from Discord */
|
|
3935
|
+
readonly safety_alerts_channel_id?: Snowflake | null
|
|
3915
3936
|
}
|
|
3916
3937
|
export interface GuildApplicationCommandPermission {
|
|
3917
3938
|
/** ID of the command or the application ID */
|
|
@@ -4005,6 +4026,8 @@ export const enum GuildFeature {
|
|
|
4005
4026
|
PARTNERED = "PARTNERED",
|
|
4006
4027
|
/** guild can be previewed before joining via Membership Screening or the directory */
|
|
4007
4028
|
PREVIEW_ENABLED = "PREVIEW_ENABLED",
|
|
4029
|
+
/** guild has disabled alerts for join raids in the configured safety alerts channel */
|
|
4030
|
+
RAID_ALERTS_DISABLED = "RAID_ALERTS_DISABLED",
|
|
4008
4031
|
/** guild is able to set role icons */
|
|
4009
4032
|
ROLE_ICONS = "ROLE_ICONS",
|
|
4010
4033
|
/** guild has role subscriptions that can be purchased */
|
|
@@ -5166,6 +5189,8 @@ export interface ModifyGuildParams {
|
|
|
5166
5189
|
readonly description?: string | null
|
|
5167
5190
|
/** whether the guild's boost progress bar should be enabled */
|
|
5168
5191
|
readonly premium_progress_bar_enabled: boolean
|
|
5192
|
+
/** the id of the channel where admins and moderators of Community guilds receive safety alerts from Discord */
|
|
5193
|
+
readonly safety_alerts_channel_id?: Snowflake | null
|
|
5169
5194
|
}
|
|
5170
5195
|
export interface ModifyGuildRoleParams {
|
|
5171
5196
|
/** name of the role, max 100 characters */
|
|
@@ -5255,8 +5280,9 @@ export interface ModifyWebhookParams {
|
|
|
5255
5280
|
}
|
|
5256
5281
|
export const enum MutableGuildFeature {
|
|
5257
5282
|
COMMUNITY = "COMMUNITY",
|
|
5258
|
-
INVITES_DISABLED = "INVITES_DISABLED",
|
|
5259
5283
|
DISCOVERABLE = "DISCOVERABLE",
|
|
5284
|
+
INVITES_DISABLED = "INVITES_DISABLED",
|
|
5285
|
+
RAID_ALERTS_DISABLED = "RAID_ALERTS_DISABLED",
|
|
5260
5286
|
}
|
|
5261
5287
|
export const enum OAuth2Scope {
|
|
5262
5288
|
/** allows your app to fetch data from a user's "Now Playing/Recently Played" list — not currently available for apps */
|
|
@@ -5429,6 +5455,8 @@ export const PermissionFlag = {
|
|
|
5429
5455
|
VIEW_CREATOR_MONETIZATION_ANALYTICS: BigInt(1) << BigInt(41),
|
|
5430
5456
|
/** Allows for using soundboard in a voice channel */
|
|
5431
5457
|
USE_SOUNDBOARD: BigInt(1) << BigInt(42),
|
|
5458
|
+
/** Allows the usage of custom soundboard sounds from other servers */
|
|
5459
|
+
USE_EXTERNAL_SOUNDS: BigInt(1) << BigInt(45),
|
|
5432
5460
|
/** Allows sending voice messages */
|
|
5433
5461
|
SEND_VOICE_MESSAGES: BigInt(1) << BigInt(46),
|
|
5434
5462
|
} as const
|
|
@@ -6091,6 +6119,8 @@ export interface TriggerMetadatum {
|
|
|
6091
6119
|
readonly allow_list: string[]
|
|
6092
6120
|
/** MENTION_SPAM */
|
|
6093
6121
|
readonly mention_total_limit: number
|
|
6122
|
+
/** MENTION_SPAM */
|
|
6123
|
+
readonly mention_raid_protection_enabled: boolean
|
|
6094
6124
|
}
|
|
6095
6125
|
export const enum TriggerType {
|
|
6096
6126
|
/** check if content contains words from a user defined list of keywords */
|
package/types.d.ts
CHANGED
|
@@ -1391,7 +1391,7 @@ export interface Endpoints<O> {
|
|
|
1391
1391
|
/** Create a new DM channel with a user. Returns a DM channel object (if one already exists, it will be returned instead). */
|
|
1392
1392
|
createDm: (params?: Partial<CreateDmParams>, options?: O) => RestResponse<Channel>;
|
|
1393
1393
|
/** Create a followup message for an Interaction. Functions the same as Execute Webhook, but wait is always true. The thread_id, avatar_url, and username parameters are not supported when using this endpoint for interaction followups. */
|
|
1394
|
-
createFollowupMessage: (applicationId: string, interactionToken: string, options?: O) => RestResponse<any>;
|
|
1394
|
+
createFollowupMessage: (applicationId: string, interactionToken: string, params?: Partial<ExecuteWebhookParams>, options?: O) => RestResponse<any>;
|
|
1395
1395
|
createGlobalApplicationCommand: (applicationId: string, params?: Partial<CreateGlobalApplicationCommandParams>, options?: O) => RestResponse<ApplicationCommand>;
|
|
1396
1396
|
/** Create a new group DM channel with multiple users. Returns a DM channel object. This endpoint was intended to be used with the now-deprecated GameBridge SDK. Fires a Channel Create Gateway event. */
|
|
1397
1397
|
createGroupDm: (params?: Partial<CreateGroupDmParams>, options?: O) => RestResponse<Channel>;
|
|
@@ -1481,13 +1481,13 @@ export interface Endpoints<O> {
|
|
|
1481
1481
|
/** Edit the channel permission overwrites for a user or role in a channel. Only usable for guild channels. Requires the MANAGE_ROLES permission. Only permissions your bot has in the guild or parent channel (if applicable) can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite in the channel). Returns a 204 empty response on success. Fires a Channel Update Gateway event. For more information about permissions, see permissions. */
|
|
1482
1482
|
editChannelPermissions: (channelId: string, overwriteId: string, params?: Partial<EditChannelPermissionParams>, options?: O) => RestResponse<any>;
|
|
1483
1483
|
/** Edits a followup message for an Interaction. Functions the same as Edit Webhook Message. */
|
|
1484
|
-
editFollowupMessage: (applicationId: string, interactionToken: string, messageId: string, options?: O) => RestResponse<any>;
|
|
1484
|
+
editFollowupMessage: (applicationId: string, interactionToken: string, messageId: string, params?: Partial<EditWebhookMessageParams>, options?: O) => RestResponse<any>;
|
|
1485
1485
|
editGlobalApplicationCommand: (applicationId: string, commandId: string, params?: Partial<EditGlobalApplicationCommandParams>, options?: O) => RestResponse<ApplicationCommand>;
|
|
1486
1486
|
editGuildApplicationCommand: (applicationId: string, guildId: string, commandId: string, params?: Partial<EditGuildApplicationCommandParams>, options?: O) => RestResponse<ApplicationCommand>;
|
|
1487
1487
|
/** Edit a previously sent message. The fields content, embeds, and flags can be edited by the original message author. Other users can only edit flags and only if they have the MANAGE_MESSAGES permission in the corresponding channel. When specifying flags, ensure to include all previously set flags/bits in addition to ones that you are modifying. Only flags documented in the table below may be modified by users (unsupported flag changes are currently ignored without error). */
|
|
1488
1488
|
editMessage: (channelId: string, messageId: string, params?: Partial<EditMessageParams>, options?: O) => RestResponse<Message>;
|
|
1489
1489
|
/** Edits the initial Interaction response. Functions the same as Edit Webhook Message. */
|
|
1490
|
-
editOriginalInteractionResponse: (applicationId: string, interactionToken: string, options?: O) => RestResponse<any>;
|
|
1490
|
+
editOriginalInteractionResponse: (applicationId: string, interactionToken: string, params?: Partial<EditWebhookMessageParams>, options?: O) => RestResponse<any>;
|
|
1491
1491
|
/** Edits a previously-sent webhook message from the same token. Returns a message object on success. */
|
|
1492
1492
|
editWebhookMessage: (webhookId: string, webhookToken: string, messageId: string, params?: Partial<EditWebhookMessageParams>, options?: O) => RestResponse<Message>;
|
|
1493
1493
|
/** 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. */
|
|
@@ -1525,7 +1525,7 @@ export interface Endpoints<O> {
|
|
|
1525
1525
|
/** Returns a list of partial guild objects the current user is a member of. Requires the guilds OAuth2 scope. */
|
|
1526
1526
|
getCurrentUserGuilds: (params?: Partial<GetCurrentUserGuildParams>, options?: O) => RestResponse<Guild[]>;
|
|
1527
1527
|
/** Returns a followup message for an Interaction. Functions the same as Get Webhook Message. */
|
|
1528
|
-
getFollowupMessage: (applicationId: string, interactionToken: string, messageId: string, options?: O) => RestResponse<any>;
|
|
1528
|
+
getFollowupMessage: (applicationId: string, interactionToken: string, messageId: string, params?: Partial<GetWebhookMessageParams>, options?: O) => RestResponse<any>;
|
|
1529
1529
|
getGateway: (options?: O) => RestResponse<any>;
|
|
1530
1530
|
getGatewayBot: (options?: O) => RestResponse<GetGatewayBotResponse>;
|
|
1531
1531
|
/** Fetch a global command for your application. Returns an application command object. */
|
|
@@ -1589,7 +1589,7 @@ export interface Endpoints<O> {
|
|
|
1589
1589
|
/** Returns an invite object for the given code. */
|
|
1590
1590
|
getInvite: (inviteCode: string, params?: Partial<GetInviteParams>, options?: O) => RestResponse<Invite>;
|
|
1591
1591
|
/** Returns the initial Interaction response. Functions the same as Get Webhook Message. */
|
|
1592
|
-
getOriginalInteractionResponse: (applicationId: string, interactionToken: string, options?: O) => RestResponse<any>;
|
|
1592
|
+
getOriginalInteractionResponse: (applicationId: string, interactionToken: string, params?: Partial<GetWebhookMessageParams>, options?: O) => RestResponse<any>;
|
|
1593
1593
|
/** Returns all pinned messages in the channel as an array of message objects. */
|
|
1594
1594
|
getPinnedMessages: (channelId: string, options?: O) => RestResponse<Message[]>;
|
|
1595
1595
|
/** Get a list of users that reacted with this emoji. Returns an array of user objects on success.
|
|
@@ -2074,6 +2074,8 @@ export interface Guild {
|
|
|
2074
2074
|
readonly stickers?: Sticker[];
|
|
2075
2075
|
/** whether the guild has the boost progress bar enabled */
|
|
2076
2076
|
readonly premium_progress_bar_enabled: boolean;
|
|
2077
|
+
/** the id of the channel where admins and moderators of Community guilds receive safety alerts from Discord */
|
|
2078
|
+
readonly safety_alerts_channel_id?: Snowflake | null;
|
|
2077
2079
|
}
|
|
2078
2080
|
export interface GuildApplicationCommandPermission {
|
|
2079
2081
|
/** ID of the command or the application ID */
|
|
@@ -2167,6 +2169,8 @@ export declare const enum GuildFeature {
|
|
|
2167
2169
|
PARTNERED = "PARTNERED",
|
|
2168
2170
|
/** guild can be previewed before joining via Membership Screening or the directory */
|
|
2169
2171
|
PREVIEW_ENABLED = "PREVIEW_ENABLED",
|
|
2172
|
+
/** guild has disabled alerts for join raids in the configured safety alerts channel */
|
|
2173
|
+
RAID_ALERTS_DISABLED = "RAID_ALERTS_DISABLED",
|
|
2170
2174
|
/** guild is able to set role icons */
|
|
2171
2175
|
ROLE_ICONS = "ROLE_ICONS",
|
|
2172
2176
|
/** guild has role subscriptions that can be purchased */
|
|
@@ -3317,6 +3321,8 @@ export interface ModifyGuildParams {
|
|
|
3317
3321
|
readonly description?: string | null;
|
|
3318
3322
|
/** whether the guild's boost progress bar should be enabled */
|
|
3319
3323
|
readonly premium_progress_bar_enabled: boolean;
|
|
3324
|
+
/** the id of the channel where admins and moderators of Community guilds receive safety alerts from Discord */
|
|
3325
|
+
readonly safety_alerts_channel_id?: Snowflake | null;
|
|
3320
3326
|
}
|
|
3321
3327
|
export interface ModifyGuildRoleParams {
|
|
3322
3328
|
/** name of the role, max 100 characters */
|
|
@@ -3406,8 +3412,9 @@ export interface ModifyWebhookParams {
|
|
|
3406
3412
|
}
|
|
3407
3413
|
export declare const enum MutableGuildFeature {
|
|
3408
3414
|
COMMUNITY = "COMMUNITY",
|
|
3415
|
+
DISCOVERABLE = "DISCOVERABLE",
|
|
3409
3416
|
INVITES_DISABLED = "INVITES_DISABLED",
|
|
3410
|
-
|
|
3417
|
+
RAID_ALERTS_DISABLED = "RAID_ALERTS_DISABLED"
|
|
3411
3418
|
}
|
|
3412
3419
|
export declare const enum OAuth2Scope {
|
|
3413
3420
|
/** allows your app to fetch data from a user's "Now Playing/Recently Played" list — not currently available for apps */
|
|
@@ -3580,6 +3587,8 @@ export declare const PermissionFlag: {
|
|
|
3580
3587
|
readonly VIEW_CREATOR_MONETIZATION_ANALYTICS: bigint;
|
|
3581
3588
|
/** Allows for using soundboard in a voice channel */
|
|
3582
3589
|
readonly USE_SOUNDBOARD: bigint;
|
|
3590
|
+
/** Allows the usage of custom soundboard sounds from other servers */
|
|
3591
|
+
readonly USE_EXTERNAL_SOUNDS: bigint;
|
|
3583
3592
|
/** Allows sending voice messages */
|
|
3584
3593
|
readonly SEND_VOICE_MESSAGES: bigint;
|
|
3585
3594
|
};
|
|
@@ -4172,6 +4181,8 @@ export interface TriggerMetadatum {
|
|
|
4172
4181
|
readonly allow_list: string[];
|
|
4173
4182
|
/** MENTION_SPAM */
|
|
4174
4183
|
readonly mention_total_limit: number;
|
|
4184
|
+
/** MENTION_SPAM */
|
|
4185
|
+
readonly mention_raid_protection_enabled: boolean;
|
|
4175
4186
|
}
|
|
4176
4187
|
export declare const enum TriggerType {
|
|
4177
4188
|
/** check if content contains words from a user defined list of keywords */
|