1
- import { ApplicationIntegrationType , EmbedBuilder , InteractionContextType , PermissionFlagsBits , PermissionsBitField , SlashCommandBuilder } from "discord.js" ;
1
+ import { ApplicationIntegrationType , EmbedBuilder , InteractionContextType , MessageFlags , PermissionFlagsBits , PermissionsBitField , SlashCommandBuilder } from "discord.js" ;
2
2
import { t } from "i18next" ;
3
3
4
4
import { command } from "../typings/command.js" ;
@@ -19,23 +19,23 @@ export const c: command = {
19
19
const game = client . games . find ( g => g . channelId === interaction . channelId ) ;
20
20
if ( ! config . developerIds . includes ( interaction . user . id ) && ( interaction . member . permissions as PermissionsBitField ) . has ( PermissionFlagsBits . ManageMessages ) ) return interaction . reply ( {
21
21
content : "nuh uh ☝️" ,
22
- ephemeral : true
22
+ flags : MessageFlags . Ephemeral
23
23
} ) ;
24
24
if ( ! game ) return interaction . reply ( {
25
25
content : t ( "strings:errors.gameNotFound" , { lng } ) ,
26
- ephemeral : true
26
+ flags : MessageFlags . Ephemeral
27
27
} ) ;
28
28
if ( game . state !== "waiting" ) return interaction . reply ( {
29
29
content : t ( "strings:errors.inProgress" , { lng } ) ,
30
- ephemeral : true
30
+ flags : MessageFlags . Ephemeral
31
31
} ) ;
32
32
const member = interaction . guild ?. members . cache . get ( interaction . user . id ) ;
33
33
if ( ! member || ! member . permissions . has ( PermissionFlagsBits . ManageMessages ) && ! config . developerIds . includes ( interaction . user . id ) ) return interaction . reply ( {
34
34
content : t ( "strings:errors.forbidden" , { lng } ) ,
35
- ephemeral : true
35
+ flags : MessageFlags . Ephemeral
36
36
} ) ;
37
37
await interaction . deferReply ( {
38
- ephemeral : true
38
+ flags : MessageFlags . Ephemeral
39
39
} ) ;
40
40
const msg = interaction . channel ?. messages . cache . get ( game . messageId ) ;
41
41
if ( msg ) await msg . delete ( ) ;
0 commit comments