#Help

1 messages · Page 1 of 1 (latest)

opal anvil
#

Hi, I'd like help with the following error.
It keeps happening and its really annoying
Traceback (most recent call last):
File "/home/container/main.py", line 13, in <module>
tree = app_commands.CommandTree(client)
File "/home/container/.local/lib/python3.8/site-packages/discord/app_commands/tree.py", line 150, in init
raise ClientException('This client already has an associated command tree.')
discord.errors.ClientException: This client already has an associated command tree.

fervent heronBOT
#

Heads up @opal anvil! We've detected one or more tokens in your attachments!

  • Found token of 1294654800427880481 (Casino Manager) in attachment message.txt. You can regenerate it here.

Fyi: Each token might trigger a system message by discord, if it's valid.
Please avoid uploading tokens in future, even if they aren't valid anymore.

Stay Safe!

opal anvil
#

Here the code

#

and I've imported pycord, aiohttp and python dotenv

#

Thanks

opal anvil
#

what's that

near juniper
#

you already have a tree with bot.tree

opal anvil
#

Like what should I edit from code sir

near juniper
#

remove tree = … line

opal anvil
near juniper
#

use bot.tree instead of tree

opal anvil
#

ok

#

@near juniper

#

So I remove that tree = line and change every cmd thingies to bot.tree.cmd?

near juniper
#

yes

opal anvil
#

tree = app_commands.CommandTree(client)

#

ok trying

#

1 min

#

@near juniper

#

Traceback (most recent call last):
File "/home/container/main.py", line 117, in <module>
@bot.tree.command(name="blackjack", description="Play a game of Blackjack.")
NameError: name 'bot' is not defined

near juniper
#

oh you use client instead of bot

opal anvil
#

so @near juniper

near juniper
#

client.tree then

opal anvil
#

client.tree.command?

#

or client.tree

#

@near juniper

near juniper
#

what are you asking?

spark heron
#

...with all due respect, 1) it feels like you don't know your own code and 2) this is the wrong server (your code is discord.py), even if squid happens to know the library you should be asking there instead

opal anvil
#

client.tree.command

#

or

#

client.command

near juniper
#

the first one

knotty mauve
opal anvil
#

bro

#

no need to be mean 😭

#

I got code from friend

#

and he asked for help

knotty mauve
#

no one is mean. you're in the wrong place to ask for help.

opal anvil
#

and idk coding

opal anvil
#

where should I ask

knotty mauve
spark heron
opal anvil
#

pls

knotty mauve
#

No

opal anvil
#

bro then let me be here

#

its urgent

knotty mauve
#

If it's so urgent you can also Google it yourself

opal anvil
#

google = random not working

knotty mauve
#

if you make me look it up it's slower

near juniper
opal anvil
#

do u think I haven't tried?

spark heron
#

eh did we go over this?

near juniper
#

yes, 2 years ago

opal anvil
#

1 question

#

now error in bot.run(token)

#

💀

spark heron
#

client

opal anvil
#

?

#

bot.client.run(token)?

#

Traceback (most recent call last):
File "/home/container/main.py", line 418, in <module>
bot.run(token)
NameError: name 'bot' is not defined

knotty mauve
#

If you got all this code from a friend and seem to not hugely understand it, and regardless of your level of programming, I'd recommend to first learn it yourself before trying to debug other's code like this

opal anvil
#

But no need to be always saying some random bad comment

knotty mauve
opal anvil
#

unnecessary

#

@near juniper is like the only one who's kind

knotty mauve
opal anvil
#

I know

knotty mauve
#

which are both detrimental to getting helped properly

opal anvil
#

I'm sorry

#

May I get their server then?

#

So I can go to their

knotty mauve
#

it's on their GitHub repo iirc

spark heron
#

the invite code is just dpy

#

though that client.run bit was (seemingly) the last thing you needed to fix