XF2 [8WR] Discord Integration

XF2 [8WR] Discord Integration [Paid] 2.1.1.9

No permission to buy ($30.00)

/GriFFin

Member
You can use Cron jobs under tools to force a sync. Sync appears to be set every 24 hours. You can force that to be faster if you are ok with a little performance hit since this subscribes the bot to a service.

I would toggle that setting for initial setup and then toggle off once all roles are synced.

I have waited 5 to 6 days, and nothing ever gets synced, but cron job is running every day, and all my bots and settings are setup right, hopefully i will figure it out at some point so my members don't keep posting as guest even when they linked their accounts.
 

Jaxel

Well-known member
ONE account is synced every 5 minutes. And no account is synced faster than once every 24 hours.

Please read the FAQ.
 

Niro

Active member
ONE account is synced every 5 minutes. And no account is synced faster than once every 24 hours.

Please read the FAQ.
I made a test on my dev forum, with an empty discord (we are two, me and another account I made), it doesn't work.
 

Benality

Member
The crate is just different servers the bot lives on.. They are pretty much the same thing. Just choose one, connect the bot from that crate to your Discord and make sure the settings in XF match which crate you used.. It's all really simple really, just make sure it all matches.
 

Nicky Vermeersch

Active member
Can confirm that in my case, using this Discord addon seems to deadlock the approval queue system of Xenforo. Disabling the addon alleviates the problem.
 
Last edited:

Jaxel

Well-known member
Can confirm that in my case, using this Discord addon seems to deadlock the approval queue system of Xenforo. Disabling the addon alleviates the problem.
Are you able to post threads to Discord when they don't go through the approval queue first?

I tested it on two different forums, without issue. I'm thinking your issue may have nothing to do with the approval queue, and may just be an issue related to posting threads in the first place.
 
Last edited:

Nicky Vermeersch

Active member
Are you able to post threads to Discord when they don't go through the approval queue first?
It must be a rare case, since for other forums there are no issues. As long as the keyword is not triggered, the thread will be posted in the forum.
The forum this particular thread was supposed to go to isn't setup to relay the information to Discord (set to Disabled).

It can be replicated by:
  1. Created a brand new user
  2. Set up spam system with a keyword ie "extremetest"
  3. XF spam management must be set up in a way that the first posts will go through the spam system
  4. Created a thread where I used the word "extremetest" in the post body
  5. Thread ended up being flagged as potentially spam and awaiting approval into the queue
  6. Admin account opens approval queue and validates the thread/post
  7. Processing the approval queue takes a longer than usual amount of time
  8. On page load the approval queue opens again but the item has not been validated and remains there for validation

Then when checking the logs I got:

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 1, 2019 at 2:45 AM

Stack trace

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

#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\Discord\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\Discord\Entity\Thread))
#11 src/XF.php(478): XF\Job\ApprovalQueueProcess->XF\Job\{closure}()
#12 src/XF/Job/ApprovalQueueProcess.php(68): XF::asVisitor(Object(EWR\Discord\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}

Request state

array(4) {
  ["url"] => string(8) "/job.php"
  ["referrer"] => string(45) "https://www.mcmiddleearth.com/approval-queue/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(5) {
    ["only_ids"] => array(1) {
      [0] => string(3) "214"
    }
    ["_xfRequestUri"] => string(16) "/approval-queue/"
    ["_xfWithData"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}
 

kerts93

Member
Does anybody have an idea how I can enable registration only through Discord account (disable regular registration)?
 

Benality

Member
Yes, friendly URL's are enabled.
I think that could be your issue really. Something isn't re-directing properly.


Anyone knows a way to let the Discord Bot appear online?
It's not going to appear online until it pushes something to the server.

After upgrading to XF 2.1 I had to disable this addon due to errors.
I haven't updated.. I am on the 2.1 RC1... I will wait until this is confirmed fixed before updating.. Thanks
 

Nicky Vermeersch

Active member
I think that could be your issue really. Something isn't re-directing properly.

Hmm, it is weird though that when I disable the Discord addon, that it process like it should. I also wouldnt have no idea how this addon would alter the way the processing queue works so that it could lead to a wrong redirect?
 

Benality

Member
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
 
Top