44 PermissionFlagsBits ,
55 EmbedBuilder ,
66 ChannelType ,
7+ MessageFlags ,
78} from "discord.js" ;
89import { InterServerChat } from "../utils/interServerChat.js" ;
910
@@ -94,15 +95,15 @@ export async function execute(
9495 if ( ! interaction . guild || ! interaction . channel ) {
9596 await interaction . reply ( {
9697 content : "This command can only be used in a server channel." ,
97- ephemeral : true ,
98+ flags : MessageFlags . Ephemeral ,
9899 } ) ;
99100 return ;
100101 }
101102
102103 if ( interaction . channel . type !== ChannelType . GuildText ) {
103104 await interaction . reply ( {
104105 content : "Interserver chat only supports text channels." ,
105- ephemeral : true ,
106+ flags : MessageFlags . Ephemeral ,
106107 } ) ;
107108 return ;
108109 }
@@ -114,7 +115,7 @@ export async function execute(
114115 if ( existing ) {
115116 await interaction . reply ( {
116117 content : `❌ A pool named "**${ name } **" already exists.` ,
117- ephemeral : true ,
118+ flags : MessageFlags . Ephemeral ,
118119 } ) ;
119120 return ;
120121 }
@@ -130,7 +131,7 @@ export async function execute(
130131 )
131132 . setColor ( "#00FF00" ) ;
132133
133- await interaction . reply ( { embeds : [ embed ] } ) ;
134+ await interaction . reply ( { embeds : [ embed ] , flags : MessageFlags . Ephemeral } ) ;
134135 } else if ( subcommand === "join" ) {
135136 const poolIdentifier = interaction . options . getString ( "pool" , true ) ;
136137
@@ -142,7 +143,7 @@ export async function execute(
142143 if ( ! pool ) {
143144 await interaction . reply ( {
144145 content : `❌ Pool "**${ poolIdentifier } **" not found.` ,
145- ephemeral : true ,
146+ flags : MessageFlags . Ephemeral ,
146147 } ) ;
147148 return ;
148149 }
@@ -162,12 +163,15 @@ export async function execute(
162163 )
163164 . setColor ( "#00FF00" ) ;
164165
165- await interaction . reply ( { embeds : [ embed ] } ) ;
166+ await interaction . reply ( {
167+ embeds : [ embed ] ,
168+ flags : MessageFlags . Ephemeral ,
169+ } ) ;
166170 } else {
167171 await interaction . reply ( {
168172 content :
169173 "❌ Failed to join pool. This channel might already be in a pool." ,
170- ephemeral : true ,
174+ flags : MessageFlags . Ephemeral ,
171175 } ) ;
172176 }
173177 } else if ( subcommand === "leave" ) {
@@ -176,7 +180,7 @@ export async function execute(
176180 if ( ! pool ) {
177181 await interaction . reply ( {
178182 content : "❌ This channel is not in any chat pool." ,
179- ephemeral : true ,
183+ flags : MessageFlags . Ephemeral ,
180184 } ) ;
181185 return ;
182186 }
@@ -189,11 +193,12 @@ export async function execute(
189193 if ( success ) {
190194 await interaction . reply ( {
191195 content : `✅ This channel has been disconnected from pool "**${ pool . name } **".` ,
196+ flags : MessageFlags . Ephemeral ,
192197 } ) ;
193198 } else {
194199 await interaction . reply ( {
195200 content : "❌ Failed to disconnect channel from pool." ,
196- ephemeral : true ,
201+ flags : MessageFlags . Ephemeral ,
197202 } ) ;
198203 }
199204 } else if ( subcommand === "list" ) {
@@ -203,7 +208,7 @@ export async function execute(
203208 await interaction . reply ( {
204209 content :
205210 "ℹ️ No chat pools exist yet. Create one with `/interchat create`." ,
206- ephemeral : true ,
211+ flags : MessageFlags . Ephemeral ,
207212 } ) ;
208213 return ;
209214 }
@@ -223,7 +228,7 @@ export async function execute(
223228 )
224229 . setColor ( "#0099FF" ) ;
225230
226- await interaction . reply ( { embeds : [ embed ] , ephemeral : true } ) ;
231+ await interaction . reply ( { embeds : [ embed ] , flags : MessageFlags . Ephemeral } ) ;
227232 } else if ( subcommand === "info" ) {
228233 const poolIdentifier = interaction . options . getString ( "pool" , true ) ;
229234
@@ -235,7 +240,7 @@ export async function execute(
235240 if ( ! pool ) {
236241 await interaction . reply ( {
237242 content : `❌ Pool "**${ poolIdentifier } **" not found.` ,
238- ephemeral : true ,
243+ flags : MessageFlags . Ephemeral ,
239244 } ) ;
240245 return ;
241246 }
@@ -272,7 +277,7 @@ export async function execute(
272277 )
273278 . setColor ( "#0099FF" ) ;
274279
275- await interaction . reply ( { embeds : [ embed ] , ephemeral : true } ) ;
280+ await interaction . reply ( { embeds : [ embed ] , flags : MessageFlags . Ephemeral } ) ;
276281 } else if ( subcommand === "rename" ) {
277282 const poolIdentifier = interaction . options . getString ( "pool" , true ) ;
278283 const newName = interaction . options . getString ( "newname" , true ) ;
@@ -285,7 +290,7 @@ export async function execute(
285290 if ( ! pool ) {
286291 await interaction . reply ( {
287292 content : `❌ Pool "**${ poolIdentifier } **" not found.` ,
288- ephemeral : true ,
293+ flags : MessageFlags . Ephemeral ,
289294 } ) ;
290295 return ;
291296 }
@@ -294,7 +299,7 @@ export async function execute(
294299 if ( existing && existing . id !== pool . id ) {
295300 await interaction . reply ( {
296301 content : `❌ A pool named "**${ newName } **" already exists.` ,
297- ephemeral : true ,
302+ flags : MessageFlags . Ephemeral ,
298303 } ) ;
299304 return ;
300305 }
@@ -304,11 +309,12 @@ export async function execute(
304309 if ( success ) {
305310 await interaction . reply ( {
306311 content : `✅ Pool renamed from "**${ pool . name } **" to "**${ newName } **".` ,
312+ flags : MessageFlags . Ephemeral ,
307313 } ) ;
308314 } else {
309315 await interaction . reply ( {
310316 content : "❌ Failed to rename pool." ,
311- ephemeral : true ,
317+ flags : MessageFlags . Ephemeral ,
312318 } ) ;
313319 }
314320 } else if ( subcommand === "delete" ) {
@@ -322,7 +328,7 @@ export async function execute(
322328 if ( ! pool ) {
323329 await interaction . reply ( {
324330 content : `❌ Pool "**${ poolIdentifier } **" not found.` ,
325- ephemeral : true ,
331+ flags : MessageFlags . Ephemeral ,
326332 } ) ;
327333 return ;
328334 }
@@ -332,11 +338,12 @@ export async function execute(
332338 if ( success ) {
333339 await interaction . reply ( {
334340 content : `✅ Pool "**${ pool . name } **" has been deleted. All channels have been disconnected.` ,
341+ flags : MessageFlags . Ephemeral ,
335342 } ) ;
336343 } else {
337344 await interaction . reply ( {
338345 content : "❌ Failed to delete pool." ,
339- ephemeral : true ,
346+ flags : MessageFlags . Ephemeral ,
340347 } ) ;
341348 }
342349 } else if ( subcommand === "status" ) {
@@ -347,7 +354,7 @@ export async function execute(
347354 content :
348355 "ℹ️ This channel is not connected to any chat pool.\n\n" +
349356 `Use \`/interchat join\` to join an existing pool, or \`/interchat create\` to create a new one.` ,
350- ephemeral : true ,
357+ flags : MessageFlags . Ephemeral ,
351358 } ) ;
352359 return ;
353360 }
@@ -379,6 +386,6 @@ export async function execute(
379386 } )
380387 . setColor ( "#00FF00" ) ;
381388
382- await interaction . reply ( { embeds : [ embed ] , ephemeral : true } ) ;
389+ await interaction . reply ( { embeds : [ embed ] , flags : MessageFlags . Ephemeral } ) ;
383390 }
384391}
0 commit comments