something like that (i know this code is wrong) :
def addchoice(filename, ctx, choices) :
folder = pathlib.Path(f"users_data/{ctx.guild.id}")
for filename in folder.iterdir() :
if filename.is_file() :
choices.append("name")
@bot.slash_command(name = "makeinvoice", description = "CMD used to make a new invoice for a customer")
async def setfee(ctx, customer : discord.Option(discord.Member, "Select here the customer", required = True),
cost : discord.Option(int or float, 'Write Here The transaction cost (without including extra fees !)', required = True),
paymentmethod : discord.Option(str, 'Select Here The Payment Method used by customer', choices = addchoice(), required = True)) :
await ctx.respond("noice")