i am newbie and have a little knowledge but how do i make the button match the captcha code without having to hard coded it. Basically i want the captcha to be 4 digits random number and the button need to have 1 correct answer and 2 wrong answers. For now im hard coded the captcha and the answer.Im using buttonView to create 3 buttons as the answer. The user need to choose one of the buttons based on the generated captcha

class buttonView(discord.ui.View):
    def __init__(self, code, *, timeout=20):
        super().__init__(timeout=timeout)
        self.code = code
        self.solved = None
        self.failed = 0

    @discord.ui.button(label="1234", style=discord.ButtonStyle.red)
    async def red_button(self, interaction: discord.Interaction, button: discord.ui.Button):
        await interaction.response.send_message("Good!!")
        self.solved = True
        self.stop()

    @discord.ui.button(label="4321", style=discord.ButtonStyle.gray)
    async def gray_button(self, interaction: discord.Interaction, button: discord.ui.Button):
        await interaction.response.send_message("Wrong!!")
        self.solved = False
        self.failed += 1
        await self.check_stop(interaction)

    @discord.ui.button(label="1243", style=discord.ButtonStyle.green)
    async def green_button(self, interaction: discord.Interaction, button: discord.ui.Button):
        await interaction.response.send_message("Also wrong!!")
        self.solved = False
        self.failed += 1
        await self.check_stop(interaction)

    async def check_stop(self, interaction):
        if self.failed >= 2:
            if not interaction.response.is_done():
                await interaction.response.send_message("Exceeded maximum attempts. Kicking the user...")
                member = interaction.user
                await self.kick_user(member, "Exceeded maximum attempts in captcha verification.")
                self.stop()

    async def kick_user(self, member, reason):
        await member.kick(reason=reason)

class Captcha(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.user_attempts = {}

    async def cog_check(self, ctx):
        return ctx.channel.id == channel.captcha

    async def log_attempt(self, user, result):
        log_channel_id = channel.auditlog
        log_channel = self.bot.get_channel(log_channel_id)

        if log_channel:
            log_message = f"**User:** {user.name} ({user.id})n**Time:** {datetime.now()}n**Result:** {result}nn"
            await log_channel.send(log_message)

    @commands.Cog.listener()
    async def on_message(self, message: discord.Message):
        if message.author == self.bot.user:
            return

        if message.channel.id != channel.captcha or message.content == "/verify":
            return

        await message.delete()
        await self.log_attempt(message.author, "Message deleted")

    @commands.command()
    async def verify(self, ctx):
        user_id = ctx.author.id
        user = ctx.author

        # Logging user attempt
        logging.info(f"{user.name} ({user.id}) started the captcha verification at {datetime.now()}.")

        if user_id in self.user_attempts and self.user_attempts[user_id] >= 2:
            if ctx.bot.is_ready():
                await ctx.send("You have reached the maximum number of attempts. Kicking the user...")
                await self.kick_user(user, "Exceeded maximum attempts in captcha verification.")
                logging.warning(f"{user.name} ({user.id}) exceeded maximum attempts and was kicked at {datetime.now()}.")
            return

        captcha = ImageCaptcha()
        captcha_code = "1234"
        captcha.write(chars=captcha_code, output='CAPTCHA.PNG')
        view = buttonView(captcha_code)
        embed = discord.Embed(title="Please answer this captcha to prove you are not a bot!")
        embed.set_image(url="attachment://CAPTCHA.PNG")
        message = await ctx.send(file=discord.File("CAPTCHA.PNG"), embed=embed, view=view)