I have this code and I want to be able run this with multiple users at the same time, so they files should’ve mixed in the server.

def referral(update, context):
    if not is_allowed_user(update.message.from_user.id):
        return
    update.message.reply_text('Please enter the referral ID:')
    return GET_REFID
    
def get_refid(update, context):
    if update.message.text.lower() == "/cancel":
        return cancel(update, context)
    refid = update.message.text

    # Load referral IDs from the JSON file
    with open("referrals.json", "r") as f:
        referrals = json.load(f)

    if refid in referrals:
        context.user_data['refid'] = refid
        update.message.reply_text('referral ID saved. Now, please enter the company name (without space):')
        return GET_CONAME
    else:
        update.message.reply_text('Invalid referral ID. Please enter a valid referral ID:')
        return GET_REFID

def get_coname(update, context):
    refid = context.user_data['refid']
    if update.message.text.lower() == "/cancel":
        return cancel(update, context)
    coname = update.message.text
    context.user_data['coname'] = coname
    
    update.message.reply_text("Please wait, I'm processing…")

    for zip_file, tar_ext in zip(ZIP_FILES, TAR_EXTENSIONS):
        # Extract ZIP file
        with zipfile.ZipFile(zip_file, 'r') as zip_ref:
            zip_ref.extractall()

        # Rename binary
        os.rename('braiins-toolbox', f'braiins_toolbox_{refid}')
        
         # Add executable permission
        os.chmod(f'braiins_toolbox_{refid}', os.stat(f'braiins_toolbox_{refid}').st_mode | stat.S_IEXEC)

        # Compress with TAR
        output_file = f'braiins_toolbox_{tar_ext}_{coname}.tar.gz'
        with tarfile.open(output_file, 'w:gz') as tar:
            tar.add(f'braiins_toolbox_{refid}', arcname=f'braiins_toolbox_{refid}', filter=lambda tarinfo: tarinfo)

        # Cleanup - only remove the file if it exists
        if os.path.isfile(f'braiins_toolbox_{refid}'):
            os.remove(f'braiins_toolbox_{refid}')
        
        # Send the file to the user
        message_text = f'\n"{coname}" \n"{refid}"'
        with open(output_file, 'rb') as f:
            context.bot.send_document(
                chat_id=update.effective_chat.id,
                document=InputFile(f),
                filename=output_file,
                caption=message_text,
            )
        os.remove(output_file)

    final_message = f'''
==============

Company Name: **{coname}**
referral ID: `{refid}`

Remote Installation on [Beaglebone/Amlogic]:

Download the proper braiins-toolbox from the files above and run the command below.
(please note the suffix of toolbox name should be your referral ID):

`./braiins_toolbox_{refid} firmware install --ip-file list.txt`

If you want to use old toolbox you can download it with your referral ID here:
○ [Windows Version](https://feeds.braiins-os.com/toolbox/latest/bos-toolbox_{refid}.zip)
○ [Linux Version](https://feeds.braiins-os.com/toolbox/latest/bos-toolbox_{refid})

`./bos-toolbox_{refid} update list.csv bos-referral`

**SD Images:**
○ [Antminer X19 (Beaglebone) SD](https://referral.braiins-os.com/{refid}/sd-images/braiins-os_am3-bbb_latest.img)
○ [Antminer X19 (Zynq) SD](https://referral.braiins-os.com/{refid}/sd-images/braiins-os_am2-s17_sd_latest.img)

==============
    '''
    update.message.reply_text(final_message, parse_mode='Markdown')
    update.message.reply_text('⚠️ Hide sender’s name! when you want to forward the messages')
    return ConversationHandler.END


add user chat id in the path to manage this