#๐Ÿ”’ pulling username

44 messages ยท Page 1 of 1 (latest)

tacit karma
#

im looking to do something where when i provide a link to a roblox profile, it is able to scrape the username and put it under a variable like username=blahblah

sharp ferryBOT
#

@tacit karma

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.

random stone
#

You can fairly easily do that with BeautifulSoup and Requests. Just need to check their TOS to see if they care about you doing that

tacit karma
random stone
rotund birch
#

@tacit karma you can also see if roblox has something on its API you can use

tacit karma
#

do you know much?

rotund birch
tacit karma
#

about slash command

rotund birch
rotund birch
sharp ferryBOT
#

Hey @tacit karma!

Please edit your message to use a code block

```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
tacit karma
# rotund birch i know a lot, yes
GUILD_ID = discord.Object(id=1340587225313837067)


@client.tree.command(name="kos", description="Publishes a KOS notice on the specified user", guild=GUILD_ID)
async def kos(interaction: discord.Interaction):
    await interaction.response.send_message("Hi there")
rotund birch
#

didnt you just send that sample in general?

tacit karma
#

thats what i have so far

#

and its saying that

rotund birch
#

#python-discussion message

tacit karma
#

client has no attribute "tree"

tacit karma
#

thats the problem

rotund birch
#

did he not send you anything?

tacit karma
#

no

rotund birch
#

hm, strange

#

hm, weird

#

!d discord.app_commands.tree.CommandTree

sharp ferryBOT
#

class discord.app_commands.CommandTree(client, *, fallback_to_global=True, allowed_contexts=..., allowed_installs=...)```
Represents a container that holds application command information.
tacit karma
#
import discord
import requests

class Client(discord.Client):
    async def on_ready(self):
        print(f'Logged on as {self.user}!')              
   
    async def on_message(self, message):
        
        if message.author == self.user:
            return

        if message.content.startswith('hello'):
            await message.channel.send(f'Hi there {message.author}')

    async def on_reaction_add(self, reaction, user):
        await reaction.message.channel.send('You reacted')
    

intents = discord.Intents.default()
intents.message_content = True
client = Client(command_prefix="!", intents=intents)

GUILD_ID = discord.Object(id=1340587225313837067)


@client.tree.command(name="kos", description="Publishes a KOS notice on the specified user", guild=GUILD_ID)
async def kos(interaction: discord.Interaction):
    await interaction.response.send_message("Hi there")

client.run('my token shhh')
#

thats my entire code so far

#

im so trash at it

tacit karma
#

kill on sight

#

the plan in the end is to put a roblox users id in with the kos slash command

rotund birch
tacit karma
#

roblox game called town

#

and it will send their user, with a photo of their avatar in and embed

#

like this

#

anywho

rotund birch
# tacit karma

yeah so you gotta make your own tree and attach it as an attribute of the client instance

sharp ferryBOT
#
Python help channel closed for inactivity

This help channel has been closed. 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.