Issue #1126 fix `data` initialization error

This commit is contained in:
Elizabeth Cray 2024-04-03 22:18:43 -04:00
parent 20241ade25
commit 1cafa029f0
1 changed files with 3 additions and 3 deletions

View File

@ -85,23 +85,23 @@ class GuildForumThreadManager extends ThreadManager {
});
const attachmentsData = await Promise.all(requestPromises);
attachmentsData.sort((a, b) => parseInt(a.id) - parseInt(b.id));
data.attachments = attachmentsData;
if (autoArchiveDuration === 'MAX') autoArchiveDuration = resolveAutoArchiveMaxLimit(this.channel.guild);
const data = await this.client.api.channels(this.channel.id).threads.post({
const post_data = await this.client.api.channels(this.channel.id).threads.post({
data: {
name,
auto_archive_duration: autoArchiveDuration,
rate_limit_per_user: rateLimitPerUser,
applied_tags: appliedTags,
message: body,
attachments: attachmentsData,
},
files: [],
reason,
});
return this.client.actions.ThreadCreate.handle(data).thread;
return this.client.actions.ThreadCreate.handle(post_data).thread;
}
}