Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Commit

Permalink
SayIn security update & remove message interaction check from SayInReply
Browse files Browse the repository at this point in the history
  • Loading branch information
RealEthanPlayzDev committed Feb 8, 2024
1 parent b5722b2 commit e373741
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/commands/Moderation/SayIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export const Command: MeteoriumCommand = {
const ShowExecutorName =
GuildSetting.EnforceSayInExecutor && !interaction.member.permissions.has("Administrator", true)
? true
: interaction.options.getBoolean("showexecutorname", false)
? true
: false;
: interaction.options.getBoolean("showexecutorname", false) == false
? false
: true;
const Message = ShowExecutorName
? `${interaction.options.getString("message", true)}\n\n(Sayin command executed by ${
interaction.user.tag
Expand Down
9 changes: 4 additions & 5 deletions src/contextmenu/message/SayInReply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ export const ContextMenuAction: MeteoriumMessageContextMenuAction = {

await interaction.showModal(modal);
const modalSubmitInteraction = await interaction.awaitModalSubmit({
filter: (interaction) =>
interaction.customId == "SayInReplyModal" && interaction.isMessageContextMenuCommand(),
filter: (interaction) => interaction.customId == "SayInReplyModal",
time: 60000,
});

Expand All @@ -55,9 +54,9 @@ export const ContextMenuAction: MeteoriumMessageContextMenuAction = {
const ShowExecutorName =
GuildSetting.EnforceSayInExecutor && !interaction.member.permissions.has("Administrator", true)
? true
: modalSubmitInteraction.fields.getTextInputValue("showexecutorname").toLowerCase() == "yes"
? true
: false;
: modalSubmitInteraction.fields.getTextInputValue("showexecutorname").toLowerCase() == "no"
? false
: true;

const Message = ShowExecutorName
? `${modalSubmitInteraction.fields.getTextInputValue("message")}\n\n(Sayin command executed by ${
Expand Down

0 comments on commit e373741

Please sign in to comment.