Catch for users who have paid member role

imgbot
kieranrobson 2022-05-13 12:05:12 +01:00
parent ed83daa171
commit e83a060c1f
1 changed files with 27 additions and 19 deletions

View File

@ -43,25 +43,33 @@ client.on("interactionCreate", async (interaction) => {
if(interaction.customId == "paidModal")
{
const modal = new ModalBuilder() // We create a Modal
.setCustomId('modal-paidmember')
.setTitle('Paid Member Discord Access')
.addComponents(
new ModalField()
.setLabel("Student Name")
.setStyle("short")
.setMin(1)
.setPlaceholder("Joe Bloggs")
.setCustomId("studentname"),
new ModalField()
.setLabel("Student Number")
.setStyle("short")
.setCustomId("studentnumber")
.setMin(9)
.setMin(9)
.setPlaceholder("201801122")
)
client.modal.open(interaction, modal)
if(interaction.member.roles.cache.has(`427878753008353292`))
{
await interaction.deferReply({ ephemeral: true })
interaction.followUp({ content: 'You already have the paid member role.', ephemeral: true })
}
else{
const modal = new ModalBuilder() // We create a Modal
.setCustomId('modal-paidmember')
.setTitle('Paid Member Discord Access')
.addComponents(
new ModalField()
.setLabel("Student Name")
.setStyle("short")
.setMin(1)
.setPlaceholder("Joe Bloggs")
.setCustomId("studentname"),
new ModalField()
.setLabel("Student Number")
.setStyle("short")
.setCustomId("studentnumber")
.setMin(9)
.setMin(9)
.setPlaceholder("201801122")
)
client.modal.open(interaction, modal)
}
}
if(interaction.customId == "paidmemberdelete")