Skip to content
← Back to Community
Adding a prefix
Profile icon
GracioussBoww

Im trying to add a prefix to my bot in which I keep getting an error message of the one below, if anyone can help me figure this out it'd be greatly appreciated.

image

Answered by WWEMONSTERMONST [earned 5 cycles]
View Answer
Voters
Profile icon
GracioussBoww
Comments
hotnewtop
Profile icon
WWEMONSTERMONST

As you have your prefix in json file, you have to import it from there. It can be done by using following code:

const { prefix } = require('./name.json') // Or you can use this const items = require('./name.json') const prefix = items.prefix
Profile icon
GracioussBoww

@WWEMONSTERMONST

Thank you ever so much for helping me there, it worked

Profile icon
Coder100

send repl