Help needed for "*.replace" command

#1

I’m trying to work on a bot here [don’t criticize me about that], and currently, whenever I use it, it throws an error:
“TypeError: split.replace is not a function”, even though I defined split in the command.

#2

Hey @JG-GIT can you provide your project’s name so folks can take a look?

#3

It’s “genloss-bot”. I’ve worked on it for a while now, and I added dev-commands, but they don’t seem to work as intended.

#4

And after a day of it being on, it’s now broken and several modules that don’t seem necessary for it to work are now gone, forcing an error to be thrown.

#5

But now, I’ve installed literally every module I thought was unnecessary, and now it works again.

#6

can you invite me to the project so I can take a look please.

#7

@JG-GIT it sounds like things are working, and when I look at the bot I don’t see any errors; if you run into further problems, knowing all the errors you’re encountering might help folks provide better advice after the fact.

As far as the unnecessary packages are concerned, do you mean you added things to the package.json that you didn’t think you needed, or that Glitch seemed to install packages you hadn’t requested?

#8

In the unnecessary packages, I didn’t request most of the packages.
Also, whenever I try to use the commands tied to the “split.replace” command, it throws that error.
“events.js:183
throw er; // Unhandled ‘error’ event
^
TypeError: split.replace is not a function
Jump to
at Client.bot.on (/app/server.js:49:20)
at emitOne (events.js:116:13)
at Client.emit (events.js:211:7)
at Shard.emit (/app/node_modules/eris/lib/gateway/Shard.js:1888:26)
at Shard.wsEvent (/app/node_modules/eris/lib/gateway/Shard.js:421:26)
at Shard.onWSMessage (/app/node_modules/eris/lib/gateway/Shard.js:1727:26)
at WebSocket.ws.onmessage (/app/node_modules/eris/lib/gateway/Shard.js:1605:33)
at WebSocket.onMessage (/app/node_modules/ws/lib/event-target.js:120:16)
at emitOne (events.js:116:13)
at WebSocket.emit (events.js:211:7)
7:36 AM”

#9

@JG-GIT can you please console.log split and send it here