Skip to content

Commit 782b33d

Browse files
authored
back-ported type fixes from TypeScript port (#682)
* type fixes in bot instance * fix dAPI version prop type * fix crash due to missing import * fix MessageContextMenuWrapper builder having wrong type enum
1 parent 0410868 commit 782b33d

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

source/frontend/classes/InteractionWrapper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class MessageContextMenuWrapper extends ContextMenuWrapper {
111111
*/
112112
constructor(mainIdInput, defaultMemberPermission, isPremiumCommand, contextEnums, cooldownInMS, executeFunction) {
113113
super(mainIdInput, defaultMemberPermission, isPremiumCommand, contextEnums, cooldownInMS, executeFunction);
114-
this.builder = this.builder.setType(ApplicationCommandType.User);
114+
this.builder = this.builder.setType(ApplicationCommandType.Message);
115115
}
116116
};
117117

source/frontend/context_menus/_contextMenuDictionary.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { ContextMenuWrapper } = require("../classes");
1+
const { ContextMenuWrapper, BuildError } = require("../classes");
22

33
/** @type {string[]} */
44
exports.contextMenuFiles = [
@@ -44,4 +44,4 @@ exports.updatePremiumList = function(list) {
4444
list.push(commandKey);
4545
}
4646
}
47-
}
47+
}

source/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ const dbConnection = new Sequelize(require(__dirname + '/../config/config.json')
5050
const models = {};
5151

5252
const dAPIClient = new Client({
53-
retryLimit: 5,
5453
presence: {
5554
activities: [{
5655
type: ActivityType.Custom,
@@ -110,7 +109,7 @@ dAPIClient.on(Events.ClientReady, () => {
110109
if (runMode === "production") {
111110
(() => {
112111
try {
113-
new REST({ version: 10 }).setToken(require(authPath).token).put(
112+
new REST({ version: "10" }).setToken(require(authPath).token).put(
114113
Routes.applicationCommands(dAPIClient.user.id),
115114
{ body: [...slashData, ...contextMenuData] }
116115
).then(commands => {
@@ -133,7 +132,7 @@ dAPIClient.on(Events.ClientReady, () => {
133132
return;
134133
}
135134

136-
latestVersionChangesEmbed(dAPIClient.user.displayAvatarURL()).then(embed => {
135+
latestVersionChangesEmbed().then(embed => {
137136
dAPIClient.guilds.fetch(testGuildId).then(guild => {
138137
guild.channels.fetch(announcementsChannelId).then(announcementsChannel => {
139138
announcementsChannel.send({ embeds: [embed] }).then(message => {

0 commit comments

Comments
 (0)