I’m trying to make a bot for my discord server and I’m following the guide… but when is comes down to prefixes… I keep getting a message saying “prefix is not defined” I copied the doc example
It also said at the beginning to create a config.json file which I did and put what I was supposed to. not really good at coding so I’m trying to learn as best I can but I need helpCan you show us your full code plus the JSON file?
try removing “message.author.bot” from line 14 and see if anything changes
now it says "Parsing error: Unexpected Token
ok hold on i analyzed more and i noticed that every instance you have “prefix” you need a config before it since you dont define prefix itself
so to activate my bot on discord the keyword is v. ; so instead of actually putting prefix I need to use v.??
no every instance you have “prefix”, change it to “config.prefix”
That should work. I’ve used glitch discord bot coding forever and you are right.
assuming you meant me, i skimmed over it at first and got it wrong L but we all good now. hope the dude’s code works now
yea. config.prefix works for me all of the time. the dude has to define config first.
he already defined config, he just could’ve defined config.prefix as prefix or whatever lmfao
Nice… it worked. Thank you so much
So you don’t have to put config.prefix
on every line you can do this: let prefix = config.prefix
around the client.on
. Just to make it shorter and not config.prefix every command you make
yea of course
yes, exactly
Just to make it shorter . Have a nice day.