Error in console about no such event


#1

I’m getting the following in the console on 2.3.9.1

                                [ERROR] [addHook()@init.js:254] Failed to register hook "discord" since there is no such event.
[10-24-2017 @ 09:19:02.299 GMT] [ERROR] [addHook()@init.js:254] Failed to register hook "NewSubscriber" since there is no such event.
[10-24-2017 @ 09:19:02.299 GMT] [ERROR] [addHook()@init.js:254] Failed to register hook "NewReSubscriber" since there is no such event.

#2

Can you provide us the information that was included in the post template please?

PhantomBot Version:
OS Version:
Java Version:
Browser and Version (for Panel Support):
Stock PhantomBot: Yes/No (Yes if you have not modified the scripts or Java Core)


#3

version 2.3.9.1
mac os sierra
chrome (it’s a console error)
version as in original post
standard pb at download page


#4

Do you have any custom scripts in your phantombot?

If so, are those what’s causing these errors?

I’d assume the hook discord is meant to be discordChannelCommand ?

The hook NewSubscriber was renamed to subscriber

and the hook NewReSubscriber was also renamed to reSubscriber

If you’re wondering where these are used, you see them in the scripts depending on what they do.

Example:

/*
 * @event subscriber
 */
$.bind('subscriber', function(event) {
	//code here to handle the new subscriber
});

#5

this is a core error, not used any of these hooks in my scripts


#6

Sounds like you didn’t update to 2.3.9.1 correctly then, and that some items are using the old code and others are using new.

I’d like to point out I just edited one of my scripts to bind the event NewReSubscriber and on startup, this appeared:

[10-24-2017 @ 10:42:17.531 MST] [ERROR] [addHook()@init.js:254] Failed to register hook “NewReSubscriber” since there is no such event.

However, editing it back to normal and restarting made it go away.


#7

Those events were renamed a while back, the error happens when you try to bind a function to an event that doesn’t exit.


#8

right ok, I haven’t sent any bind on those events so it’s strange that those errors appear

It has been happening on the last version too

I’ll search the source for the bind on those events and see what is doing it


#9

Since you’re on a mac, you should be able to do this with the terminal.

cd phantom/bot/script/path/here
grep -iR 'newsubscriber' .

You should get something like this if no events are found.

D:\Development\PhantomBot\scripts>grep -iR 'newsubscriber' .

D:\Development\PhantomBot\scripts>

If something is found.

D:\Development\PhantomBot\scripts>grep -iR "$.bind('subscriber" .
./discord/handlers/subscribeHandler.js:      $.bind('subscriber', function(event) {
./handlers/subscribeHandler.js:    $.bind('subscriber', function(event) {

D:\Development\PhantomBot\scripts>

#10

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.