@@ -2,12 +2,14 @@ import {
22 ApplicationCommandOptionType ,
33 ApplicationCommandType ,
44 type GuildMember ,
5+ MessageFlags ,
56 PermissionFlagsBits ,
67} from "discord.js" ;
78import type { Command , ExecutableSubcommand } from "djs-slash-helper" ;
89import { moduleManager } from "../../index.js" ;
910import { logger } from "../../logging.js" ;
1011import { FAQ } from "../../store/models/FAQ.js" ;
12+
1113import createFaqModal from "./faq.modal.js" ;
1214import { createFaqEmbed } from "./faq.util.js" ;
1315
@@ -45,7 +47,7 @@ const GetSubcommand: ExecutableSubcommand = {
4547 } ) ;
4648 if ( faq == null ) {
4749 return await interaction . reply ( {
48- flags : [ " Ephemeral" ] ,
50+ flags : MessageFlags . Ephemeral ,
4951 content : "No FAQ found with this name" ,
5052 } ) ;
5153 }
@@ -69,14 +71,14 @@ const EditSubcommand: ExecutableSubcommand = {
6971 const member = interaction . member as GuildMember ;
7072 if ( ! member . permissions . has ( PermissionFlagsBits . ManageMessages ) ) {
7173 return await interaction . reply ( {
72- flags : [ " Ephemeral" ] ,
74+ flags : MessageFlags . Ephemeral ,
7375 content : "No permission" ,
7476 } ) ;
7577 }
7678 const name = interaction . options . get ( "name" ) ?. value as string | null ;
7779 if ( name == null ) {
7880 return await interaction . reply ( {
79- flags : [ " Ephemeral" ] ,
81+ flags : MessageFlags . Ephemeral ,
8082 content : "No FAQ name provided" ,
8183 } ) ;
8284 }
@@ -97,7 +99,7 @@ const EditSubcommand: ExecutableSubcommand = {
9799 author : BigInt ( interaction . user . id ) ,
98100 } ) ;
99101 await response . reply ( {
100- flags : [ " Ephemeral" ] ,
102+ flags : MessageFlags . Ephemeral ,
101103 content : `FAQ named ${ name } created` ,
102104 } ) ;
103105
@@ -123,30 +125,30 @@ const DeleteSubcommand: ExecutableSubcommand = {
123125 const member = interaction . member as GuildMember ;
124126 if ( ! member . permissions . has ( PermissionFlagsBits . ManageMessages ) ) {
125127 return await interaction . reply ( {
126- flags : [ " Ephemeral" ] ,
128+ flags : MessageFlags . Ephemeral ,
127129 content : "No permission" ,
128130 } ) ;
129131 }
130132 const name = interaction . options . get ( "name" ) ?. value as string | null ;
131133 if ( name == null ) {
132134 return await interaction . reply ( {
133- flags : [ " Ephemeral" ] ,
135+ flags : MessageFlags . Ephemeral ,
134136 content : "No FAQ name provided" ,
135137 } ) ;
136138 }
137139
138140 const faq = await FAQ . findOne ( { where : { name } } ) ;
139141 if ( faq == null ) {
140142 return await interaction . reply ( {
141- flags : [ " Ephemeral" ] ,
143+ flags : MessageFlags . Ephemeral ,
142144 content : "No FAQ found with this name" ,
143145 } ) ;
144146 }
145147 await faq . destroy ( ) ;
146148 await updateChoices ( ) ;
147149 await moduleManager . refreshCommands ( ) ;
148150 return await interaction . reply ( {
149- flags : [ " Ephemeral" ] ,
151+ flags : MessageFlags . Ephemeral ,
150152 content : `FAQ named ${ name } deleted` ,
151153 } ) ;
152154 } ,
0 commit comments