@@ -34,7 +34,7 @@ export const isFrequency = (frequency: string): frequency is Frequency => {
34
34
35
35
export const hasPermission = ( interaction : ChatInputCommandInteraction ) => {
36
36
if ( ! isModo ( interaction . member ) ) {
37
- void interaction . reply ( 'You are not allowed to use this command' ) ;
37
+ void interaction . reply ( { content : 'You are not allowed to use this command' , ephemeral : true } ) ;
38
38
return false ;
39
39
}
40
40
return true ;
@@ -67,22 +67,20 @@ export const addRecurringMessage = async (interaction: ChatInputCommandInteracti
67
67
const channelId = interaction . channelId ;
68
68
const frequency = interaction . options . getString ( 'frequency' , true ) ;
69
69
if ( ! isFrequency ( frequency ) ) {
70
- await interaction . reply ( `${ frequency } is not a valid frequency` ) ;
70
+ await interaction . reply ( { content : `${ frequency } is not a valid frequency` , ephemeral : true } ) ;
71
71
return ;
72
72
}
73
73
const message = interaction . options . getString ( 'message' , true ) ;
74
74
75
- const displayIdInMessage = `\n (id: ${ jobId } )` ;
76
- const jobMessage = message + displayIdInMessage ;
77
-
78
- if ( jobMessage . length > MAX_MESSAGE_LENGTH ) {
79
- await interaction . reply (
80
- `Message is too long (max ${ MAX_MESSAGE_LENGTH - displayIdInMessage . length } characters)` ,
81
- ) ;
75
+ if ( message . length > MAX_MESSAGE_LENGTH ) {
76
+ await interaction . reply ( {
77
+ content : `Message is too long (max ${ MAX_MESSAGE_LENGTH } characters)` ,
78
+ ephemeral : true ,
79
+ } ) ;
82
80
return ;
83
81
}
84
82
85
- const job = createRecurringMessage ( interaction . client , channelId , frequency , jobMessage ) ;
83
+ const job = createRecurringMessage ( interaction . client , channelId , frequency , message ) ;
86
84
job . start ( ) ;
87
85
88
86
inMemoryJobList . push ( { id : jobId , job } ) ;
@@ -93,7 +91,10 @@ export const addRecurringMessage = async (interaction: ChatInputCommandInteracti
93
91
{ id : jobId , channelId, frequency, message } ,
94
92
] ) ;
95
93
96
- await interaction . reply ( `Recurring message added ${ frequencyDisplay [ frequency ] } ` ) ;
94
+ await interaction . reply ( {
95
+ content : `Recurring message added ${ frequencyDisplay [ frequency ] } ` ,
96
+ ephemeral : true ,
97
+ } ) ;
97
98
} ;
98
99
99
100
export const removeRecurringMessage = async ( interaction : ChatInputCommandInteraction ) => {
@@ -107,20 +108,20 @@ export const removeRecurringMessage = async (interaction: ChatInputCommandIntera
107
108
108
109
const job = inMemoryJobList . find ( ( { id } ) => id === jobId ) ?. job ;
109
110
if ( ! job ) {
110
- await interaction . reply ( 'Recurring message not found' ) ;
111
+ await interaction . reply ( { content : 'Recurring message not found' , ephemeral : true } ) ;
111
112
return ;
112
113
}
113
114
114
115
job . stop ( ) ;
115
116
116
- await interaction . reply ( 'Recurring message removed' ) ;
117
+ await interaction . reply ( { content : 'Recurring message removed' , ephemeral : true } ) ;
117
118
} ;
118
119
119
120
export const listRecurringMessages = async ( interaction : ChatInputCommandInteraction ) => {
120
121
const recurringMessages = await cache . get ( 'recurringMessages' , [ ] ) ;
121
122
122
123
if ( recurringMessages . length === 0 ) {
123
- await interaction . reply ( 'No recurring message found' ) ;
124
+ await interaction . reply ( { content : 'No recurring message found' , ephemeral : true } ) ;
124
125
return ;
125
126
}
126
127
@@ -159,7 +160,7 @@ export const listRecurringMessages = async (interaction: ChatInputCommandInterac
159
160
} ;
160
161
} ) ;
161
162
162
- await interaction . reply ( { embeds } ) ;
163
+ await interaction . reply ( { embeds, ephemeral : true } ) ;
163
164
} ;
164
165
165
166
export const relaunchRecurringMessages = async ( client : Client < true > ) => {
0 commit comments