Fixed Websocket Not Sending

daedious

Member
Hello,

First, Awesome plugin. I specifically purchased Xenforo for this plugin because its best solution to keep forums alive in a world that needs the instant gratification of discord! haha

All my settings seem to be set correctly, yet when I press "Initiate WebSocket", it just gives me this "#" placeholder instead of a URL. (...forums/admin.php?tools/test-discord&test=1#)

How can I fix this so that I can send the heartbeat? Thanks!
 

NixFifty

Administrator
Staff member
Thanks! Glad you like the addon.

Do you have JavaScript enabled? The heartbeat is sent via that. There may be a case of false positives whereby it may look as though the heartbeat wasn’t sent.

You can confirm the addon is working correctly by sending a channel alert.
 

daedious

Member
Ive used javascript with wordpress on the server, so I assume its working, but is it a specific setting in Xenforo?

When I send the alert I get this:

Code:
Server Error

array_key_exists() expects parameter 2 to be array, boolean given

XenForo_Application::handlePhpError()
array_key_exists() in NixFifty/Discord/ControllerAdmin/Discord.php at line 127
NixFifty_Discord_ControllerAdmin_Discord->actionChannelsAlert() in XenForo/FrontController.php at line 351
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
XenForo_FrontController->run() in /home/severname/public_html/forums/admin.php at line 13
 

NixFifty

Administrator
Staff member
What are you having trouble with?

Make sure you’ve upgraded to the latest version and try it out.
 

daedious

Member
Same problem as the original thread post.

I have included a screenshot. The initiate websocket button doesnt work. It is linked to a #.
If you look at the bottom left hand of the browser you will see the link that is attached to this button.

upload_2018-3-12_18-0-46.png
 

NixFifty

Administrator
Staff member
Have you upgraded to the latest version? There was a file missing in earlier packages.

In addition, go to ACP -> Discord and try and send a channel alert. If that goes through to your server, the web socket is open and there’s nothing to worry about. Might just be a false positive.
 

daedious

Member
Yes I did update the files. Thank you for the updated files btw

When I try to send an alert or sync roles I get this error:

array_key_exists() expects parameter 2 to be array, boolean given

  1. XenForo_Application::handlePhpError()
  2. array_key_exists() in NixFifty/Discord/ControllerAdmin/Discord.php at line 127
  3. NixFifty_Discord_ControllerAdmin_Discord->actionChannelsAlert() in XenForo/FrontController.php at line 351
  4. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  5. XenForo_FrontController->run() in /home/fearthelord/public_html/forums/admin.php at line 13
Which is why I was trying to get that socket to work. I figured that had something to do with it.
 

NixFifty

Administrator
Staff member
Ah, that looks like the bot does not have a role with admin permissions? Could you check that since that’s a requirement.
 

NixFifty

Administrator
Staff member
Could you open a ticket with forum admin and discord server details and I can take a look?
 
Top