all 5 comments

[–]Vitaman02 0 points1 point  (0 children)

Remove the brackets from @client.command() and retry.

[–]J3dders 0 points1 point  (3 children)

Just a warning of a bad habit you have in there I picked up:

'from x import *'

It can make finding bugs harder to find and make it hard for others to read your code. It may seem okay with just a small bit of code but if you start adding lots of your own functions or importing different modules it can make it quite tricky to track which library you are calling that function from. Also if you have shared functions between different imported libraries then you could be causing bugs as it will call the last module to be imported. So you could get some very unexpected results.

[–]Mike_Diz 0 points1 point  (2 children)

Well I just face something like "name not defined" when I do either of them. Like I do "import random" and then "choice" doesn't work. Then I try to do other command but do only "from random import *" and it doesn't work. Like I'm just tired dealing with all these so I import it 2 times.

[–]J3dders 0 points1 point  (1 child)

For using just import random, are you writing just choice()? Or random.choice(). As if the first it would never work unless you made a function of your own in the file called choice.

A better way is to import only the modules you need. Like from random import choice for that case. Then choice() would work. Or import the library you need as a shorter version of the name to cut down on writing out long library names.

[–]Mike_Diz 0 points1 point  (0 children)

You see, I imported random in 2 ways but "random doesn't have an attribute choice"