Skip to content

Commit

Permalink
Merge pull request #1127 from sciencegirl100/main
Browse files Browse the repository at this point in the history
Issue #1126 fix `data` initialization error
  • Loading branch information
aiko-chan-ai committed Apr 4, 2024
2 parents 20241ad + 1cafa02 commit 5439577
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/managers/GuildForumThreadManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 5439577

Please sign in to comment.