Skip to content

Commit

Permalink
🐛 Fix thread variables missing
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusOtter committed Mar 29, 2023
1 parent 4a44980 commit f30124a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/ThreadCreationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ export default class InformationService {
const rawReplyMessageContent = useDefaultMessage
? guildConfig.settings.SuccessThreadCreated
: channelConfig.customReply;
const replyMessageContent = await messageVariables.replace(rawReplyMessageContent);
const botPermissions = botMember.permissionsIn(message.channel.id);
const requiredPermissions = getRequiredPermissions(channelConfig.slowmode, replyMessageContent);
const requiredPermissions = getRequiredPermissions(channelConfig.slowmode, rawReplyMessageContent);
if (!botPermissions.has(requiredPermissions)) {
const missing = botPermissions.missing(requiredPermissions);
const errorMessage = `Missing ${plural("permission", missing.length)}:`;
Expand All @@ -97,6 +96,7 @@ export default class InformationService {
await tryReact(message, guildConfig.settings.EmojiUnanswered);
}

const replyMessageContent = await messageVariables.replace(rawReplyMessageContent);
if (replyMessageContent.trim().length > 0) {
const buttonRow = await this.getButtonRow(channelConfig, messageVariables);
const msg = await thread.send({
Expand Down

0 comments on commit f30124a

Please sign in to comment.