@discordjs/core 3.0.0-dev.1734048793-0848fc6b4 → 3.0.0-dev.1734135156-35ebcc7d5
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/dist/http-only.d.mts +1 -40
- package/dist/http-only.d.ts +1 -40
- package/dist/http-only.js +220 -275
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +216 -271
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +1 -40
- package/dist/index.d.ts +1 -40
- package/dist/index.js +220 -275
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +216 -271
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -801,85 +801,9 @@ var ChannelsAPI = class {
|
|
|
801
801
|
|
|
802
802
|
// src/api/guild.ts
|
|
803
803
|
import { makeURLSearchParams as makeURLSearchParams3 } from "@discordjs/rest";
|
|
804
|
-
import {
|
|
805
|
-
Routes as Routes5
|
|
806
|
-
} from "discord-api-types/v10";
|
|
807
|
-
|
|
808
|
-
// src/api/voice.ts
|
|
809
804
|
import {
|
|
810
805
|
Routes as Routes4
|
|
811
806
|
} from "discord-api-types/v10";
|
|
812
|
-
var VoiceAPI = class {
|
|
813
|
-
constructor(rest) {
|
|
814
|
-
this.rest = rest;
|
|
815
|
-
}
|
|
816
|
-
static {
|
|
817
|
-
__name(this, "VoiceAPI");
|
|
818
|
-
}
|
|
819
|
-
/**
|
|
820
|
-
* Fetches all voice regions
|
|
821
|
-
*
|
|
822
|
-
* @see {@link https://discord.com/developers/docs/resources/voice#list-voice-regions}
|
|
823
|
-
* @param options - The options for fetching the voice regions
|
|
824
|
-
*/
|
|
825
|
-
async getVoiceRegions({ signal } = {}) {
|
|
826
|
-
return this.rest.get(Routes4.voiceRegions(), { signal });
|
|
827
|
-
}
|
|
828
|
-
/**
|
|
829
|
-
* Fetches voice state of a user by their id
|
|
830
|
-
*
|
|
831
|
-
* @see {@link https://discord.com/developers/docs/resources/voice#get-user-voice-state}
|
|
832
|
-
* @param options - The options for fetching user voice state
|
|
833
|
-
*/
|
|
834
|
-
async getUserVoiceState(guildId, userId, { signal } = {}) {
|
|
835
|
-
return this.rest.get(Routes4.guildVoiceState(guildId, userId), {
|
|
836
|
-
signal
|
|
837
|
-
});
|
|
838
|
-
}
|
|
839
|
-
/**
|
|
840
|
-
* Fetches the current user's voice state
|
|
841
|
-
*
|
|
842
|
-
* @see {@link https://discord.com/developers/docs/resources/voice#get-current-user-voice-state}
|
|
843
|
-
* @param options - The options for fetching user voice state
|
|
844
|
-
*/
|
|
845
|
-
async getVoiceState(guildId, { signal } = {}) {
|
|
846
|
-
return this.rest.get(Routes4.guildVoiceState(guildId, "@me"), {
|
|
847
|
-
signal
|
|
848
|
-
});
|
|
849
|
-
}
|
|
850
|
-
/**
|
|
851
|
-
* Edits a user's voice state in a guild
|
|
852
|
-
*
|
|
853
|
-
* @see {@link https://discord.com/developers/docs/resources/voice#modify-user-voice-state}
|
|
854
|
-
* @param guildId - The id of the guild to edit the current user's voice state in
|
|
855
|
-
* @param userId - The id of the user to edit the voice state for
|
|
856
|
-
* @param body - The data for editing the voice state
|
|
857
|
-
* @param options - The options for editing the voice state
|
|
858
|
-
*/
|
|
859
|
-
async editUserVoiceState(guildId, userId, body, { reason, signal } = {}) {
|
|
860
|
-
return this.rest.patch(Routes4.guildVoiceState(guildId, userId), {
|
|
861
|
-
reason,
|
|
862
|
-
body,
|
|
863
|
-
signal
|
|
864
|
-
});
|
|
865
|
-
}
|
|
866
|
-
/**
|
|
867
|
-
* Edits the voice state for the current user
|
|
868
|
-
*
|
|
869
|
-
* @see {@link https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state}
|
|
870
|
-
* @param guildId - The id of the guild
|
|
871
|
-
* @param body - The data for editing the voice state
|
|
872
|
-
* @param options - The options for editing the voice state
|
|
873
|
-
*/
|
|
874
|
-
async editVoiceState(guildId, body = {}, { signal } = {}) {
|
|
875
|
-
return this.rest.patch(Routes4.guildVoiceState(guildId, "@me"), {
|
|
876
|
-
body,
|
|
877
|
-
signal
|
|
878
|
-
});
|
|
879
|
-
}
|
|
880
|
-
};
|
|
881
|
-
|
|
882
|
-
// src/api/guild.ts
|
|
883
807
|
var GuildsAPI = class {
|
|
884
808
|
constructor(rest) {
|
|
885
809
|
this.rest = rest;
|
|
@@ -896,7 +820,7 @@ var GuildsAPI = class {
|
|
|
896
820
|
* @param options - The options for fetching the guild
|
|
897
821
|
*/
|
|
898
822
|
async get(guildId, query = {}, { signal } = {}) {
|
|
899
|
-
return this.rest.get(
|
|
823
|
+
return this.rest.get(Routes4.guild(guildId), {
|
|
900
824
|
query: makeURLSearchParams3(query),
|
|
901
825
|
signal
|
|
902
826
|
});
|
|
@@ -909,7 +833,7 @@ var GuildsAPI = class {
|
|
|
909
833
|
* @param options - The options for fetching the guild preview
|
|
910
834
|
*/
|
|
911
835
|
async getPreview(guildId, { signal } = {}) {
|
|
912
|
-
return this.rest.get(
|
|
836
|
+
return this.rest.get(Routes4.guildPreview(guildId), {
|
|
913
837
|
signal
|
|
914
838
|
});
|
|
915
839
|
}
|
|
@@ -921,7 +845,7 @@ var GuildsAPI = class {
|
|
|
921
845
|
* @param options - The options for creating the guild
|
|
922
846
|
*/
|
|
923
847
|
async create(body, { signal } = {}) {
|
|
924
|
-
return this.rest.post(
|
|
848
|
+
return this.rest.post(Routes4.guilds(), { body, signal });
|
|
925
849
|
}
|
|
926
850
|
/**
|
|
927
851
|
* Edits a guild
|
|
@@ -932,7 +856,7 @@ var GuildsAPI = class {
|
|
|
932
856
|
* @param options - The options for editing the guild
|
|
933
857
|
*/
|
|
934
858
|
async edit(guildId, body, { reason, signal } = {}) {
|
|
935
|
-
return this.rest.patch(
|
|
859
|
+
return this.rest.patch(Routes4.guild(guildId), {
|
|
936
860
|
reason,
|
|
937
861
|
body,
|
|
938
862
|
signal
|
|
@@ -946,7 +870,7 @@ var GuildsAPI = class {
|
|
|
946
870
|
* @param options - The options for deleting this guild
|
|
947
871
|
*/
|
|
948
872
|
async delete(guildId, { signal, reason } = {}) {
|
|
949
|
-
await this.rest.delete(
|
|
873
|
+
await this.rest.delete(Routes4.guild(guildId), { reason, signal });
|
|
950
874
|
}
|
|
951
875
|
/**
|
|
952
876
|
* Adds user to the guild
|
|
@@ -958,7 +882,7 @@ var GuildsAPI = class {
|
|
|
958
882
|
* @param options - The options for adding users to the guild
|
|
959
883
|
*/
|
|
960
884
|
async addMember(guildId, userId, body, { signal } = {}) {
|
|
961
|
-
return this.rest.put(
|
|
885
|
+
return this.rest.put(Routes4.guildMember(guildId, userId), {
|
|
962
886
|
body,
|
|
963
887
|
signal
|
|
964
888
|
});
|
|
@@ -972,7 +896,7 @@ var GuildsAPI = class {
|
|
|
972
896
|
* @param options - The options for fetching the guild members
|
|
973
897
|
*/
|
|
974
898
|
async getMembers(guildId, query = {}, { signal } = {}) {
|
|
975
|
-
return this.rest.get(
|
|
899
|
+
return this.rest.get(Routes4.guildMembers(guildId), {
|
|
976
900
|
query: makeURLSearchParams3(query),
|
|
977
901
|
signal
|
|
978
902
|
});
|
|
@@ -985,7 +909,7 @@ var GuildsAPI = class {
|
|
|
985
909
|
* @param options - The options for fetching the guild channels
|
|
986
910
|
*/
|
|
987
911
|
async getChannels(guildId, { signal } = {}) {
|
|
988
|
-
return this.rest.get(
|
|
912
|
+
return this.rest.get(Routes4.guildChannels(guildId), {
|
|
989
913
|
signal
|
|
990
914
|
});
|
|
991
915
|
}
|
|
@@ -998,7 +922,7 @@ var GuildsAPI = class {
|
|
|
998
922
|
* @param options - The options for creating the guild channel
|
|
999
923
|
*/
|
|
1000
924
|
async createChannel(guildId, body, { reason, signal } = {}) {
|
|
1001
|
-
return this.rest.post(
|
|
925
|
+
return this.rest.post(Routes4.guildChannels(guildId), {
|
|
1002
926
|
reason,
|
|
1003
927
|
body,
|
|
1004
928
|
signal
|
|
@@ -1013,7 +937,7 @@ var GuildsAPI = class {
|
|
|
1013
937
|
* @param options - The options for editing the guild channel positions
|
|
1014
938
|
*/
|
|
1015
939
|
async setChannelPositions(guildId, body, { reason, signal } = {}) {
|
|
1016
|
-
await this.rest.patch(
|
|
940
|
+
await this.rest.patch(Routes4.guildChannels(guildId), { reason, body, signal });
|
|
1017
941
|
}
|
|
1018
942
|
/**
|
|
1019
943
|
* Fetches the active threads in a guild
|
|
@@ -1023,7 +947,7 @@ var GuildsAPI = class {
|
|
|
1023
947
|
* @param options - The options for fetching the active threads
|
|
1024
948
|
*/
|
|
1025
949
|
async getActiveThreads(guildId, { signal } = {}) {
|
|
1026
|
-
return this.rest.get(
|
|
950
|
+
return this.rest.get(Routes4.guildActiveThreads(guildId), { signal });
|
|
1027
951
|
}
|
|
1028
952
|
/**
|
|
1029
953
|
* Fetches a guild member ban
|
|
@@ -1034,7 +958,7 @@ var GuildsAPI = class {
|
|
|
1034
958
|
* @param options - The options for fetching the ban
|
|
1035
959
|
*/
|
|
1036
960
|
async getMemberBan(guildId, userId, { signal } = {}) {
|
|
1037
|
-
return this.rest.get(
|
|
961
|
+
return this.rest.get(Routes4.guildBan(guildId, userId), { signal });
|
|
1038
962
|
}
|
|
1039
963
|
/**
|
|
1040
964
|
* Fetches guild member bans
|
|
@@ -1045,7 +969,7 @@ var GuildsAPI = class {
|
|
|
1045
969
|
* @param options - The options for fetching the bans
|
|
1046
970
|
*/
|
|
1047
971
|
async getMemberBans(guildId, query = {}, { signal } = {}) {
|
|
1048
|
-
return this.rest.get(
|
|
972
|
+
return this.rest.get(Routes4.guildBans(guildId), {
|
|
1049
973
|
query: makeURLSearchParams3(query),
|
|
1050
974
|
signal
|
|
1051
975
|
});
|
|
@@ -1060,7 +984,7 @@ var GuildsAPI = class {
|
|
|
1060
984
|
* @param options - The options for banning the user
|
|
1061
985
|
*/
|
|
1062
986
|
async banUser(guildId, userId, body = {}, { reason, signal } = {}) {
|
|
1063
|
-
await this.rest.put(
|
|
987
|
+
await this.rest.put(Routes4.guildBan(guildId, userId), { reason, body, signal });
|
|
1064
988
|
}
|
|
1065
989
|
/**
|
|
1066
990
|
* Unbans a user from a guild
|
|
@@ -1071,7 +995,7 @@ var GuildsAPI = class {
|
|
|
1071
995
|
* @param options - The options for unbanning the user
|
|
1072
996
|
*/
|
|
1073
997
|
async unbanUser(guildId, userId, { reason, signal } = {}) {
|
|
1074
|
-
await this.rest.delete(
|
|
998
|
+
await this.rest.delete(Routes4.guildBan(guildId, userId), { reason, signal });
|
|
1075
999
|
}
|
|
1076
1000
|
/**
|
|
1077
1001
|
* Bulk ban users from a guild
|
|
@@ -1082,7 +1006,7 @@ var GuildsAPI = class {
|
|
|
1082
1006
|
* @param options - The options for bulk banning users
|
|
1083
1007
|
*/
|
|
1084
1008
|
async bulkBanUsers(guildId, body, { reason, signal } = {}) {
|
|
1085
|
-
return this.rest.post(
|
|
1009
|
+
return this.rest.post(Routes4.guildBulkBan(guildId), {
|
|
1086
1010
|
reason,
|
|
1087
1011
|
body,
|
|
1088
1012
|
signal
|
|
@@ -1096,7 +1020,7 @@ var GuildsAPI = class {
|
|
|
1096
1020
|
* @param options - The options for fetching the guild roles
|
|
1097
1021
|
*/
|
|
1098
1022
|
async getRoles(guildId, { signal } = {}) {
|
|
1099
|
-
return this.rest.get(
|
|
1023
|
+
return this.rest.get(Routes4.guildRoles(guildId), { signal });
|
|
1100
1024
|
}
|
|
1101
1025
|
/**
|
|
1102
1026
|
* Get a role in a guild
|
|
@@ -1107,7 +1031,7 @@ var GuildsAPI = class {
|
|
|
1107
1031
|
* @param options - The options for fetching the guild role
|
|
1108
1032
|
*/
|
|
1109
1033
|
async getRole(guildId, roleId, { signal } = {}) {
|
|
1110
|
-
return this.rest.get(
|
|
1034
|
+
return this.rest.get(Routes4.guildRole(guildId, roleId), { signal });
|
|
1111
1035
|
}
|
|
1112
1036
|
/**
|
|
1113
1037
|
* Creates a guild role
|
|
@@ -1118,7 +1042,7 @@ var GuildsAPI = class {
|
|
|
1118
1042
|
* @param options - The options for creating the guild role
|
|
1119
1043
|
*/
|
|
1120
1044
|
async createRole(guildId, body, { reason, signal } = {}) {
|
|
1121
|
-
return this.rest.post(
|
|
1045
|
+
return this.rest.post(Routes4.guildRoles(guildId), { reason, body, signal });
|
|
1122
1046
|
}
|
|
1123
1047
|
/**
|
|
1124
1048
|
* Sets role positions in a guild
|
|
@@ -1129,7 +1053,7 @@ var GuildsAPI = class {
|
|
|
1129
1053
|
* @param options - The options for setting role positions
|
|
1130
1054
|
*/
|
|
1131
1055
|
async setRolePositions(guildId, body, { reason, signal } = {}) {
|
|
1132
|
-
return this.rest.patch(
|
|
1056
|
+
return this.rest.patch(Routes4.guildRoles(guildId), {
|
|
1133
1057
|
reason,
|
|
1134
1058
|
body,
|
|
1135
1059
|
signal
|
|
@@ -1145,7 +1069,7 @@ var GuildsAPI = class {
|
|
|
1145
1069
|
* @param options - The options for editing the guild role
|
|
1146
1070
|
*/
|
|
1147
1071
|
async editRole(guildId, roleId, body, { reason, signal } = {}) {
|
|
1148
|
-
return this.rest.patch(
|
|
1072
|
+
return this.rest.patch(Routes4.guildRole(guildId, roleId), {
|
|
1149
1073
|
reason,
|
|
1150
1074
|
body,
|
|
1151
1075
|
signal
|
|
@@ -1160,7 +1084,7 @@ var GuildsAPI = class {
|
|
|
1160
1084
|
* @param options - The options for deleting the guild role
|
|
1161
1085
|
*/
|
|
1162
1086
|
async deleteRole(guildId, roleId, { reason, signal } = {}) {
|
|
1163
|
-
await this.rest.delete(
|
|
1087
|
+
await this.rest.delete(Routes4.guildRole(guildId, roleId), { reason, signal });
|
|
1164
1088
|
}
|
|
1165
1089
|
/**
|
|
1166
1090
|
* Edits the multi-factor-authentication (MFA) level of a guild
|
|
@@ -1171,7 +1095,7 @@ var GuildsAPI = class {
|
|
|
1171
1095
|
* @param options - The options for editing the MFA level
|
|
1172
1096
|
*/
|
|
1173
1097
|
async editMFALevel(guildId, level, { reason, signal } = {}) {
|
|
1174
|
-
return this.rest.post(
|
|
1098
|
+
return this.rest.post(Routes4.guildMFA(guildId), {
|
|
1175
1099
|
reason,
|
|
1176
1100
|
signal,
|
|
1177
1101
|
body: { level }
|
|
@@ -1186,7 +1110,7 @@ var GuildsAPI = class {
|
|
|
1186
1110
|
* @param options - The options for fetching the number of pruned members
|
|
1187
1111
|
*/
|
|
1188
1112
|
async getPruneCount(guildId, query = {}, { signal } = {}) {
|
|
1189
|
-
return this.rest.get(
|
|
1113
|
+
return this.rest.get(Routes4.guildPrune(guildId), {
|
|
1190
1114
|
signal,
|
|
1191
1115
|
query: makeURLSearchParams3(query)
|
|
1192
1116
|
});
|
|
@@ -1200,7 +1124,7 @@ var GuildsAPI = class {
|
|
|
1200
1124
|
* @param options - The options for initiating the prune
|
|
1201
1125
|
*/
|
|
1202
1126
|
async beginPrune(guildId, body = {}, { reason, signal } = {}) {
|
|
1203
|
-
return this.rest.post(
|
|
1127
|
+
return this.rest.post(Routes4.guildPrune(guildId), {
|
|
1204
1128
|
body,
|
|
1205
1129
|
reason,
|
|
1206
1130
|
signal
|
|
@@ -1214,7 +1138,7 @@ var GuildsAPI = class {
|
|
|
1214
1138
|
* @param options - The options for fetching the voice regions
|
|
1215
1139
|
*/
|
|
1216
1140
|
async getVoiceRegions(guildId, { signal } = {}) {
|
|
1217
|
-
return this.rest.get(
|
|
1141
|
+
return this.rest.get(Routes4.guildVoiceRegions(guildId), { signal });
|
|
1218
1142
|
}
|
|
1219
1143
|
/**
|
|
1220
1144
|
* Fetches the invites for a guild
|
|
@@ -1224,7 +1148,7 @@ var GuildsAPI = class {
|
|
|
1224
1148
|
* @param options - The options for fetching the invites
|
|
1225
1149
|
*/
|
|
1226
1150
|
async getInvites(guildId, { signal } = {}) {
|
|
1227
|
-
return this.rest.get(
|
|
1151
|
+
return this.rest.get(Routes4.guildInvites(guildId), { signal });
|
|
1228
1152
|
}
|
|
1229
1153
|
/**
|
|
1230
1154
|
* Fetches the integrations for a guild
|
|
@@ -1234,7 +1158,7 @@ var GuildsAPI = class {
|
|
|
1234
1158
|
* @param options - The options for fetching the integrations
|
|
1235
1159
|
*/
|
|
1236
1160
|
async getIntegrations(guildId, { signal } = {}) {
|
|
1237
|
-
return this.rest.get(
|
|
1161
|
+
return this.rest.get(Routes4.guildIntegrations(guildId), { signal });
|
|
1238
1162
|
}
|
|
1239
1163
|
/**
|
|
1240
1164
|
* Deletes an integration from a guild
|
|
@@ -1245,7 +1169,7 @@ var GuildsAPI = class {
|
|
|
1245
1169
|
* @param options - The options for deleting the integration
|
|
1246
1170
|
*/
|
|
1247
1171
|
async deleteIntegration(guildId, integrationId, { reason, signal } = {}) {
|
|
1248
|
-
await this.rest.delete(
|
|
1172
|
+
await this.rest.delete(Routes4.guildIntegration(guildId, integrationId), { reason, signal });
|
|
1249
1173
|
}
|
|
1250
1174
|
/**
|
|
1251
1175
|
* Fetches the widget settings for a guild
|
|
@@ -1255,7 +1179,7 @@ var GuildsAPI = class {
|
|
|
1255
1179
|
* @param options - The options for fetching the widget settings
|
|
1256
1180
|
*/
|
|
1257
1181
|
async getWidgetSettings(guildId, { signal } = {}) {
|
|
1258
|
-
return this.rest.get(
|
|
1182
|
+
return this.rest.get(Routes4.guildWidgetSettings(guildId), {
|
|
1259
1183
|
signal
|
|
1260
1184
|
});
|
|
1261
1185
|
}
|
|
@@ -1268,7 +1192,7 @@ var GuildsAPI = class {
|
|
|
1268
1192
|
* @param options - The options for editing the widget settings
|
|
1269
1193
|
*/
|
|
1270
1194
|
async editWidgetSettings(guildId, body, { reason, signal } = {}) {
|
|
1271
|
-
return this.rest.patch(
|
|
1195
|
+
return this.rest.patch(Routes4.guildWidgetSettings(guildId), {
|
|
1272
1196
|
reason,
|
|
1273
1197
|
body,
|
|
1274
1198
|
signal
|
|
@@ -1282,7 +1206,7 @@ var GuildsAPI = class {
|
|
|
1282
1206
|
* @param options - The options for fetching the widget
|
|
1283
1207
|
*/
|
|
1284
1208
|
async getWidget(guildId, { signal } = {}) {
|
|
1285
|
-
return this.rest.get(
|
|
1209
|
+
return this.rest.get(Routes4.guildWidgetJSON(guildId), { signal });
|
|
1286
1210
|
}
|
|
1287
1211
|
/**
|
|
1288
1212
|
* Fetches the vanity url for a guild
|
|
@@ -1292,7 +1216,7 @@ var GuildsAPI = class {
|
|
|
1292
1216
|
* @param options - The options for fetching the vanity url
|
|
1293
1217
|
*/
|
|
1294
1218
|
async getVanityURL(guildId, { signal } = {}) {
|
|
1295
|
-
return this.rest.get(
|
|
1219
|
+
return this.rest.get(Routes4.guildVanityUrl(guildId), { signal });
|
|
1296
1220
|
}
|
|
1297
1221
|
/**
|
|
1298
1222
|
* Fetches the widget image for a guild
|
|
@@ -1303,7 +1227,7 @@ var GuildsAPI = class {
|
|
|
1303
1227
|
* @param options - The options for fetching the widget image
|
|
1304
1228
|
*/
|
|
1305
1229
|
async getWidgetImage(guildId, style, { signal } = {}) {
|
|
1306
|
-
return this.rest.get(
|
|
1230
|
+
return this.rest.get(Routes4.guildWidgetImage(guildId), {
|
|
1307
1231
|
query: makeURLSearchParams3({ style }),
|
|
1308
1232
|
signal
|
|
1309
1233
|
});
|
|
@@ -1316,7 +1240,7 @@ var GuildsAPI = class {
|
|
|
1316
1240
|
* @param options - The options for fetching the welcome screen
|
|
1317
1241
|
*/
|
|
1318
1242
|
async getWelcomeScreen(guildId, { signal } = {}) {
|
|
1319
|
-
return this.rest.get(
|
|
1243
|
+
return this.rest.get(Routes4.guildWelcomeScreen(guildId), { signal });
|
|
1320
1244
|
}
|
|
1321
1245
|
/**
|
|
1322
1246
|
* Edits the welcome screen for a guild
|
|
@@ -1327,25 +1251,12 @@ var GuildsAPI = class {
|
|
|
1327
1251
|
* @param options - The options for editing the welcome screen
|
|
1328
1252
|
*/
|
|
1329
1253
|
async editWelcomeScreen(guildId, body, { reason, signal } = {}) {
|
|
1330
|
-
return this.rest.patch(
|
|
1254
|
+
return this.rest.patch(Routes4.guildWelcomeScreen(guildId), {
|
|
1331
1255
|
reason,
|
|
1332
1256
|
body,
|
|
1333
1257
|
signal
|
|
1334
1258
|
});
|
|
1335
1259
|
}
|
|
1336
|
-
/**
|
|
1337
|
-
* Edits a user's voice state in a guild
|
|
1338
|
-
*
|
|
1339
|
-
* @see {@link https://discord.com/developers/docs/resources/voice#modify-user-voice-state}
|
|
1340
|
-
* @param guildId - The id of the guild to edit the current user's voice state in
|
|
1341
|
-
* @param userId - The id of the user to edit the voice state for
|
|
1342
|
-
* @param body - The data for editing the voice state
|
|
1343
|
-
* @param options - The options for editing the voice state
|
|
1344
|
-
* @deprecated Use {@link VoiceAPI.editUserVoiceState} instead
|
|
1345
|
-
*/
|
|
1346
|
-
async editUserVoiceState(guildId, userId, body, { reason, signal } = {}) {
|
|
1347
|
-
return new VoiceAPI(this.rest).editUserVoiceState(guildId, userId, body, { reason, signal });
|
|
1348
|
-
}
|
|
1349
1260
|
/**
|
|
1350
1261
|
* Fetches all emojis for a guild
|
|
1351
1262
|
*
|
|
@@ -1354,7 +1265,7 @@ var GuildsAPI = class {
|
|
|
1354
1265
|
* @param options - The options for fetching the emojis
|
|
1355
1266
|
*/
|
|
1356
1267
|
async getEmojis(guildId, { signal } = {}) {
|
|
1357
|
-
return this.rest.get(
|
|
1268
|
+
return this.rest.get(Routes4.guildEmojis(guildId), { signal });
|
|
1358
1269
|
}
|
|
1359
1270
|
/**
|
|
1360
1271
|
* Fetches an emoji for a guild
|
|
@@ -1365,7 +1276,7 @@ var GuildsAPI = class {
|
|
|
1365
1276
|
* @param options - The options for fetching the emoji
|
|
1366
1277
|
*/
|
|
1367
1278
|
async getEmoji(guildId, emojiId, { signal } = {}) {
|
|
1368
|
-
return this.rest.get(
|
|
1279
|
+
return this.rest.get(Routes4.guildEmoji(guildId, emojiId), { signal });
|
|
1369
1280
|
}
|
|
1370
1281
|
/**
|
|
1371
1282
|
* Creates a new emoji for a guild
|
|
@@ -1376,7 +1287,7 @@ var GuildsAPI = class {
|
|
|
1376
1287
|
* @param options - The options for creating the emoji
|
|
1377
1288
|
*/
|
|
1378
1289
|
async createEmoji(guildId, body, { reason, signal } = {}) {
|
|
1379
|
-
return this.rest.post(
|
|
1290
|
+
return this.rest.post(Routes4.guildEmojis(guildId), {
|
|
1380
1291
|
reason,
|
|
1381
1292
|
body,
|
|
1382
1293
|
signal
|
|
@@ -1392,7 +1303,7 @@ var GuildsAPI = class {
|
|
|
1392
1303
|
* @param options - The options for editing the emoji
|
|
1393
1304
|
*/
|
|
1394
1305
|
async editEmoji(guildId, emojiId, body, { reason, signal } = {}) {
|
|
1395
|
-
return this.rest.patch(
|
|
1306
|
+
return this.rest.patch(Routes4.guildEmoji(guildId, emojiId), {
|
|
1396
1307
|
reason,
|
|
1397
1308
|
body,
|
|
1398
1309
|
signal
|
|
@@ -1407,7 +1318,7 @@ var GuildsAPI = class {
|
|
|
1407
1318
|
* @param options - The options for deleting the emoji
|
|
1408
1319
|
*/
|
|
1409
1320
|
async deleteEmoji(guildId, emojiId, { reason, signal } = {}) {
|
|
1410
|
-
await this.rest.delete(
|
|
1321
|
+
await this.rest.delete(Routes4.guildEmoji(guildId, emojiId), { reason, signal });
|
|
1411
1322
|
}
|
|
1412
1323
|
/**
|
|
1413
1324
|
* Fetches all scheduled events for a guild
|
|
@@ -1418,7 +1329,7 @@ var GuildsAPI = class {
|
|
|
1418
1329
|
* @param options - The options for fetching the scheduled events
|
|
1419
1330
|
*/
|
|
1420
1331
|
async getScheduledEvents(guildId, query = {}, { signal } = {}) {
|
|
1421
|
-
return this.rest.get(
|
|
1332
|
+
return this.rest.get(Routes4.guildScheduledEvents(guildId), {
|
|
1422
1333
|
query: makeURLSearchParams3(query),
|
|
1423
1334
|
signal
|
|
1424
1335
|
});
|
|
@@ -1432,7 +1343,7 @@ var GuildsAPI = class {
|
|
|
1432
1343
|
* @param options - The options for creating the scheduled event
|
|
1433
1344
|
*/
|
|
1434
1345
|
async createScheduledEvent(guildId, body, { reason, signal } = {}) {
|
|
1435
|
-
return this.rest.post(
|
|
1346
|
+
return this.rest.post(Routes4.guildScheduledEvents(guildId), {
|
|
1436
1347
|
reason,
|
|
1437
1348
|
body,
|
|
1438
1349
|
signal
|
|
@@ -1448,7 +1359,7 @@ var GuildsAPI = class {
|
|
|
1448
1359
|
* @param options - The options for fetching the scheduled event
|
|
1449
1360
|
*/
|
|
1450
1361
|
async getScheduledEvent(guildId, eventId, query = {}, { signal } = {}) {
|
|
1451
|
-
return this.rest.get(
|
|
1362
|
+
return this.rest.get(Routes4.guildScheduledEvent(guildId, eventId), {
|
|
1452
1363
|
query: makeURLSearchParams3(query),
|
|
1453
1364
|
signal
|
|
1454
1365
|
});
|
|
@@ -1463,7 +1374,7 @@ var GuildsAPI = class {
|
|
|
1463
1374
|
* @param options - The options for editing the scheduled event
|
|
1464
1375
|
*/
|
|
1465
1376
|
async editScheduledEvent(guildId, eventId, body, { reason, signal } = {}) {
|
|
1466
|
-
return this.rest.patch(
|
|
1377
|
+
return this.rest.patch(Routes4.guildScheduledEvent(guildId, eventId), {
|
|
1467
1378
|
reason,
|
|
1468
1379
|
body,
|
|
1469
1380
|
signal
|
|
@@ -1478,7 +1389,7 @@ var GuildsAPI = class {
|
|
|
1478
1389
|
* @param options - The options for deleting the scheduled event
|
|
1479
1390
|
*/
|
|
1480
1391
|
async deleteScheduledEvent(guildId, eventId, { reason, signal } = {}) {
|
|
1481
|
-
await this.rest.delete(
|
|
1392
|
+
await this.rest.delete(Routes4.guildScheduledEvent(guildId, eventId), { reason, signal });
|
|
1482
1393
|
}
|
|
1483
1394
|
/**
|
|
1484
1395
|
* Gets all users that are interested in a scheduled event
|
|
@@ -1490,7 +1401,7 @@ var GuildsAPI = class {
|
|
|
1490
1401
|
* @param options - The options for fetching the scheduled event users
|
|
1491
1402
|
*/
|
|
1492
1403
|
async getScheduledEventUsers(guildId, eventId, query = {}, { signal } = {}) {
|
|
1493
|
-
return this.rest.get(
|
|
1404
|
+
return this.rest.get(Routes4.guildScheduledEventUsers(guildId, eventId), {
|
|
1494
1405
|
query: makeURLSearchParams3(query),
|
|
1495
1406
|
signal
|
|
1496
1407
|
});
|
|
@@ -1503,7 +1414,7 @@ var GuildsAPI = class {
|
|
|
1503
1414
|
* @param options - The options for fetching the templates
|
|
1504
1415
|
*/
|
|
1505
1416
|
async getTemplates(guildId, { signal } = {}) {
|
|
1506
|
-
return this.rest.get(
|
|
1417
|
+
return this.rest.get(Routes4.guildTemplates(guildId), { signal });
|
|
1507
1418
|
}
|
|
1508
1419
|
/**
|
|
1509
1420
|
* Syncs a template for a guild
|
|
@@ -1514,7 +1425,7 @@ var GuildsAPI = class {
|
|
|
1514
1425
|
* @param options - The options for syncing the template
|
|
1515
1426
|
*/
|
|
1516
1427
|
async syncTemplate(guildId, templateCode, { signal } = {}) {
|
|
1517
|
-
return this.rest.put(
|
|
1428
|
+
return this.rest.put(Routes4.guildTemplate(guildId, templateCode), {
|
|
1518
1429
|
signal
|
|
1519
1430
|
});
|
|
1520
1431
|
}
|
|
@@ -1528,7 +1439,7 @@ var GuildsAPI = class {
|
|
|
1528
1439
|
* @param options - The options for editing the template
|
|
1529
1440
|
*/
|
|
1530
1441
|
async editTemplate(guildId, templateCode, body, { signal } = {}) {
|
|
1531
|
-
return this.rest.patch(
|
|
1442
|
+
return this.rest.patch(Routes4.guildTemplate(guildId, templateCode), {
|
|
1532
1443
|
body,
|
|
1533
1444
|
signal
|
|
1534
1445
|
});
|
|
@@ -1542,7 +1453,7 @@ var GuildsAPI = class {
|
|
|
1542
1453
|
* @param options - The options for deleting the template
|
|
1543
1454
|
*/
|
|
1544
1455
|
async deleteTemplate(guildId, templateCode, { signal } = {}) {
|
|
1545
|
-
await this.rest.delete(
|
|
1456
|
+
await this.rest.delete(Routes4.guildTemplate(guildId, templateCode), { signal });
|
|
1546
1457
|
}
|
|
1547
1458
|
/**
|
|
1548
1459
|
* Fetches all the stickers for a guild
|
|
@@ -1552,7 +1463,7 @@ var GuildsAPI = class {
|
|
|
1552
1463
|
* @param options - The options for fetching the stickers
|
|
1553
1464
|
*/
|
|
1554
1465
|
async getStickers(guildId, { signal } = {}) {
|
|
1555
|
-
return this.rest.get(
|
|
1466
|
+
return this.rest.get(Routes4.guildStickers(guildId), { signal });
|
|
1556
1467
|
}
|
|
1557
1468
|
/**
|
|
1558
1469
|
* Fetches a sticker for a guild
|
|
@@ -1563,7 +1474,7 @@ var GuildsAPI = class {
|
|
|
1563
1474
|
* @param options - The options for fetching the sticker
|
|
1564
1475
|
*/
|
|
1565
1476
|
async getSticker(guildId, stickerId, { signal } = {}) {
|
|
1566
|
-
return this.rest.get(
|
|
1477
|
+
return this.rest.get(Routes4.guildSticker(guildId, stickerId), { signal });
|
|
1567
1478
|
}
|
|
1568
1479
|
/**
|
|
1569
1480
|
* Creates a sticker for a guild
|
|
@@ -1575,7 +1486,7 @@ var GuildsAPI = class {
|
|
|
1575
1486
|
*/
|
|
1576
1487
|
async createSticker(guildId, { file, ...body }, { reason, signal } = {}) {
|
|
1577
1488
|
const fileData = { ...file, key: "file" };
|
|
1578
|
-
return this.rest.post(
|
|
1489
|
+
return this.rest.post(Routes4.guildStickers(guildId), {
|
|
1579
1490
|
appendToFormData: true,
|
|
1580
1491
|
body,
|
|
1581
1492
|
files: [fileData],
|
|
@@ -1593,7 +1504,7 @@ var GuildsAPI = class {
|
|
|
1593
1504
|
* @param options - The options for editing the sticker
|
|
1594
1505
|
*/
|
|
1595
1506
|
async editSticker(guildId, stickerId, body, { reason, signal } = {}) {
|
|
1596
|
-
return this.rest.patch(
|
|
1507
|
+
return this.rest.patch(Routes4.guildSticker(guildId, stickerId), {
|
|
1597
1508
|
reason,
|
|
1598
1509
|
body,
|
|
1599
1510
|
signal
|
|
@@ -1608,7 +1519,7 @@ var GuildsAPI = class {
|
|
|
1608
1519
|
* @param options - The options for deleting the sticker
|
|
1609
1520
|
*/
|
|
1610
1521
|
async deleteSticker(guildId, stickerId, { reason, signal } = {}) {
|
|
1611
|
-
await this.rest.delete(
|
|
1522
|
+
await this.rest.delete(Routes4.guildSticker(guildId, stickerId), { reason, signal });
|
|
1612
1523
|
}
|
|
1613
1524
|
/**
|
|
1614
1525
|
* Fetches the audit logs for a guild
|
|
@@ -1619,7 +1530,7 @@ var GuildsAPI = class {
|
|
|
1619
1530
|
* @param options - The options for fetching the audit logs
|
|
1620
1531
|
*/
|
|
1621
1532
|
async getAuditLogs(guildId, query = {}, { signal } = {}) {
|
|
1622
|
-
return this.rest.get(
|
|
1533
|
+
return this.rest.get(Routes4.guildAuditLog(guildId), {
|
|
1623
1534
|
query: makeURLSearchParams3(query),
|
|
1624
1535
|
signal
|
|
1625
1536
|
});
|
|
@@ -1632,7 +1543,7 @@ var GuildsAPI = class {
|
|
|
1632
1543
|
* @param options - The options for fetching the auto moderation rules
|
|
1633
1544
|
*/
|
|
1634
1545
|
async getAutoModerationRules(guildId, { signal } = {}) {
|
|
1635
|
-
return this.rest.get(
|
|
1546
|
+
return this.rest.get(Routes4.guildAutoModerationRules(guildId), {
|
|
1636
1547
|
signal
|
|
1637
1548
|
});
|
|
1638
1549
|
}
|
|
@@ -1645,7 +1556,7 @@ var GuildsAPI = class {
|
|
|
1645
1556
|
* @param options - The options for fetching the auto moderation rule
|
|
1646
1557
|
*/
|
|
1647
1558
|
async getAutoModerationRule(guildId, ruleId, { signal } = {}) {
|
|
1648
|
-
return this.rest.get(
|
|
1559
|
+
return this.rest.get(Routes4.guildAutoModerationRule(guildId, ruleId), {
|
|
1649
1560
|
signal
|
|
1650
1561
|
});
|
|
1651
1562
|
}
|
|
@@ -1658,7 +1569,7 @@ var GuildsAPI = class {
|
|
|
1658
1569
|
* @param options - The options for creating the auto moderation rule
|
|
1659
1570
|
*/
|
|
1660
1571
|
async createAutoModerationRule(guildId, body, { reason, signal } = {}) {
|
|
1661
|
-
return this.rest.post(
|
|
1572
|
+
return this.rest.post(Routes4.guildAutoModerationRules(guildId), {
|
|
1662
1573
|
reason,
|
|
1663
1574
|
body,
|
|
1664
1575
|
signal
|
|
@@ -1674,7 +1585,7 @@ var GuildsAPI = class {
|
|
|
1674
1585
|
* @param options - The options for editing the auto moderation rule
|
|
1675
1586
|
*/
|
|
1676
1587
|
async editAutoModerationRule(guildId, ruleId, body, { reason, signal } = {}) {
|
|
1677
|
-
return this.rest.patch(
|
|
1588
|
+
return this.rest.patch(Routes4.guildAutoModerationRule(guildId, ruleId), {
|
|
1678
1589
|
reason,
|
|
1679
1590
|
body,
|
|
1680
1591
|
signal
|
|
@@ -1689,7 +1600,7 @@ var GuildsAPI = class {
|
|
|
1689
1600
|
* @param options - The options for deleting the auto moderation rule
|
|
1690
1601
|
*/
|
|
1691
1602
|
async deleteAutoModerationRule(guildId, ruleId, { reason, signal } = {}) {
|
|
1692
|
-
await this.rest.delete(
|
|
1603
|
+
await this.rest.delete(Routes4.guildAutoModerationRule(guildId, ruleId), { reason, signal });
|
|
1693
1604
|
}
|
|
1694
1605
|
/**
|
|
1695
1606
|
* Fetches a guild member
|
|
@@ -1700,7 +1611,7 @@ var GuildsAPI = class {
|
|
|
1700
1611
|
* @param options - The options for fetching the guild member
|
|
1701
1612
|
*/
|
|
1702
1613
|
async getMember(guildId, userId, { signal } = {}) {
|
|
1703
|
-
return this.rest.get(
|
|
1614
|
+
return this.rest.get(Routes4.guildMember(guildId, userId), { signal });
|
|
1704
1615
|
}
|
|
1705
1616
|
/**
|
|
1706
1617
|
* Searches for guild members
|
|
@@ -1711,7 +1622,7 @@ var GuildsAPI = class {
|
|
|
1711
1622
|
* @param options - The options for searching for guild members
|
|
1712
1623
|
*/
|
|
1713
1624
|
async searchForMembers(guildId, query, { signal } = {}) {
|
|
1714
|
-
return this.rest.get(
|
|
1625
|
+
return this.rest.get(Routes4.guildMembersSearch(guildId), {
|
|
1715
1626
|
query: makeURLSearchParams3(query),
|
|
1716
1627
|
signal
|
|
1717
1628
|
});
|
|
@@ -1726,7 +1637,7 @@ var GuildsAPI = class {
|
|
|
1726
1637
|
* @param options - The options for editing the guild member
|
|
1727
1638
|
*/
|
|
1728
1639
|
async editMember(guildId, userId, body = {}, { reason, signal } = {}) {
|
|
1729
|
-
return this.rest.patch(
|
|
1640
|
+
return this.rest.patch(Routes4.guildMember(guildId, userId), {
|
|
1730
1641
|
reason,
|
|
1731
1642
|
body,
|
|
1732
1643
|
signal
|
|
@@ -1741,7 +1652,7 @@ var GuildsAPI = class {
|
|
|
1741
1652
|
* @param options - The options for removing the guild member
|
|
1742
1653
|
*/
|
|
1743
1654
|
async removeMember(guildId, userId, { reason, signal } = {}) {
|
|
1744
|
-
return this.rest.delete(
|
|
1655
|
+
return this.rest.delete(Routes4.guildMember(guildId, userId), { reason, signal });
|
|
1745
1656
|
}
|
|
1746
1657
|
/**
|
|
1747
1658
|
* Adds a role to a guild member
|
|
@@ -1753,7 +1664,7 @@ var GuildsAPI = class {
|
|
|
1753
1664
|
* @param options - The options for adding a role to a guild member
|
|
1754
1665
|
*/
|
|
1755
1666
|
async addRoleToMember(guildId, userId, roleId, { reason, signal } = {}) {
|
|
1756
|
-
await this.rest.put(
|
|
1667
|
+
await this.rest.put(Routes4.guildMemberRole(guildId, userId, roleId), { reason, signal });
|
|
1757
1668
|
}
|
|
1758
1669
|
/**
|
|
1759
1670
|
* Removes a role from a guild member
|
|
@@ -1765,7 +1676,7 @@ var GuildsAPI = class {
|
|
|
1765
1676
|
* @param options - The options for removing a role from a guild member
|
|
1766
1677
|
*/
|
|
1767
1678
|
async removeRoleFromMember(guildId, userId, roleId, { reason, signal } = {}) {
|
|
1768
|
-
await this.rest.delete(
|
|
1679
|
+
await this.rest.delete(Routes4.guildMemberRole(guildId, userId, roleId), { reason, signal });
|
|
1769
1680
|
}
|
|
1770
1681
|
/**
|
|
1771
1682
|
* Fetches a guild template
|
|
@@ -1775,7 +1686,7 @@ var GuildsAPI = class {
|
|
|
1775
1686
|
* @param options - The options for fetching the guild template
|
|
1776
1687
|
*/
|
|
1777
1688
|
async getTemplate(templateCode, { signal } = {}) {
|
|
1778
|
-
return this.rest.get(
|
|
1689
|
+
return this.rest.get(Routes4.template(templateCode), { signal });
|
|
1779
1690
|
}
|
|
1780
1691
|
/**
|
|
1781
1692
|
* Creates a new template
|
|
@@ -1786,7 +1697,7 @@ var GuildsAPI = class {
|
|
|
1786
1697
|
* @param options - The options for creating the template
|
|
1787
1698
|
*/
|
|
1788
1699
|
async createTemplate(templateCode, body, { signal } = {}) {
|
|
1789
|
-
return this.rest.post(
|
|
1700
|
+
return this.rest.post(Routes4.template(templateCode), { body, signal });
|
|
1790
1701
|
}
|
|
1791
1702
|
/**
|
|
1792
1703
|
* Fetches webhooks for a guild
|
|
@@ -1795,19 +1706,7 @@ var GuildsAPI = class {
|
|
|
1795
1706
|
* @param id - The id of the guild
|
|
1796
1707
|
*/
|
|
1797
1708
|
async getWebhooks(id) {
|
|
1798
|
-
return this.rest.get(
|
|
1799
|
-
}
|
|
1800
|
-
/**
|
|
1801
|
-
* Sets the voice state for the current user
|
|
1802
|
-
*
|
|
1803
|
-
* @see {@link https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state}
|
|
1804
|
-
* @param guildId - The id of the guild
|
|
1805
|
-
* @param body - The data for setting the voice state
|
|
1806
|
-
* @param options - The options for setting the voice state
|
|
1807
|
-
* @deprecated Use {@link VoiceAPI.editVoiceState} instead
|
|
1808
|
-
*/
|
|
1809
|
-
async setVoiceState(guildId, body = {}, { signal } = {}) {
|
|
1810
|
-
return new VoiceAPI(this.rest).editVoiceState(guildId, body, { signal });
|
|
1709
|
+
return this.rest.get(Routes4.guildWebhooks(id));
|
|
1811
1710
|
}
|
|
1812
1711
|
/**
|
|
1813
1712
|
* Fetches a guild onboarding
|
|
@@ -1817,7 +1716,7 @@ var GuildsAPI = class {
|
|
|
1817
1716
|
* @param options - The options for fetching the guild onboarding
|
|
1818
1717
|
*/
|
|
1819
1718
|
async getOnboarding(guildId, { signal } = {}) {
|
|
1820
|
-
return this.rest.get(
|
|
1719
|
+
return this.rest.get(Routes4.guildOnboarding(guildId), { signal });
|
|
1821
1720
|
}
|
|
1822
1721
|
/**
|
|
1823
1722
|
* Edits a guild onboarding
|
|
@@ -1828,7 +1727,7 @@ var GuildsAPI = class {
|
|
|
1828
1727
|
* @param options - The options for editing the guild onboarding
|
|
1829
1728
|
*/
|
|
1830
1729
|
async editOnboarding(guildId, body, { reason, signal } = {}) {
|
|
1831
|
-
return this.rest.put(
|
|
1730
|
+
return this.rest.put(Routes4.guildOnboarding(guildId), {
|
|
1832
1731
|
reason,
|
|
1833
1732
|
body,
|
|
1834
1733
|
signal
|
|
@@ -1842,7 +1741,7 @@ var GuildsAPI = class {
|
|
|
1842
1741
|
* @param options - The options for fetching the soundboard sounds
|
|
1843
1742
|
*/
|
|
1844
1743
|
async getSoundboardSounds(guildId, { signal } = {}) {
|
|
1845
|
-
return this.rest.get(
|
|
1744
|
+
return this.rest.get(Routes4.guildSoundboardSounds(guildId), {
|
|
1846
1745
|
signal
|
|
1847
1746
|
});
|
|
1848
1747
|
}
|
|
@@ -1855,7 +1754,7 @@ var GuildsAPI = class {
|
|
|
1855
1754
|
* @param options - The options for fetching the soundboard sound
|
|
1856
1755
|
*/
|
|
1857
1756
|
async getSoundboardSound(guildId, soundId, { signal } = {}) {
|
|
1858
|
-
return this.rest.get(
|
|
1757
|
+
return this.rest.get(Routes4.guildSoundboardSound(guildId, soundId), {
|
|
1859
1758
|
signal
|
|
1860
1759
|
});
|
|
1861
1760
|
}
|
|
@@ -1868,7 +1767,7 @@ var GuildsAPI = class {
|
|
|
1868
1767
|
* @param options - The options for creating the soundboard sound
|
|
1869
1768
|
*/
|
|
1870
1769
|
async createSoundboardSound(guildId, body, { reason, signal } = {}) {
|
|
1871
|
-
return this.rest.post(
|
|
1770
|
+
return this.rest.post(Routes4.guildSoundboardSounds(guildId), {
|
|
1872
1771
|
body,
|
|
1873
1772
|
reason,
|
|
1874
1773
|
signal
|
|
@@ -1884,7 +1783,7 @@ var GuildsAPI = class {
|
|
|
1884
1783
|
* @param options - The options for editing the soundboard sound
|
|
1885
1784
|
*/
|
|
1886
1785
|
async editSoundboardSound(guildId, soundId, body, { reason, signal } = {}) {
|
|
1887
|
-
return this.rest.patch(
|
|
1786
|
+
return this.rest.patch(Routes4.guildSoundboardSound(guildId, soundId), {
|
|
1888
1787
|
body,
|
|
1889
1788
|
reason,
|
|
1890
1789
|
signal
|
|
@@ -1899,7 +1798,7 @@ var GuildsAPI = class {
|
|
|
1899
1798
|
* @param options - The options for deleting the soundboard sound
|
|
1900
1799
|
*/
|
|
1901
1800
|
async deleteSoundboardSound(guildId, soundId, { reason, signal } = {}) {
|
|
1902
|
-
await this.rest.delete(
|
|
1801
|
+
await this.rest.delete(Routes4.guildSoundboardSound(guildId, soundId), { reason, signal });
|
|
1903
1802
|
}
|
|
1904
1803
|
};
|
|
1905
1804
|
|
|
@@ -1907,7 +1806,7 @@ var GuildsAPI = class {
|
|
|
1907
1806
|
import { makeURLSearchParams as makeURLSearchParams4 } from "@discordjs/rest";
|
|
1908
1807
|
import {
|
|
1909
1808
|
InteractionResponseType,
|
|
1910
|
-
Routes as
|
|
1809
|
+
Routes as Routes5
|
|
1911
1810
|
} from "discord-api-types/v10";
|
|
1912
1811
|
var InteractionsAPI = class {
|
|
1913
1812
|
constructor(rest, webhooks) {
|
|
@@ -1918,7 +1817,7 @@ var InteractionsAPI = class {
|
|
|
1918
1817
|
__name(this, "InteractionsAPI");
|
|
1919
1818
|
}
|
|
1920
1819
|
async reply(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
|
|
1921
|
-
const response = await this.rest.post(
|
|
1820
|
+
const response = await this.rest.post(Routes5.interactionCallback(interactionId, interactionToken), {
|
|
1922
1821
|
query: makeURLSearchParams4({ with_response }),
|
|
1923
1822
|
files,
|
|
1924
1823
|
auth: false,
|
|
@@ -1931,7 +1830,7 @@ var InteractionsAPI = class {
|
|
|
1931
1830
|
return with_response ? response : void 0;
|
|
1932
1831
|
}
|
|
1933
1832
|
async defer(interactionId, interactionToken, { with_response, ...data } = {}, { signal } = {}) {
|
|
1934
|
-
const response = await this.rest.post(
|
|
1833
|
+
const response = await this.rest.post(Routes5.interactionCallback(interactionId, interactionToken), {
|
|
1935
1834
|
query: makeURLSearchParams4({ with_response }),
|
|
1936
1835
|
auth: false,
|
|
1937
1836
|
body: {
|
|
@@ -1943,7 +1842,7 @@ var InteractionsAPI = class {
|
|
|
1943
1842
|
return with_response ? response : void 0;
|
|
1944
1843
|
}
|
|
1945
1844
|
async deferMessageUpdate(interactionId, interactionToken, { with_response } = {}, { signal } = {}) {
|
|
1946
|
-
const response = await this.rest.post(
|
|
1845
|
+
const response = await this.rest.post(Routes5.interactionCallback(interactionId, interactionToken), {
|
|
1947
1846
|
query: makeURLSearchParams4({ with_response }),
|
|
1948
1847
|
auth: false,
|
|
1949
1848
|
body: {
|
|
@@ -2012,7 +1911,7 @@ var InteractionsAPI = class {
|
|
|
2012
1911
|
await this.webhooks.deleteMessage(applicationId, interactionToken, messageId ?? "@original", {}, { signal });
|
|
2013
1912
|
}
|
|
2014
1913
|
async updateMessage(interactionId, interactionToken, { files, with_response, ...data }, { signal } = {}) {
|
|
2015
|
-
const response = await this.rest.post(
|
|
1914
|
+
const response = await this.rest.post(Routes5.interactionCallback(interactionId, interactionToken), {
|
|
2016
1915
|
query: makeURLSearchParams4({ with_response }),
|
|
2017
1916
|
files,
|
|
2018
1917
|
auth: false,
|
|
@@ -2025,7 +1924,7 @@ var InteractionsAPI = class {
|
|
|
2025
1924
|
return with_response ? response : void 0;
|
|
2026
1925
|
}
|
|
2027
1926
|
async createAutocompleteResponse(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
|
|
2028
|
-
const response = await this.rest.post(
|
|
1927
|
+
const response = await this.rest.post(Routes5.interactionCallback(interactionId, interactionToken), {
|
|
2029
1928
|
query: makeURLSearchParams4({ with_response }),
|
|
2030
1929
|
auth: false,
|
|
2031
1930
|
body: {
|
|
@@ -2037,7 +1936,7 @@ var InteractionsAPI = class {
|
|
|
2037
1936
|
return with_response ? response : void 0;
|
|
2038
1937
|
}
|
|
2039
1938
|
async createModal(interactionId, interactionToken, { with_response, ...data }, { signal } = {}) {
|
|
2040
|
-
const response = await this.rest.post(
|
|
1939
|
+
const response = await this.rest.post(Routes5.interactionCallback(interactionId, interactionToken), {
|
|
2041
1940
|
query: makeURLSearchParams4({ with_response }),
|
|
2042
1941
|
auth: false,
|
|
2043
1942
|
body: {
|
|
@@ -2048,29 +1947,11 @@ var InteractionsAPI = class {
|
|
|
2048
1947
|
});
|
|
2049
1948
|
return with_response ? response : void 0;
|
|
2050
1949
|
}
|
|
2051
|
-
/**
|
|
2052
|
-
* Sends a premium required response to an interaction
|
|
2053
|
-
*
|
|
2054
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
2055
|
-
* @param interactionId - The id of the interaction
|
|
2056
|
-
* @param interactionToken - The token of the interaction
|
|
2057
|
-
* @param options - The options for sending the premium required response
|
|
2058
|
-
* @deprecated Sending a premium-style button is the new Discord behavior.
|
|
2059
|
-
*/
|
|
2060
|
-
async sendPremiumRequired(interactionId, interactionToken, { signal } = {}) {
|
|
2061
|
-
await this.rest.post(Routes6.interactionCallback(interactionId, interactionToken), {
|
|
2062
|
-
auth: false,
|
|
2063
|
-
body: {
|
|
2064
|
-
type: InteractionResponseType.PremiumRequired
|
|
2065
|
-
},
|
|
2066
|
-
signal
|
|
2067
|
-
});
|
|
2068
|
-
}
|
|
2069
1950
|
};
|
|
2070
1951
|
|
|
2071
1952
|
// src/api/invite.ts
|
|
2072
1953
|
import { makeURLSearchParams as makeURLSearchParams5 } from "@discordjs/rest";
|
|
2073
|
-
import { Routes as
|
|
1954
|
+
import { Routes as Routes6 } from "discord-api-types/v10";
|
|
2074
1955
|
var InvitesAPI = class {
|
|
2075
1956
|
constructor(rest) {
|
|
2076
1957
|
this.rest = rest;
|
|
@@ -2087,7 +1968,7 @@ var InvitesAPI = class {
|
|
|
2087
1968
|
* @param options - The options for fetching the invite
|
|
2088
1969
|
*/
|
|
2089
1970
|
async get(code, query = {}, { signal } = {}) {
|
|
2090
|
-
return this.rest.get(
|
|
1971
|
+
return this.rest.get(Routes6.invite(code), {
|
|
2091
1972
|
query: makeURLSearchParams5(query),
|
|
2092
1973
|
signal
|
|
2093
1974
|
});
|
|
@@ -2100,14 +1981,14 @@ var InvitesAPI = class {
|
|
|
2100
1981
|
* @param options - The options for deleting the invite
|
|
2101
1982
|
*/
|
|
2102
1983
|
async delete(code, { reason, signal } = {}) {
|
|
2103
|
-
await this.rest.delete(
|
|
1984
|
+
await this.rest.delete(Routes6.invite(code), { reason, signal });
|
|
2104
1985
|
}
|
|
2105
1986
|
};
|
|
2106
1987
|
|
|
2107
1988
|
// src/api/monetization.ts
|
|
2108
1989
|
import { makeURLSearchParams as makeURLSearchParams6 } from "@discordjs/rest";
|
|
2109
1990
|
import {
|
|
2110
|
-
Routes as
|
|
1991
|
+
Routes as Routes7
|
|
2111
1992
|
} from "discord-api-types/v10";
|
|
2112
1993
|
var MonetizationAPI = class {
|
|
2113
1994
|
constructor(rest) {
|
|
@@ -2124,7 +2005,7 @@ var MonetizationAPI = class {
|
|
|
2124
2005
|
* @param options - The options for fetching the SKUs.
|
|
2125
2006
|
*/
|
|
2126
2007
|
async getSKUs(applicationId, { signal } = {}) {
|
|
2127
|
-
return this.rest.get(
|
|
2008
|
+
return this.rest.get(Routes7.skus(applicationId), { signal });
|
|
2128
2009
|
}
|
|
2129
2010
|
/**
|
|
2130
2011
|
* Fetches subscriptions for an SKU.
|
|
@@ -2135,7 +2016,7 @@ var MonetizationAPI = class {
|
|
|
2135
2016
|
* @param options - The options for fetching subscriptions
|
|
2136
2017
|
*/
|
|
2137
2018
|
async getSKUSubscriptions(skuId, query = {}, { signal } = {}) {
|
|
2138
|
-
return this.rest.get(
|
|
2019
|
+
return this.rest.get(Routes7.skuSubscriptions(skuId), {
|
|
2139
2020
|
signal,
|
|
2140
2021
|
query: makeURLSearchParams6(query)
|
|
2141
2022
|
});
|
|
@@ -2149,7 +2030,7 @@ var MonetizationAPI = class {
|
|
|
2149
2030
|
* @param options - The options for fetching the subscription
|
|
2150
2031
|
*/
|
|
2151
2032
|
async getSKUSubscription(skuId, subscriptionId, { signal } = {}) {
|
|
2152
|
-
return this.rest.get(
|
|
2033
|
+
return this.rest.get(Routes7.skuSubscription(skuId, subscriptionId), {
|
|
2153
2034
|
signal
|
|
2154
2035
|
});
|
|
2155
2036
|
}
|
|
@@ -2162,7 +2043,7 @@ var MonetizationAPI = class {
|
|
|
2162
2043
|
* @param options - The options for fetching entitlements
|
|
2163
2044
|
*/
|
|
2164
2045
|
async getEntitlements(applicationId, query = {}, { signal } = {}) {
|
|
2165
|
-
return this.rest.get(
|
|
2046
|
+
return this.rest.get(Routes7.entitlements(applicationId), {
|
|
2166
2047
|
signal,
|
|
2167
2048
|
query: makeURLSearchParams6(query)
|
|
2168
2049
|
});
|
|
@@ -2176,7 +2057,7 @@ var MonetizationAPI = class {
|
|
|
2176
2057
|
* @param options - The options for fetching the entitlement
|
|
2177
2058
|
*/
|
|
2178
2059
|
async getEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
2179
|
-
return this.rest.get(
|
|
2060
|
+
return this.rest.get(Routes7.entitlement(applicationId, entitlementId), {
|
|
2180
2061
|
signal
|
|
2181
2062
|
});
|
|
2182
2063
|
}
|
|
@@ -2189,7 +2070,7 @@ var MonetizationAPI = class {
|
|
|
2189
2070
|
* @param options - The options for creating the entitlement
|
|
2190
2071
|
*/
|
|
2191
2072
|
async createTestEntitlement(applicationId, body, { signal } = {}) {
|
|
2192
|
-
return this.rest.post(
|
|
2073
|
+
return this.rest.post(Routes7.entitlements(applicationId), {
|
|
2193
2074
|
body,
|
|
2194
2075
|
signal
|
|
2195
2076
|
});
|
|
@@ -2203,7 +2084,7 @@ var MonetizationAPI = class {
|
|
|
2203
2084
|
* @param options - The options for deleting the entitlement
|
|
2204
2085
|
*/
|
|
2205
2086
|
async deleteTestEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
2206
|
-
await this.rest.delete(
|
|
2087
|
+
await this.rest.delete(Routes7.entitlement(applicationId, entitlementId), { signal });
|
|
2207
2088
|
}
|
|
2208
2089
|
/**
|
|
2209
2090
|
* Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
|
|
@@ -2214,14 +2095,14 @@ var MonetizationAPI = class {
|
|
|
2214
2095
|
* @param options - The options for consuming the entitlement
|
|
2215
2096
|
*/
|
|
2216
2097
|
async consumeEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
2217
|
-
await this.rest.post(
|
|
2098
|
+
await this.rest.post(Routes7.consumeEntitlement(applicationId, entitlementId), { signal });
|
|
2218
2099
|
}
|
|
2219
2100
|
};
|
|
2220
2101
|
|
|
2221
2102
|
// src/api/oauth2.ts
|
|
2222
2103
|
import { makeURLSearchParams as makeURLSearchParams7 } from "@discordjs/rest";
|
|
2223
2104
|
import {
|
|
2224
|
-
Routes as
|
|
2105
|
+
Routes as Routes8,
|
|
2225
2106
|
RouteBases
|
|
2226
2107
|
} from "discord-api-types/v10";
|
|
2227
2108
|
var OAuth2API = class {
|
|
@@ -2238,7 +2119,7 @@ var OAuth2API = class {
|
|
|
2238
2119
|
* @param options - The options for creating the authorization URL
|
|
2239
2120
|
*/
|
|
2240
2121
|
generateAuthorizationURL(options) {
|
|
2241
|
-
const url = new URL(`${RouteBases.api}${
|
|
2122
|
+
const url = new URL(`${RouteBases.api}${Routes8.oauth2Authorization()}`);
|
|
2242
2123
|
url.search = makeURLSearchParams7(options).toString();
|
|
2243
2124
|
return url.toString();
|
|
2244
2125
|
}
|
|
@@ -2250,7 +2131,7 @@ var OAuth2API = class {
|
|
|
2250
2131
|
* @param options - The options for the token exchange request
|
|
2251
2132
|
*/
|
|
2252
2133
|
async tokenExchange(body, { signal } = {}) {
|
|
2253
|
-
return this.rest.post(
|
|
2134
|
+
return this.rest.post(Routes8.oauth2TokenExchange(), {
|
|
2254
2135
|
body: makeURLSearchParams7(body),
|
|
2255
2136
|
passThroughBody: true,
|
|
2256
2137
|
headers: {
|
|
@@ -2268,7 +2149,7 @@ var OAuth2API = class {
|
|
|
2268
2149
|
* @param options - The options for the refresh token request
|
|
2269
2150
|
*/
|
|
2270
2151
|
async refreshToken(body, { signal } = {}) {
|
|
2271
|
-
return this.rest.post(
|
|
2152
|
+
return this.rest.post(Routes8.oauth2TokenExchange(), {
|
|
2272
2153
|
body: makeURLSearchParams7(body),
|
|
2273
2154
|
passThroughBody: true,
|
|
2274
2155
|
headers: {
|
|
@@ -2288,7 +2169,7 @@ var OAuth2API = class {
|
|
|
2288
2169
|
* @param options - The options for the client credentials grant request
|
|
2289
2170
|
*/
|
|
2290
2171
|
async getToken(body, { signal } = {}) {
|
|
2291
|
-
return this.rest.post(
|
|
2172
|
+
return this.rest.post(Routes8.oauth2TokenExchange(), {
|
|
2292
2173
|
body: makeURLSearchParams7(body),
|
|
2293
2174
|
passThroughBody: true,
|
|
2294
2175
|
headers: {
|
|
@@ -2305,7 +2186,7 @@ var OAuth2API = class {
|
|
|
2305
2186
|
* @param options - The options for the current bot application information request
|
|
2306
2187
|
*/
|
|
2307
2188
|
async getCurrentBotApplicationInformation({ signal } = {}) {
|
|
2308
|
-
return this.rest.get(
|
|
2189
|
+
return this.rest.get(Routes8.oauth2CurrentApplication(), {
|
|
2309
2190
|
signal
|
|
2310
2191
|
});
|
|
2311
2192
|
}
|
|
@@ -2316,7 +2197,7 @@ var OAuth2API = class {
|
|
|
2316
2197
|
* @param options - The options for the current authorization information request
|
|
2317
2198
|
*/
|
|
2318
2199
|
async getCurrentAuthorizationInformation({ signal } = {}) {
|
|
2319
|
-
return this.rest.get(
|
|
2200
|
+
return this.rest.get(Routes8.oauth2CurrentAuthorization(), {
|
|
2320
2201
|
signal
|
|
2321
2202
|
});
|
|
2322
2203
|
}
|
|
@@ -2330,7 +2211,7 @@ var OAuth2API = class {
|
|
|
2330
2211
|
* @param options - The options for the token revocation request
|
|
2331
2212
|
*/
|
|
2332
2213
|
async revokeToken(applicationId, applicationSecret, body, { signal } = {}) {
|
|
2333
|
-
await this.rest.post(
|
|
2214
|
+
await this.rest.post(Routes8.oauth2TokenRevocation(), {
|
|
2334
2215
|
body: makeURLSearchParams7(body),
|
|
2335
2216
|
passThroughBody: true,
|
|
2336
2217
|
headers: {
|
|
@@ -2346,7 +2227,7 @@ var OAuth2API = class {
|
|
|
2346
2227
|
// src/api/poll.ts
|
|
2347
2228
|
import { makeURLSearchParams as makeURLSearchParams8 } from "@discordjs/rest";
|
|
2348
2229
|
import {
|
|
2349
|
-
Routes as
|
|
2230
|
+
Routes as Routes9
|
|
2350
2231
|
} from "discord-api-types/v10";
|
|
2351
2232
|
var PollAPI = class {
|
|
2352
2233
|
constructor(rest) {
|
|
@@ -2366,7 +2247,7 @@ var PollAPI = class {
|
|
|
2366
2247
|
* @param options - The options for getting the list of voters
|
|
2367
2248
|
*/
|
|
2368
2249
|
async getAnswerVoters(channelId, messageId, answerId, query = {}, { signal } = {}) {
|
|
2369
|
-
return this.rest.get(
|
|
2250
|
+
return this.rest.get(Routes9.pollAnswerVoters(channelId, messageId, answerId), {
|
|
2370
2251
|
signal,
|
|
2371
2252
|
query: makeURLSearchParams8(query)
|
|
2372
2253
|
});
|
|
@@ -2380,7 +2261,7 @@ var PollAPI = class {
|
|
|
2380
2261
|
* @param options - The options for expiring the poll
|
|
2381
2262
|
*/
|
|
2382
2263
|
async expirePoll(channelId, messageId, { signal } = {}) {
|
|
2383
|
-
return this.rest.post(
|
|
2264
|
+
return this.rest.post(Routes9.expirePoll(channelId, messageId), {
|
|
2384
2265
|
signal
|
|
2385
2266
|
});
|
|
2386
2267
|
}
|
|
@@ -2388,7 +2269,7 @@ var PollAPI = class {
|
|
|
2388
2269
|
|
|
2389
2270
|
// src/api/roleConnections.ts
|
|
2390
2271
|
import {
|
|
2391
|
-
Routes as
|
|
2272
|
+
Routes as Routes10
|
|
2392
2273
|
} from "discord-api-types/v10";
|
|
2393
2274
|
var RoleConnectionsAPI = class {
|
|
2394
2275
|
constructor(rest) {
|
|
@@ -2405,7 +2286,7 @@ var RoleConnectionsAPI = class {
|
|
|
2405
2286
|
* @param options - The options for fetching the role connection metadata records
|
|
2406
2287
|
*/
|
|
2407
2288
|
async getMetadataRecords(applicationId, { signal } = {}) {
|
|
2408
|
-
return this.rest.get(
|
|
2289
|
+
return this.rest.get(Routes10.applicationRoleConnectionMetadata(applicationId), {
|
|
2409
2290
|
signal
|
|
2410
2291
|
});
|
|
2411
2292
|
}
|
|
@@ -2418,7 +2299,7 @@ var RoleConnectionsAPI = class {
|
|
|
2418
2299
|
* @param options - The options for updating the role connection metadata records
|
|
2419
2300
|
*/
|
|
2420
2301
|
async updateMetadataRecords(applicationId, body, { signal } = {}) {
|
|
2421
|
-
return this.rest.put(
|
|
2302
|
+
return this.rest.put(Routes10.applicationRoleConnectionMetadata(applicationId), {
|
|
2422
2303
|
body,
|
|
2423
2304
|
signal
|
|
2424
2305
|
});
|
|
@@ -2426,7 +2307,7 @@ var RoleConnectionsAPI = class {
|
|
|
2426
2307
|
};
|
|
2427
2308
|
|
|
2428
2309
|
// src/api/soundboardSounds.ts
|
|
2429
|
-
import { Routes as
|
|
2310
|
+
import { Routes as Routes11 } from "discord-api-types/v10";
|
|
2430
2311
|
var SoundboardSoundsAPI = class {
|
|
2431
2312
|
constructor(rest) {
|
|
2432
2313
|
this.rest = rest;
|
|
@@ -2441,7 +2322,7 @@ var SoundboardSoundsAPI = class {
|
|
|
2441
2322
|
* @param options - The options for fetching the soundboard default sounds.
|
|
2442
2323
|
*/
|
|
2443
2324
|
async getSoundboardDefaultSounds({ signal } = {}) {
|
|
2444
|
-
return this.rest.get(
|
|
2325
|
+
return this.rest.get(Routes11.soundboardDefaultSounds(), {
|
|
2445
2326
|
signal
|
|
2446
2327
|
});
|
|
2447
2328
|
}
|
|
@@ -2449,7 +2330,7 @@ var SoundboardSoundsAPI = class {
|
|
|
2449
2330
|
|
|
2450
2331
|
// src/api/stageInstances.ts
|
|
2451
2332
|
import {
|
|
2452
|
-
Routes as
|
|
2333
|
+
Routes as Routes12
|
|
2453
2334
|
} from "discord-api-types/v10";
|
|
2454
2335
|
var StageInstancesAPI = class {
|
|
2455
2336
|
constructor(rest) {
|
|
@@ -2466,7 +2347,7 @@ var StageInstancesAPI = class {
|
|
|
2466
2347
|
* @param options - The options for creating the new stage instance
|
|
2467
2348
|
*/
|
|
2468
2349
|
async create(body, { reason, signal } = {}) {
|
|
2469
|
-
return this.rest.post(
|
|
2350
|
+
return this.rest.post(Routes12.stageInstances(), {
|
|
2470
2351
|
body,
|
|
2471
2352
|
reason,
|
|
2472
2353
|
signal
|
|
@@ -2480,7 +2361,7 @@ var StageInstancesAPI = class {
|
|
|
2480
2361
|
* @param options - The options for fetching the stage instance
|
|
2481
2362
|
*/
|
|
2482
2363
|
async get(channelId, { signal } = {}) {
|
|
2483
|
-
return this.rest.get(
|
|
2364
|
+
return this.rest.get(Routes12.stageInstance(channelId), { signal });
|
|
2484
2365
|
}
|
|
2485
2366
|
/**
|
|
2486
2367
|
* Edits a stage instance
|
|
@@ -2491,7 +2372,7 @@ var StageInstancesAPI = class {
|
|
|
2491
2372
|
* @param options - The options for editing the stage instance
|
|
2492
2373
|
*/
|
|
2493
2374
|
async edit(channelId, body, { reason, signal } = {}) {
|
|
2494
|
-
return this.rest.patch(
|
|
2375
|
+
return this.rest.patch(Routes12.stageInstance(channelId), {
|
|
2495
2376
|
body,
|
|
2496
2377
|
reason,
|
|
2497
2378
|
signal
|
|
@@ -2505,13 +2386,13 @@ var StageInstancesAPI = class {
|
|
|
2505
2386
|
* @param options - The options for deleting the stage instance
|
|
2506
2387
|
*/
|
|
2507
2388
|
async delete(channelId, { reason, signal } = {}) {
|
|
2508
|
-
await this.rest.delete(
|
|
2389
|
+
await this.rest.delete(Routes12.stageInstance(channelId), { reason, signal });
|
|
2509
2390
|
}
|
|
2510
2391
|
};
|
|
2511
2392
|
|
|
2512
2393
|
// src/api/sticker.ts
|
|
2513
2394
|
import {
|
|
2514
|
-
Routes as
|
|
2395
|
+
Routes as Routes13
|
|
2515
2396
|
} from "discord-api-types/v10";
|
|
2516
2397
|
var StickersAPI = class {
|
|
2517
2398
|
constructor(rest) {
|
|
@@ -2528,7 +2409,7 @@ var StickersAPI = class {
|
|
|
2528
2409
|
* @param options - The options for fetching the sticker pack
|
|
2529
2410
|
*/
|
|
2530
2411
|
async getStickerPack(packId, { signal } = {}) {
|
|
2531
|
-
return this.rest.get(
|
|
2412
|
+
return this.rest.get(Routes13.stickerPack(packId), { signal });
|
|
2532
2413
|
}
|
|
2533
2414
|
/**
|
|
2534
2415
|
* Fetches all of the sticker packs
|
|
@@ -2537,17 +2418,7 @@ var StickersAPI = class {
|
|
|
2537
2418
|
* @param options - The options for fetching the sticker packs
|
|
2538
2419
|
*/
|
|
2539
2420
|
async getStickers({ signal } = {}) {
|
|
2540
|
-
return this.rest.get(
|
|
2541
|
-
}
|
|
2542
|
-
/**
|
|
2543
|
-
* Fetches all of the sticker packs
|
|
2544
|
-
*
|
|
2545
|
-
* @see {@link https://discord.com/developers/docs/resources/sticker#list-sticker-packs}
|
|
2546
|
-
* @param options - The options for fetching the sticker packs
|
|
2547
|
-
* @deprecated Use {@link StickersAPI.getStickers} instead.
|
|
2548
|
-
*/
|
|
2549
|
-
async getNitroStickers(options = {}) {
|
|
2550
|
-
return this.getStickers(options);
|
|
2421
|
+
return this.rest.get(Routes13.stickerPacks(), { signal });
|
|
2551
2422
|
}
|
|
2552
2423
|
/**
|
|
2553
2424
|
* Fetches a sticker
|
|
@@ -2557,13 +2428,13 @@ var StickersAPI = class {
|
|
|
2557
2428
|
* @param options - The options for fetching the sticker
|
|
2558
2429
|
*/
|
|
2559
2430
|
async get(stickerId, { signal } = {}) {
|
|
2560
|
-
return this.rest.get(
|
|
2431
|
+
return this.rest.get(Routes13.sticker(stickerId), { signal });
|
|
2561
2432
|
}
|
|
2562
2433
|
};
|
|
2563
2434
|
|
|
2564
2435
|
// src/api/thread.ts
|
|
2565
2436
|
import {
|
|
2566
|
-
Routes as
|
|
2437
|
+
Routes as Routes14
|
|
2567
2438
|
} from "discord-api-types/v10";
|
|
2568
2439
|
var ThreadsAPI = class {
|
|
2569
2440
|
constructor(rest) {
|
|
@@ -2580,7 +2451,7 @@ var ThreadsAPI = class {
|
|
|
2580
2451
|
* @param options - The options for joining the thread
|
|
2581
2452
|
*/
|
|
2582
2453
|
async join(threadId, { signal } = {}) {
|
|
2583
|
-
await this.rest.put(
|
|
2454
|
+
await this.rest.put(Routes14.threadMembers(threadId, "@me"), { signal });
|
|
2584
2455
|
}
|
|
2585
2456
|
/**
|
|
2586
2457
|
* Adds a member to a thread
|
|
@@ -2591,7 +2462,7 @@ var ThreadsAPI = class {
|
|
|
2591
2462
|
* @param options - The options for adding the member to the thread
|
|
2592
2463
|
*/
|
|
2593
2464
|
async addMember(threadId, userId, { signal } = {}) {
|
|
2594
|
-
await this.rest.put(
|
|
2465
|
+
await this.rest.put(Routes14.threadMembers(threadId, userId), { signal });
|
|
2595
2466
|
}
|
|
2596
2467
|
/**
|
|
2597
2468
|
* Removes the current user from a thread
|
|
@@ -2601,7 +2472,7 @@ var ThreadsAPI = class {
|
|
|
2601
2472
|
* @param options - The options for leaving the thread
|
|
2602
2473
|
*/
|
|
2603
2474
|
async leave(threadId, { signal } = {}) {
|
|
2604
|
-
await this.rest.delete(
|
|
2475
|
+
await this.rest.delete(Routes14.threadMembers(threadId, "@me"), { signal });
|
|
2605
2476
|
}
|
|
2606
2477
|
/**
|
|
2607
2478
|
* Removes a member from a thread
|
|
@@ -2612,7 +2483,7 @@ var ThreadsAPI = class {
|
|
|
2612
2483
|
* @param options - The options for removing the member from the thread
|
|
2613
2484
|
*/
|
|
2614
2485
|
async removeMember(threadId, userId, { signal } = {}) {
|
|
2615
|
-
await this.rest.delete(
|
|
2486
|
+
await this.rest.delete(Routes14.threadMembers(threadId, userId), { signal });
|
|
2616
2487
|
}
|
|
2617
2488
|
/**
|
|
2618
2489
|
* Fetches a member of a thread
|
|
@@ -2623,7 +2494,7 @@ var ThreadsAPI = class {
|
|
|
2623
2494
|
* @param options - The options for fetching the member
|
|
2624
2495
|
*/
|
|
2625
2496
|
async getMember(threadId, userId, { signal } = {}) {
|
|
2626
|
-
return this.rest.get(
|
|
2497
|
+
return this.rest.get(Routes14.threadMembers(threadId, userId), { signal });
|
|
2627
2498
|
}
|
|
2628
2499
|
/**
|
|
2629
2500
|
* Fetches all members of a thread
|
|
@@ -2633,14 +2504,14 @@ var ThreadsAPI = class {
|
|
|
2633
2504
|
* @param options - The options for fetching the members
|
|
2634
2505
|
*/
|
|
2635
2506
|
async getAllMembers(threadId, { signal } = {}) {
|
|
2636
|
-
return this.rest.get(
|
|
2507
|
+
return this.rest.get(Routes14.threadMembers(threadId), { signal });
|
|
2637
2508
|
}
|
|
2638
2509
|
};
|
|
2639
2510
|
|
|
2640
2511
|
// src/api/user.ts
|
|
2641
2512
|
import { makeURLSearchParams as makeURLSearchParams9 } from "@discordjs/rest";
|
|
2642
2513
|
import {
|
|
2643
|
-
Routes as
|
|
2514
|
+
Routes as Routes15
|
|
2644
2515
|
} from "discord-api-types/v10";
|
|
2645
2516
|
var UsersAPI = class {
|
|
2646
2517
|
constructor(rest) {
|
|
@@ -2657,7 +2528,7 @@ var UsersAPI = class {
|
|
|
2657
2528
|
* @param options - The options for fetching the user
|
|
2658
2529
|
*/
|
|
2659
2530
|
async get(userId, { signal } = {}) {
|
|
2660
|
-
return this.rest.get(
|
|
2531
|
+
return this.rest.get(Routes15.user(userId), { signal });
|
|
2661
2532
|
}
|
|
2662
2533
|
/**
|
|
2663
2534
|
* Returns the user object of the requester's account
|
|
@@ -2666,7 +2537,7 @@ var UsersAPI = class {
|
|
|
2666
2537
|
* @param options - The options for fetching the current user
|
|
2667
2538
|
*/
|
|
2668
2539
|
async getCurrent({ signal } = {}) {
|
|
2669
|
-
return this.rest.get(
|
|
2540
|
+
return this.rest.get(Routes15.user("@me"), { signal });
|
|
2670
2541
|
}
|
|
2671
2542
|
/**
|
|
2672
2543
|
* Returns a list of partial guild objects the current user is a member of
|
|
@@ -2676,7 +2547,7 @@ var UsersAPI = class {
|
|
|
2676
2547
|
* @param options - The options for fetching the guilds
|
|
2677
2548
|
*/
|
|
2678
2549
|
async getGuilds(query = {}, { signal } = {}) {
|
|
2679
|
-
return this.rest.get(
|
|
2550
|
+
return this.rest.get(Routes15.userGuilds(), {
|
|
2680
2551
|
query: makeURLSearchParams9(query),
|
|
2681
2552
|
signal
|
|
2682
2553
|
});
|
|
@@ -2689,7 +2560,7 @@ var UsersAPI = class {
|
|
|
2689
2560
|
* @param options - The options for leaving the guild
|
|
2690
2561
|
*/
|
|
2691
2562
|
async leaveGuild(guildId, { signal } = {}) {
|
|
2692
|
-
await this.rest.delete(
|
|
2563
|
+
await this.rest.delete(Routes15.userGuild(guildId), { signal });
|
|
2693
2564
|
}
|
|
2694
2565
|
/**
|
|
2695
2566
|
* Edits the current user
|
|
@@ -2699,7 +2570,7 @@ var UsersAPI = class {
|
|
|
2699
2570
|
* @param options - The options for editing the user
|
|
2700
2571
|
*/
|
|
2701
2572
|
async edit(body, { signal } = {}) {
|
|
2702
|
-
return this.rest.patch(
|
|
2573
|
+
return this.rest.patch(Routes15.user("@me"), { body, signal });
|
|
2703
2574
|
}
|
|
2704
2575
|
/**
|
|
2705
2576
|
* Fetches the guild member for the current user
|
|
@@ -2709,7 +2580,7 @@ var UsersAPI = class {
|
|
|
2709
2580
|
* @param options - The options for fetching the guild member
|
|
2710
2581
|
*/
|
|
2711
2582
|
async getGuildMember(guildId, { signal } = {}) {
|
|
2712
|
-
return this.rest.get(
|
|
2583
|
+
return this.rest.get(Routes15.userGuildMember(guildId), { signal });
|
|
2713
2584
|
}
|
|
2714
2585
|
/**
|
|
2715
2586
|
* Edits the guild member for the current user
|
|
@@ -2720,7 +2591,7 @@ var UsersAPI = class {
|
|
|
2720
2591
|
* @param options - The options for editing the guild member
|
|
2721
2592
|
*/
|
|
2722
2593
|
async editCurrentGuildMember(guildId, body = {}, { reason, signal } = {}) {
|
|
2723
|
-
return this.rest.patch(
|
|
2594
|
+
return this.rest.patch(Routes15.guildMember(guildId, "@me"), {
|
|
2724
2595
|
reason,
|
|
2725
2596
|
body,
|
|
2726
2597
|
signal
|
|
@@ -2734,7 +2605,7 @@ var UsersAPI = class {
|
|
|
2734
2605
|
* @param options - The options for opening the DM
|
|
2735
2606
|
*/
|
|
2736
2607
|
async createDM(userId, { signal } = {}) {
|
|
2737
|
-
return this.rest.post(
|
|
2608
|
+
return this.rest.post(Routes15.userChannels(), {
|
|
2738
2609
|
body: { recipient_id: userId },
|
|
2739
2610
|
signal
|
|
2740
2611
|
});
|
|
@@ -2746,7 +2617,7 @@ var UsersAPI = class {
|
|
|
2746
2617
|
* @param options - The options for fetching the user's connections
|
|
2747
2618
|
*/
|
|
2748
2619
|
async getConnections({ signal } = {}) {
|
|
2749
|
-
return this.rest.get(
|
|
2620
|
+
return this.rest.get(Routes15.userConnections(), { signal });
|
|
2750
2621
|
}
|
|
2751
2622
|
/**
|
|
2752
2623
|
* Gets the current user's active application role connection
|
|
@@ -2756,7 +2627,7 @@ var UsersAPI = class {
|
|
|
2756
2627
|
* @param options - The options for fetching the role connections
|
|
2757
2628
|
*/
|
|
2758
2629
|
async getApplicationRoleConnection(applicationId, { signal } = {}) {
|
|
2759
|
-
return this.rest.get(
|
|
2630
|
+
return this.rest.get(Routes15.userApplicationRoleConnection(applicationId), {
|
|
2760
2631
|
signal
|
|
2761
2632
|
});
|
|
2762
2633
|
}
|
|
@@ -2769,7 +2640,81 @@ var UsersAPI = class {
|
|
|
2769
2640
|
* @param options - The options for updating the application role connection
|
|
2770
2641
|
*/
|
|
2771
2642
|
async updateApplicationRoleConnection(applicationId, body, { signal } = {}) {
|
|
2772
|
-
return this.rest.put(
|
|
2643
|
+
return this.rest.put(Routes15.userApplicationRoleConnection(applicationId), {
|
|
2644
|
+
body,
|
|
2645
|
+
signal
|
|
2646
|
+
});
|
|
2647
|
+
}
|
|
2648
|
+
};
|
|
2649
|
+
|
|
2650
|
+
// src/api/voice.ts
|
|
2651
|
+
import {
|
|
2652
|
+
Routes as Routes16
|
|
2653
|
+
} from "discord-api-types/v10";
|
|
2654
|
+
var VoiceAPI = class {
|
|
2655
|
+
constructor(rest) {
|
|
2656
|
+
this.rest = rest;
|
|
2657
|
+
}
|
|
2658
|
+
static {
|
|
2659
|
+
__name(this, "VoiceAPI");
|
|
2660
|
+
}
|
|
2661
|
+
/**
|
|
2662
|
+
* Fetches all voice regions
|
|
2663
|
+
*
|
|
2664
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#list-voice-regions}
|
|
2665
|
+
* @param options - The options for fetching the voice regions
|
|
2666
|
+
*/
|
|
2667
|
+
async getVoiceRegions({ signal } = {}) {
|
|
2668
|
+
return this.rest.get(Routes16.voiceRegions(), { signal });
|
|
2669
|
+
}
|
|
2670
|
+
/**
|
|
2671
|
+
* Fetches voice state of a user by their id
|
|
2672
|
+
*
|
|
2673
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#get-user-voice-state}
|
|
2674
|
+
* @param options - The options for fetching user voice state
|
|
2675
|
+
*/
|
|
2676
|
+
async getUserVoiceState(guildId, userId, { signal } = {}) {
|
|
2677
|
+
return this.rest.get(Routes16.guildVoiceState(guildId, userId), {
|
|
2678
|
+
signal
|
|
2679
|
+
});
|
|
2680
|
+
}
|
|
2681
|
+
/**
|
|
2682
|
+
* Fetches the current user's voice state
|
|
2683
|
+
*
|
|
2684
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#get-current-user-voice-state}
|
|
2685
|
+
* @param options - The options for fetching user voice state
|
|
2686
|
+
*/
|
|
2687
|
+
async getVoiceState(guildId, { signal } = {}) {
|
|
2688
|
+
return this.rest.get(Routes16.guildVoiceState(guildId, "@me"), {
|
|
2689
|
+
signal
|
|
2690
|
+
});
|
|
2691
|
+
}
|
|
2692
|
+
/**
|
|
2693
|
+
* Edits a user's voice state in a guild
|
|
2694
|
+
*
|
|
2695
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#modify-user-voice-state}
|
|
2696
|
+
* @param guildId - The id of the guild to edit the current user's voice state in
|
|
2697
|
+
* @param userId - The id of the user to edit the voice state for
|
|
2698
|
+
* @param body - The data for editing the voice state
|
|
2699
|
+
* @param options - The options for editing the voice state
|
|
2700
|
+
*/
|
|
2701
|
+
async editUserVoiceState(guildId, userId, body, { reason, signal } = {}) {
|
|
2702
|
+
return this.rest.patch(Routes16.guildVoiceState(guildId, userId), {
|
|
2703
|
+
reason,
|
|
2704
|
+
body,
|
|
2705
|
+
signal
|
|
2706
|
+
});
|
|
2707
|
+
}
|
|
2708
|
+
/**
|
|
2709
|
+
* Edits the voice state for the current user
|
|
2710
|
+
*
|
|
2711
|
+
* @see {@link https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state}
|
|
2712
|
+
* @param guildId - The id of the guild
|
|
2713
|
+
* @param body - The data for editing the voice state
|
|
2714
|
+
* @param options - The options for editing the voice state
|
|
2715
|
+
*/
|
|
2716
|
+
async editVoiceState(guildId, body = {}, { signal } = {}) {
|
|
2717
|
+
return this.rest.patch(Routes16.guildVoiceState(guildId, "@me"), {
|
|
2773
2718
|
body,
|
|
2774
2719
|
signal
|
|
2775
2720
|
});
|
|
@@ -3156,7 +3101,7 @@ __name(withFiles, "withFiles");
|
|
|
3156
3101
|
|
|
3157
3102
|
// src/index.ts
|
|
3158
3103
|
export * from "discord-api-types/v10";
|
|
3159
|
-
var version = "3.0.0-dev.
|
|
3104
|
+
var version = "3.0.0-dev.1734135156-35ebcc7d5";
|
|
3160
3105
|
export {
|
|
3161
3106
|
API,
|
|
3162
3107
|
ApplicationCommandsAPI,
|