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
Can 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
Just to make it shorter . Have a nice day.