@discordeno/rest 19.0.0-next.782a778 → 19.0.0-next.7a69c02
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/manager.js +90 -58
- package/dist/manager.js.map +1 -1
- package/dist/types.d.ts +78 -31
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +3 -3
package/dist/manager.js
CHANGED
|
@@ -872,19 +872,22 @@ export function createRestManager(options) {
|
|
|
872
872
|
async addThreadMember (channelId, userId) {
|
|
873
873
|
await rest.put(rest.routes.channels.threads.user(channelId, userId));
|
|
874
874
|
},
|
|
875
|
-
async createAutomodRule (guildId, body) {
|
|
875
|
+
async createAutomodRule (guildId, body, reason) {
|
|
876
876
|
return await rest.post(rest.routes.guilds.automod.rules(guildId), {
|
|
877
|
-
body
|
|
877
|
+
body,
|
|
878
|
+
reason
|
|
878
879
|
});
|
|
879
880
|
},
|
|
880
|
-
async createChannel (guildId, body) {
|
|
881
|
+
async createChannel (guildId, body, reason) {
|
|
881
882
|
return await rest.post(rest.routes.guilds.channels(guildId), {
|
|
882
|
-
body
|
|
883
|
+
body,
|
|
884
|
+
reason
|
|
883
885
|
});
|
|
884
886
|
},
|
|
885
|
-
async createEmoji (guildId, body) {
|
|
887
|
+
async createEmoji (guildId, body, reason) {
|
|
886
888
|
return await rest.post(rest.routes.guilds.emojis(guildId), {
|
|
887
|
-
body
|
|
889
|
+
body,
|
|
890
|
+
reason
|
|
888
891
|
});
|
|
889
892
|
},
|
|
890
893
|
async createGlobalApplicationCommand (body) {
|
|
@@ -910,14 +913,15 @@ export function createRestManager(options) {
|
|
|
910
913
|
body
|
|
911
914
|
});
|
|
912
915
|
},
|
|
913
|
-
async createGuildSticker (guildId, options) {
|
|
916
|
+
async createGuildSticker (guildId, options, reason) {
|
|
914
917
|
const form = new FormData();
|
|
915
918
|
form.append('file', options.file.blob, options.file.name);
|
|
916
919
|
form.append('name', options.name);
|
|
917
920
|
form.append('description', options.description);
|
|
918
921
|
form.append('tags', options.tags);
|
|
919
922
|
return await rest.post(rest.routes.guilds.stickers(guildId), {
|
|
920
|
-
body: form
|
|
923
|
+
body: form,
|
|
924
|
+
reason
|
|
921
925
|
});
|
|
922
926
|
},
|
|
923
927
|
async createGuildTemplate (guildId, body) {
|
|
@@ -925,15 +929,17 @@ export function createRestManager(options) {
|
|
|
925
929
|
body
|
|
926
930
|
});
|
|
927
931
|
},
|
|
928
|
-
async createForumThread (channelId, body) {
|
|
932
|
+
async createForumThread (channelId, body, reason) {
|
|
929
933
|
return await rest.post(rest.routes.channels.forum(channelId), {
|
|
930
934
|
body,
|
|
931
|
-
files: body.files
|
|
935
|
+
files: body.files,
|
|
936
|
+
reason
|
|
932
937
|
});
|
|
933
938
|
},
|
|
934
|
-
async createInvite (channelId, body = {}) {
|
|
939
|
+
async createInvite (channelId, body = {}, reason) {
|
|
935
940
|
return await rest.post(rest.routes.channels.invites(channelId), {
|
|
936
|
-
body
|
|
941
|
+
body,
|
|
942
|
+
reason
|
|
937
943
|
});
|
|
938
944
|
},
|
|
939
945
|
async createRole (guildId, body, reason) {
|
|
@@ -942,14 +948,16 @@ export function createRestManager(options) {
|
|
|
942
948
|
reason
|
|
943
949
|
});
|
|
944
950
|
},
|
|
945
|
-
async createScheduledEvent (guildId, body) {
|
|
951
|
+
async createScheduledEvent (guildId, body, reason) {
|
|
946
952
|
return await rest.post(rest.routes.guilds.events.events(guildId), {
|
|
947
|
-
body
|
|
953
|
+
body,
|
|
954
|
+
reason
|
|
948
955
|
});
|
|
949
956
|
},
|
|
950
|
-
async createStageInstance (body) {
|
|
957
|
+
async createStageInstance (body, reason) {
|
|
951
958
|
return await rest.post(rest.routes.channels.stages(), {
|
|
952
|
-
body
|
|
959
|
+
body,
|
|
960
|
+
reason
|
|
953
961
|
});
|
|
954
962
|
},
|
|
955
963
|
async createWebhook (channelId, options, reason) {
|
|
@@ -1001,8 +1009,10 @@ export function createRestManager(options) {
|
|
|
1001
1009
|
async deleteGuildTemplate (guildId, templateCode) {
|
|
1002
1010
|
await rest.delete(rest.routes.guilds.templates.guild(guildId, templateCode));
|
|
1003
1011
|
},
|
|
1004
|
-
async deleteIntegration (guildId, integrationId) {
|
|
1005
|
-
await rest.delete(rest.routes.guilds.integration(guildId, integrationId)
|
|
1012
|
+
async deleteIntegration (guildId, integrationId, reason) {
|
|
1013
|
+
await rest.delete(rest.routes.guilds.integration(guildId, integrationId), {
|
|
1014
|
+
reason
|
|
1015
|
+
});
|
|
1006
1016
|
},
|
|
1007
1017
|
async deleteInvite (inviteCode, reason) {
|
|
1008
1018
|
await rest.delete(rest.routes.guilds.invite(inviteCode), {
|
|
@@ -1036,8 +1046,10 @@ export function createRestManager(options) {
|
|
|
1036
1046
|
reaction = processReactionString(reaction);
|
|
1037
1047
|
await rest.delete(rest.routes.channels.reactions.emoji(channelId, messageId, reaction));
|
|
1038
1048
|
},
|
|
1039
|
-
async deleteRole (guildId, roleId) {
|
|
1040
|
-
await rest.delete(rest.routes.guilds.roles.one(guildId, roleId)
|
|
1049
|
+
async deleteRole (guildId, roleId, reason) {
|
|
1050
|
+
await rest.delete(rest.routes.guilds.roles.one(guildId, roleId), {
|
|
1051
|
+
reason
|
|
1052
|
+
});
|
|
1041
1053
|
},
|
|
1042
1054
|
async deleteScheduledEvent (guildId, eventId) {
|
|
1043
1055
|
await rest.delete(rest.routes.guilds.events.event(guildId, eventId));
|
|
@@ -1072,9 +1084,10 @@ export function createRestManager(options) {
|
|
|
1072
1084
|
}
|
|
1073
1085
|
});
|
|
1074
1086
|
},
|
|
1075
|
-
async editAutomodRule (guildId, ruleId, body) {
|
|
1087
|
+
async editAutomodRule (guildId, ruleId, body, reason) {
|
|
1076
1088
|
return await rest.patch(rest.routes.guilds.automod.rule(guildId, ruleId), {
|
|
1077
|
-
body
|
|
1089
|
+
body,
|
|
1090
|
+
reason
|
|
1078
1091
|
});
|
|
1079
1092
|
},
|
|
1080
1093
|
async editBotProfile (options) {
|
|
@@ -1086,14 +1099,16 @@ export function createRestManager(options) {
|
|
|
1086
1099
|
}
|
|
1087
1100
|
});
|
|
1088
1101
|
},
|
|
1089
|
-
async editChannel (channelId, body) {
|
|
1102
|
+
async editChannel (channelId, body, reason) {
|
|
1090
1103
|
return await rest.patch(rest.routes.channels.channel(channelId), {
|
|
1091
|
-
body
|
|
1104
|
+
body,
|
|
1105
|
+
reason
|
|
1092
1106
|
});
|
|
1093
1107
|
},
|
|
1094
|
-
async editChannelPermissionOverrides (channelId, body) {
|
|
1108
|
+
async editChannelPermissionOverrides (channelId, body, reason) {
|
|
1095
1109
|
await rest.put(rest.routes.channels.overwrite(channelId, body.id), {
|
|
1096
|
-
body
|
|
1110
|
+
body,
|
|
1111
|
+
reason
|
|
1097
1112
|
});
|
|
1098
1113
|
},
|
|
1099
1114
|
async editChannelPositions (guildId, body) {
|
|
@@ -1101,9 +1116,10 @@ export function createRestManager(options) {
|
|
|
1101
1116
|
body
|
|
1102
1117
|
});
|
|
1103
1118
|
},
|
|
1104
|
-
async editEmoji (guildId, id, body) {
|
|
1119
|
+
async editEmoji (guildId, id, body, reason) {
|
|
1105
1120
|
return await rest.patch(rest.routes.guilds.emoji(guildId, id), {
|
|
1106
|
-
body
|
|
1121
|
+
body,
|
|
1122
|
+
reason
|
|
1107
1123
|
});
|
|
1108
1124
|
},
|
|
1109
1125
|
async editFollowupMessage (token, messageId, body) {
|
|
@@ -1117,9 +1133,10 @@ export function createRestManager(options) {
|
|
|
1117
1133
|
body
|
|
1118
1134
|
});
|
|
1119
1135
|
},
|
|
1120
|
-
async editGuild (guildId, body) {
|
|
1136
|
+
async editGuild (guildId, body, reason) {
|
|
1121
1137
|
return await rest.patch(rest.routes.guilds.guild(guildId), {
|
|
1122
|
-
body
|
|
1138
|
+
body,
|
|
1139
|
+
reason
|
|
1123
1140
|
});
|
|
1124
1141
|
},
|
|
1125
1142
|
async editGuildApplicationCommand (commandId, guildId, body) {
|
|
@@ -1135,9 +1152,10 @@ export function createRestManager(options) {
|
|
|
1135
1152
|
reason
|
|
1136
1153
|
});
|
|
1137
1154
|
},
|
|
1138
|
-
async editGuildSticker (guildId, stickerId, body) {
|
|
1155
|
+
async editGuildSticker (guildId, stickerId, body, reason) {
|
|
1139
1156
|
return await rest.patch(rest.routes.guilds.sticker(guildId, stickerId), {
|
|
1140
|
-
body
|
|
1157
|
+
body,
|
|
1158
|
+
reason
|
|
1141
1159
|
});
|
|
1142
1160
|
},
|
|
1143
1161
|
async editGuildTemplate (guildId, templateCode, body) {
|
|
@@ -1173,19 +1191,22 @@ export function createRestManager(options) {
|
|
|
1173
1191
|
}
|
|
1174
1192
|
});
|
|
1175
1193
|
},
|
|
1176
|
-
async editScheduledEvent (guildId, eventId, body) {
|
|
1194
|
+
async editScheduledEvent (guildId, eventId, body, reason) {
|
|
1177
1195
|
return await rest.patch(rest.routes.guilds.events.event(guildId, eventId), {
|
|
1178
|
-
body
|
|
1196
|
+
body,
|
|
1197
|
+
reason
|
|
1179
1198
|
});
|
|
1180
1199
|
},
|
|
1181
|
-
async editRole (guildId, roleId, body) {
|
|
1200
|
+
async editRole (guildId, roleId, body, reason) {
|
|
1182
1201
|
return await rest.patch(rest.routes.guilds.roles.one(guildId, roleId), {
|
|
1183
|
-
body
|
|
1202
|
+
body,
|
|
1203
|
+
reason
|
|
1184
1204
|
});
|
|
1185
1205
|
},
|
|
1186
|
-
async editRolePositions (guildId, body) {
|
|
1206
|
+
async editRolePositions (guildId, body, reason) {
|
|
1187
1207
|
return await rest.patch(rest.routes.guilds.roles.all(guildId), {
|
|
1188
|
-
body
|
|
1208
|
+
body,
|
|
1209
|
+
reason
|
|
1189
1210
|
});
|
|
1190
1211
|
},
|
|
1191
1212
|
async editStageInstance (channelId, topic, reason) {
|
|
@@ -1201,9 +1222,10 @@ export function createRestManager(options) {
|
|
|
1201
1222
|
body: options
|
|
1202
1223
|
});
|
|
1203
1224
|
},
|
|
1204
|
-
async editWebhook (webhookId, body) {
|
|
1225
|
+
async editWebhook (webhookId, body, reason) {
|
|
1205
1226
|
return await rest.patch(rest.routes.webhooks.id(webhookId), {
|
|
1206
|
-
body
|
|
1227
|
+
body,
|
|
1228
|
+
reason
|
|
1207
1229
|
});
|
|
1208
1230
|
},
|
|
1209
1231
|
async editWebhookMessage (webhookId, token, messageId, options) {
|
|
@@ -1217,14 +1239,16 @@ export function createRestManager(options) {
|
|
|
1217
1239
|
body
|
|
1218
1240
|
});
|
|
1219
1241
|
},
|
|
1220
|
-
async editWelcomeScreen (guildId, body) {
|
|
1242
|
+
async editWelcomeScreen (guildId, body, reason) {
|
|
1221
1243
|
return await rest.patch(rest.routes.guilds.welcome(guildId), {
|
|
1222
|
-
body
|
|
1244
|
+
body,
|
|
1245
|
+
reason
|
|
1223
1246
|
});
|
|
1224
1247
|
},
|
|
1225
|
-
async editWidgetSettings (guildId, body) {
|
|
1248
|
+
async editWidgetSettings (guildId, body, reason) {
|
|
1226
1249
|
return await rest.patch(rest.routes.guilds.widget(guildId), {
|
|
1227
|
-
body
|
|
1250
|
+
body,
|
|
1251
|
+
reason
|
|
1228
1252
|
});
|
|
1229
1253
|
},
|
|
1230
1254
|
async executeWebhook (webhookId, token, options) {
|
|
@@ -1497,32 +1521,37 @@ export function createRestManager(options) {
|
|
|
1497
1521
|
files: body.files
|
|
1498
1522
|
});
|
|
1499
1523
|
},
|
|
1500
|
-
async startThreadWithMessage (channelId, messageId, body) {
|
|
1524
|
+
async startThreadWithMessage (channelId, messageId, body, reason) {
|
|
1501
1525
|
return await rest.post(rest.routes.channels.threads.message(channelId, messageId), {
|
|
1502
|
-
body
|
|
1526
|
+
body,
|
|
1527
|
+
reason
|
|
1503
1528
|
});
|
|
1504
1529
|
},
|
|
1505
|
-
async startThreadWithoutMessage (channelId, body) {
|
|
1530
|
+
async startThreadWithoutMessage (channelId, body, reason) {
|
|
1506
1531
|
return await rest.post(rest.routes.channels.threads.all(channelId), {
|
|
1507
|
-
body
|
|
1532
|
+
body,
|
|
1533
|
+
reason
|
|
1508
1534
|
});
|
|
1509
1535
|
},
|
|
1510
1536
|
async syncGuildTemplate (guildId) {
|
|
1511
1537
|
return await rest.put(rest.routes.guilds.templates.all(guildId));
|
|
1512
1538
|
},
|
|
1513
|
-
async banMember (guildId, userId, body) {
|
|
1539
|
+
async banMember (guildId, userId, body, reason) {
|
|
1514
1540
|
await rest.put(rest.routes.guilds.members.ban(guildId, userId), {
|
|
1515
|
-
body
|
|
1541
|
+
body,
|
|
1542
|
+
reason
|
|
1516
1543
|
});
|
|
1517
1544
|
},
|
|
1518
|
-
async editBotMember (guildId, body) {
|
|
1545
|
+
async editBotMember (guildId, body, reason) {
|
|
1519
1546
|
return await rest.patch(rest.routes.guilds.members.bot(guildId), {
|
|
1520
|
-
body
|
|
1547
|
+
body,
|
|
1548
|
+
reason
|
|
1521
1549
|
});
|
|
1522
1550
|
},
|
|
1523
|
-
async editMember (guildId, userId, body) {
|
|
1551
|
+
async editMember (guildId, userId, body, reason) {
|
|
1524
1552
|
return await rest.patch(rest.routes.guilds.members.member(guildId, userId), {
|
|
1525
|
-
body
|
|
1553
|
+
body,
|
|
1554
|
+
reason
|
|
1526
1555
|
});
|
|
1527
1556
|
},
|
|
1528
1557
|
async getMember (guildId, userId) {
|
|
@@ -1541,16 +1570,19 @@ export function createRestManager(options) {
|
|
|
1541
1570
|
reason
|
|
1542
1571
|
});
|
|
1543
1572
|
},
|
|
1544
|
-
async pruneMembers (guildId, body) {
|
|
1573
|
+
async pruneMembers (guildId, body, reason) {
|
|
1545
1574
|
return await rest.post(rest.routes.guilds.members.prune(guildId), {
|
|
1546
|
-
body
|
|
1575
|
+
body,
|
|
1576
|
+
reason
|
|
1547
1577
|
});
|
|
1548
1578
|
},
|
|
1549
1579
|
async searchMembers (guildId, query, options) {
|
|
1550
1580
|
return await rest.get(rest.routes.guilds.members.search(guildId, query, options));
|
|
1551
1581
|
},
|
|
1552
|
-
async unbanMember (guildId, userId) {
|
|
1553
|
-
await rest.delete(rest.routes.guilds.members.ban(guildId, userId)
|
|
1582
|
+
async unbanMember (guildId, userId, reason) {
|
|
1583
|
+
await rest.delete(rest.routes.guilds.members.ban(guildId, userId), {
|
|
1584
|
+
reason
|
|
1585
|
+
});
|
|
1554
1586
|
},
|
|
1555
1587
|
async unpinMessage (channelId, messageId, reason) {
|
|
1556
1588
|
await rest.delete(rest.routes.channels.pin(channelId, messageId), {
|