XF2 [8WR] Discord Integration

XF2 [8WR] Discord Integration [Paid] 2.1.1.9

No permission to buy ($30.00)
Here is a sample error:

Code:
    Error: Call to undefined method GuzzleHttp\Psr7\Response::json() src/addons/EWR/Discord/Repository/Discord.php:46

    Generated by: Unknown account Feb 2, 2019 at 8:23 AM

Stack trace

#0 src/addons/EWR/Discord/Repository/Discord.php(81): EWR\Discord\Repository\Discord->getGuild('/members/282835...')
#1 src/addons/EWR/Discord/Repository/Discord.php(218): EWR\Discord\Repository\Discord->patchMember(Object(EWR\Discord\Entity\User), Object(EWR\Discord\Entity\UserConnectedAccount))
#2 src/addons/EWR/Discord/Cron/Sync.php(9): EWR\Discord\Repository\Discord->syncDiscord()
#3 [internal function]: EWR\Discord\Cron\Sync::syncDiscord(Object(XF\Entity\CronEntry))
#4 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#5 src/XF/Job/Manager.php(253): XF\Job\Cron->run(G)
#6 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#7 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#8 job.php(42): XF\Job\Manager->runQueue(false, 8)
#9 {main}

Request state

array(4) {
  ["url"] => string(23) "/roleplay-forum/job.php"
  ["referrer"] => string(45) "https://stararmy.com/roleplay-forum/admin.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
Not entirely sure. I would test with friendly urls disabled and see if you get a different behavior. Just to eliminate the state request from getting a 404

I tried but it still wouldn't validate the thread. Also tried ruling out pagespeed by disabling it.

On top of that when I sometimes disable the Discord addon by Jaxel, the same issue happens with the Portal addon in the errorlogs:

Code:
Server error log

    XF\Db\Exception: Job XF:ApprovalQueueProcess: MySQL query error [1205]: Lock wait timeout exceeded; try restarting transaction src/XF/Db/AbstractStatement.php:217

    Generated by: Unknown account Feb 7, 2019 at 2:34 AM

Stack trace

UPDATE  `xf_thread` SET `discussion_state` = ? WHERE `thread_id` = 5322
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL query err...', 1205, 'HY000')
#1 src/XF/Db/Mysqli/Statement.php(77): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1205, 'HY000')
#2 src/XF/Db/AbstractAdapter.php(89): XF\Db\Mysqli\Statement->execute()
#3 src/XF/Db/AbstractAdapter.php(277): XF\Db\AbstractAdapter->query('UPDATE  `xf_thr...', Array)
#4 src/XF/Mvc/Entity/Entity.php(1457): XF\Db\AbstractAdapter->update('xf_thread', Array, '`thread_id` = 5...')
#5 src/XF/Mvc/Entity/Entity.php(1184): XF\Mvc\Entity\Entity->_saveToSource()
#6 src/XF/Service/Thread/Approver.php(37): XF\Mvc\Entity\Entity->save()
#7 src/XF/ApprovalQueue/Thread.php(27): XF\Service\Thread\Approver->approve()
#8 [internal function]: XF\ApprovalQueue\Thread->actionApprove(Object(EWR\Porta\Entity\Thread))
#9 src/XF/ApprovalQueue/AbstractHandler.php(120): call_user_func_array(Array, Array)
#10 src/XF/Job/ApprovalQueueProcess.php(67): XF\ApprovalQueue\AbstractHandler->performAction('approve', Object(EWR\Porta\Entity\Thread))
#11 src/XF.php(478): XF\Job\ApprovalQueueProcess->XF\Job\{closure}()
#12 src/XF/Job/ApprovalQueueProcess.php(68): XF::asVisitor(Object(XFRM\XF\Entity\User), Object(Closure))
#13 src/XF/Job/Manager.php(253): XF\Job\ApprovalQueueProcess->run(G)
#14 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#15 src/XF/Job/Manager.php(111): XF\Job\Manager->runJobEntry(Array, G)
#16 job.php(21): XF\Job\Manager->runByIds(Array, 8)
#17 {main}

Is there no other way to get some more solid information out of the logs? I've checked the php-fpm logs for errors and none are logged there as well.
 
How do I make this bot always appear online (instead of ofline?)

TO6yGbz.png
 
I noticed that attempting to access the add-on's options causes a PHP error message. It's the "Call to undefined method GuzzleHttp\Psr7\Response::json() src/addons/EWR/Discord/Repository/Discord.php:46" again.
 
You need to host a bot via a server or your personal computer. The bot doesn't have to be online to update roles or push updates, it plays as a webhook ultimately. If you decide to have the bot online for other functions then that's a different story.
Also yes, it's a pay once plugin. You have a license for support for a year.
 
So it doesn't want to sync my roles to my discord server or even promote people in the server at all, anyone got any advice so i can fix this?
 
Thank you for answering @bashea11

My Discord tab on my forum keeps loading, but never fully loads. Besides that everything is working as desired. How do I fix this?

yuYBYw4.png
 
So it doesn't want to sync my roles to my discord server or even promote people in the server at all, anyone got any advice so i can fix this?
Thank you for answering @bashea11

My Discord tab on my forum keeps loading, but never fully loads. Besides that everything is working as desired. How do I fix this?

yuYBYw4.png


This is common, both of you need to thoroughly check if your information you put in to the plugin is correct. One number or letter off can cause the entire thing to mess up. Make sure your URLs are correct as well.

For your issue on your discord not loading, make sure that your invite link is correct in the file on that page.
 
Is it possible to limit what the BOT can see forum wise? We have a staff forum and it reports posts from there in the Discord.
 
I suggest using another Discord add-on as this one has been broken since XF 2.1.
The other add-on for Discord is by NixFifty which also gets updated like once a year with promises each week that it's gonna be "soon". I don't think you're better off there. For reference their "Tickets" add-on was supposed to get its "final touches" on 2018-12-27 and is yet to be released.

I've also got an error in the ACP that it does not display the connected Discord account info. It shows "Discord: " when it's connected, but no further info:

197795
 
You probably just installed the 2.1 version on XF 2.0, or vice-versa.
I did not. I upgraded from XF1.5 (using your old add-on) to XF2.1 and upgraded to the XF2.1 version of your add-on (2.1.0.1).

I even disconnected my Discord account and re-connected it, but it still shows like shown in my screenshot.

It also shows like this in my connected accounts:
197806

and the chrome error log shows:

197807
 
Top Bottom