#๐Ÿ”’ can someone please help me with inlining

83 messages ยท Page 1 of 1 (latest)

sterile flintBOT
#

@pastel vector

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

pastel vector
#

so

#

i want to do this inlined

#

discord
๐Ÿ‘†

#

the message is ina text file so idk how that would work

#

if anyone can help id deeply appreciate it

misty kayak
#

Even better if you can share the code that you need changing

#

Might help the volunteer helper a lot

pastel vector
#

@misty kayak its just a txt file

misty kayak
pastel vector
#

they kinda have server links in them

misty kayak
#

Where does it get displayed?

#

how does it get displayed from the text file?

#

If the code is very long, use a pastebin

#

!pastebin

sterile flintBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

pastel vector
scarlet vector
#

I mean tbh. Those discords in the screenshot all look like scams?

99% off?

pastel vector
scarlet vector
#

So, scam

pastel vector
#

no its called marketing

scarlet vector
#

False marketing?

pastel vector
#

well to get people to join my server

#

they see things like

#

90-80% off

#

not %99

#

sometimes 99%

#

so no its not false

#

techincally

#

you made the other guy leave

#

congrats

scarlet vector
misty kayak
#

still tho... no idea about this savings discord server thing...

pastel vector
#

๐Ÿ˜ญ

pastel vector
scarlet vector
pastel vector
#

generates random bio's

#

for users of my server to use for their tiktok accounts

#

not harming anyone or breaking tos

#

stop being odd man

#

im trynna just chill

#

and get help

pastel vector
misty kayak
pastel vector
#

oh

misty kayak
#

Not seeing a single code out of this

pastel vector
#

bro

misty kayak
scarlet vector
pastel vector
#

@misty kayak

scarlet vector
#

Lol

misty kayak
#

wonderful... its just initial_bios... fantastic

#

So it โœจ magically โœจ shows up on Discord

pastel vector
#

is that a bad thing

misty kayak
#

I still have no idea how it goes into your tiktok bot

pastel vector
#

is that gonna help you figure out how i can make it do this

misty kayak
#

how can we know? I've never seen it yet

pastel vector
pastel vector
misty kayak
pastel vector
#

got u

#

@misty kayak here

pastel vector
#

@misty kayak

misty kayak
#

finally

#

So its basically this

# Define the slash command for bios
@client.tree.command(name='get_bio', description='Get a random TikTok bio')
async def get_bio(interaction: discord.Interaction):
    print("get_bio command invoked")  # Debugging statement
    user_id = interaction.user.id
    user_claim_count = user_claims.get(str(user_id), 0)

    if user_claim_count >= 2:
        await interaction.response.send_message("You have already claimed the maximum of 2 bios.", ephemeral=True)
        return

    bios = load_bios()
    if not bios:
        await interaction.response.send_message("No more bios available.", ephemeral=True)
        return

    # Select a random bio
    selected_bio = random.choice(bios)
    print(f"Selected bio: {selected_bio}")  # Debugging statement

    # Create a view with buttons for claiming or regenerating
    view = BioView(selected_bio, user_id)

    # Send the bio with buttons
    await interaction.response.send_message(f'Random Bio: {selected_bio}', view=view, ephemeral=True)
#

Bios are loaded from this

def load_bios():
    """Load bios from the text file."""
    with open(BIOS_FILE, "r") as f:
        bios = [line.strip() for line in f.readlines()]
    return bios
pastel vector
#

whats wrong with that?

#

they cant be loaded from a txt file @misty kayak ?

misty kayak
#

Im still looking

pastel vector
#

ok

misty kayak
#

I'm not that experienced in discord bot dev but it looks like if you want to send in multilines like

discord.gg
๐Ÿ‘†

You would have to send_message twice.

One for each line like:
await interaction.response.send_message(f'Random Bio: First line {selected_bio}', ephemeral=True)
await interaction.response.send_message(f'Random Bio: Second line {selected_bio}', ephemeral=True)

#

Maybe if you split it on \n, then that would work

#

My guess is that that's the limitation on the discord ui View

sterile flintBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.