#๐ pulling username
44 messages ยท Page 1 of 1 (latest)
@tacit karma
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.
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
how would i go about that though
Use requests to get the web page, use BeautifulSoup to navigate the HTML
@tacit karma you can also see if roblox has something on its API you can use
id be clueless, im trying to work on slash command at the moment
do you know much?
?
about slash command
just google "roblox username API"
i know a lot, yes
Hey @tacit karma!
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
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")
didnt you just send that sample in general?
#python-discussion message
client has no attribute "tree"
yes thats mine
thats the problem
no
class discord.app_commands.CommandTree(client, *, fallback_to_global=True, allowed_contexts=..., allowed_installs=...)```
Represents a container that holds application command information.
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
whats a kos?
kill on sight
the plan in the end is to put a roblox users id in with the kos slash command
whats this for?
roblox game called town
and it will send their user, with a photo of their avatar in and embed
like this
anywho
yeah so you gotta make your own tree and attach it as an attribute of the client instance
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.