@@ -2,13 +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" ;
11- import { EPHEMERAL_FLAG } from "../../util/message.js" ;
12+
1213import createFaqModal from "./faq.modal.js" ;
1314import { createFaqEmbed } from "./faq.util.js" ;
1415
@@ -46,7 +47,7 @@ const GetSubcommand: ExecutableSubcommand = {
4647 } ) ;
4748 if ( faq == null ) {
4849 return await interaction . reply ( {
49- flags : EPHEMERAL_FLAG ,
50+ flags : MessageFlags . Ephemeral ,
5051 content : "No FAQ found with this name" ,
5152 } ) ;
5253 }
@@ -70,14 +71,14 @@ const EditSubcommand: ExecutableSubcommand = {
7071 const member = interaction . member as GuildMember ;
7172 if ( ! member . permissions . has ( PermissionFlagsBits . ManageMessages ) ) {
7273 return await interaction . reply ( {
73- flags : EPHEMERAL_FLAG ,
74+ flags : MessageFlags . Ephemeral ,
7475 content : "No permission" ,
7576 } ) ;
7677 }
7778 const name = interaction . options . get ( "name" ) ?. value as string | null ;
7879 if ( name == null ) {
7980 return await interaction . reply ( {
80- flags : EPHEMERAL_FLAG ,
81+ flags : MessageFlags . Ephemeral ,
8182 content : "No FAQ name provided" ,
8283 } ) ;
8384 }
@@ -98,7 +99,7 @@ const EditSubcommand: ExecutableSubcommand = {
9899 author : BigInt ( interaction . user . id ) ,
99100 } ) ;
100101 await response . reply ( {
101- flags : EPHEMERAL_FLAG ,
102+ flags : MessageFlags . Ephemeral ,
102103 content : `FAQ named ${ name } created` ,
103104 } ) ;
104105
@@ -124,30 +125,30 @@ const DeleteSubcommand: ExecutableSubcommand = {
124125 const member = interaction . member as GuildMember ;
125126 if ( ! member . permissions . has ( PermissionFlagsBits . ManageMessages ) ) {
126127 return await interaction . reply ( {
127- flags : EPHEMERAL_FLAG ,
128+ flags : MessageFlags . Ephemeral ,
128129 content : "No permission" ,
129130 } ) ;
130131 }
131132 const name = interaction . options . get ( "name" ) ?. value as string | null ;
132133 if ( name == null ) {
133134 return await interaction . reply ( {
134- flags : EPHEMERAL_FLAG ,
135+ flags : MessageFlags . Ephemeral ,
135136 content : "No FAQ name provided" ,
136137 } ) ;
137138 }
138139
139140 const faq = await FAQ . findOne ( { where : { name } } ) ;
140141 if ( faq == null ) {
141142 return await interaction . reply ( {
142- flags : EPHEMERAL_FLAG ,
143+ flags : MessageFlags . Ephemeral ,
143144 content : "No FAQ found with this name" ,
144145 } ) ;
145146 }
146147 await faq . destroy ( ) ;
147148 await updateChoices ( ) ;
148149 await moduleManager . refreshCommands ( ) ;
149150 return await interaction . reply ( {
150- flags : EPHEMERAL_FLAG ,
151+ flags : MessageFlags . Ephemeral ,
151152 content : `FAQ named ${ name } deleted` ,
152153 } ) ;
153154 } ,
0 commit comments