Skip to content

Commit

Permalink
Fix2
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewstech committed Jun 29, 2023
1 parent 9347b76 commit 137f274
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions commands/sendemail.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { SlashCommandBuilder, ActionRowBuilder, ModalBuilder, TextInputBuilder, T
const Maintainers = require("../models/maintainers.js");

module.exports = {
data: new SlashCommandBuilder().setName("send-email").setDescription("Maintainers send emails!").addStringOption((option) => option.setName("email").setDescription("Email to send to").setRequired(false), (option) => option.setName("subject").setDescription("Subject of email").setRequired(false)),
data: new SlashCommandBuilder().setName("send-email").setDescription("Maintainers send emails!").addStringOption((option) => option.setName("email").setDescription("Email to send to").setRequired(false)).addStringOption((option) => option.setName("subject").setDescription("Subject of email").setRequired(false)),
async execute(interaction) {
if (!(await Maintainers.findOne({ userid: interaction.user.id }))) {
// make text appear in ephemeral message
Expand All @@ -17,6 +17,7 @@ module.exports = {

// Create the text input components
let email;
let subject;
if (emailAddress) {
email = new TextInputBuilder()
.setCustomId("email")
Expand All @@ -38,15 +39,15 @@ module.exports = {

if (emailSubject) {

const subject = new TextInputBuilder()
subject = new TextInputBuilder()
.setCustomId("subject")
.setLabel("What is the email subject?")
.setValue(emailSubject)
// Paragraph means multiple lines of text.
.setStyle(TextInputStyle.Short);
}
else {
const subject = new TextInputBuilder()
subject = new TextInputBuilder()
.setCustomId("subject")
.setLabel("What is the email subject?")
// Paragraph means multiple lines of text.
Expand Down

0 comments on commit 137f274

Please sign in to comment.