Elvis Ramirez
Elvis Ramirez

Reputation: 23

"callback" argument must be a function Node.js

I'm getting this error on "callback", this is the only part of the code where I use it. Thanks.

throw new TypeError('"callback" argument must be a function');

Error and code: https://pastebin.com/tbfdMdEK

Thank you!

Upvotes: 1

Views: 10553

Answers (1)

esengineer
esengineer

Reputation: 9918

On the following line you should probably pass a reference to callback instead of calling it.

Instead of this:

client.chatMessage(steamID, Config.options.successMessage, callback());

Do this:

client.chatMessage(steamID, Config.options.successMessage, callback);

Upvotes: 3

Related Questions