@@ -22,6 +22,7 @@ import { cache } from '../../spam_filter/index.js';
2222import { MultistepForm } from '../../utils/MultistepForm.js' ;
2323import { asyncCatch } from '../../utils/asyncCatch.js' ;
2424import { createEmbed , createMarkdownCodeBlock } from '../../utils/discordTools.js' ;
25+ import { lock , unlock } from '../../utils/dmLock' ;
2526import { map } from '../../utils/map.js' ;
2627import { pipe } from '../../utils/pipe.js' ;
2728import { capitalize } from '../../utils/string.js' ;
@@ -278,12 +279,12 @@ const handleJobPostingRequest = async (
278279) : Promise < void > => {
279280 const { guild, member } = interaction ;
280281 const { user : author } = interaction ;
281- const { username, discriminator, id } = author ;
282+ const { username, discriminator, id : userID } = author ;
282283
283- const filter : CollectorFilter < [ Message ] > = m => m . author . id === id ;
284+ const filter : CollectorFilter < [ Message ] > = m => m . author . id === userID ;
284285 const send = ( str : string ) => author . send ( str ) ;
285286 // Generate cache entry
286- const entry = generateCacheEntry ( id ) ;
287+ const entry = generateCacheEntry ( userID ) ;
287288
288289 try {
289290 // Check if the user has been cached
@@ -312,10 +313,10 @@ const handleJobPostingRequest = async (
312313
313314 // Notify the user regarding the rules, and get the channel
314315 const channel = await author . createDM ( ) ;
315-
316316 const form = new MultistepForm ( questions , channel , author ) ;
317-
317+ lock ( guild . id , userID , 'JOB_POST_FORM' )
318318 const answers = ( await form . getResult ( 'guidelines' ) ) as unknown as Answers ;
319+ unlock ( guild . id , userID , 'JOB_POST_FORM' )
319320
320321 console . log ( answers )
321322 // Just return if the iteration breaks due to invalid input
@@ -326,7 +327,7 @@ const handleJobPostingRequest = async (
326327
327328 const url = await createJobPost ( answers , guild , {
328329 discriminator,
329- userID : id ,
330+ userID,
330331 username,
331332 } ) ;
332333
0 commit comments