@@ -8,6 +8,7 @@ import type { Command, ExecutableSubcommand } from "djs-slash-helper";
88import { moduleManager } from "../../index.js" ;
99import { logger } from "../../logging.js" ;
1010import { FAQ } from "../../store/models/FAQ.js" ;
11+ import { EPHEMERAL_FLAG } from "../../util/message.js" ;
1112import createFaqModal from "./faq.modal.js" ;
1213import { createFaqEmbed } from "./faq.util.js" ;
1314
@@ -45,7 +46,7 @@ const GetSubcommand: ExecutableSubcommand = {
4546 } ) ;
4647 if ( faq == null ) {
4748 return await interaction . reply ( {
48- flags : [ "Ephemeral" ] ,
49+ flags : EPHEMERAL_FLAG ,
4950 content : "No FAQ found with this name" ,
5051 } ) ;
5152 }
@@ -69,14 +70,14 @@ const EditSubcommand: ExecutableSubcommand = {
6970 const member = interaction . member as GuildMember ;
7071 if ( ! member . permissions . has ( PermissionFlagsBits . ManageMessages ) ) {
7172 return await interaction . reply ( {
72- flags : [ "Ephemeral" ] ,
73+ flags : EPHEMERAL_FLAG ,
7374 content : "No permission" ,
7475 } ) ;
7576 }
7677 const name = interaction . options . get ( "name" ) ?. value as string | null ;
7778 if ( name == null ) {
7879 return await interaction . reply ( {
79- flags : [ "Ephemeral" ] ,
80+ flags : EPHEMERAL_FLAG ,
8081 content : "No FAQ name provided" ,
8182 } ) ;
8283 }
@@ -97,7 +98,7 @@ const EditSubcommand: ExecutableSubcommand = {
9798 author : BigInt ( interaction . user . id ) ,
9899 } ) ;
99100 await response . reply ( {
100- flags : [ "Ephemeral" ] ,
101+ flags : EPHEMERAL_FLAG ,
101102 content : `FAQ named ${ name } created` ,
102103 } ) ;
103104
@@ -123,30 +124,30 @@ const DeleteSubcommand: ExecutableSubcommand = {
123124 const member = interaction . member as GuildMember ;
124125 if ( ! member . permissions . has ( PermissionFlagsBits . ManageMessages ) ) {
125126 return await interaction . reply ( {
126- flags : [ "Ephemeral" ] ,
127+ flags : EPHEMERAL_FLAG ,
127128 content : "No permission" ,
128129 } ) ;
129130 }
130131 const name = interaction . options . get ( "name" ) ?. value as string | null ;
131132 if ( name == null ) {
132133 return await interaction . reply ( {
133- flags : [ "Ephemeral" ] ,
134+ flags : EPHEMERAL_FLAG ,
134135 content : "No FAQ name provided" ,
135136 } ) ;
136137 }
137138
138139 const faq = await FAQ . findOne ( { where : { name } } ) ;
139140 if ( faq == null ) {
140141 return await interaction . reply ( {
141- flags : [ "Ephemeral" ] ,
142+ flags : EPHEMERAL_FLAG ,
142143 content : "No FAQ found with this name" ,
143144 } ) ;
144145 }
145146 await faq . destroy ( ) ;
146147 await updateChoices ( ) ;
147148 await moduleManager . refreshCommands ( ) ;
148149 return await interaction . reply ( {
149- flags : [ "Ephemeral" ] ,
150+ flags : EPHEMERAL_FLAG ,
150151 content : `FAQ named ${ name } deleted` ,
151152 } ) ;
152153 } ,
0 commit comments