XF2 [8WR] Discord Integration

XF2 [8WR] Discord Integration [Paid] 2.1.1.9

No permission to buy ($30.00)
Just noticed an error too...
Code:
[LIST]
[*]XF\PrintableException: An error occurred while connecting with Discord. Please try again later.: Server error: [ICODE]GET https://discordapp.com/api/guilds/501320508273459210/members/561264619696685066?limit=1000[/ICODE] resulted in a [ICODE]500 INTERNAL SERVER ERROR[/ICODE] response: {"code": 0, "message": "500: Internal Server Error"}
[*]src/addons/EWR/Discord/Repository/Discord.php:55
[*]Generated by: Unknown account
[*]Apr 22, 2019 at 11:28 PM
[/LIST]
[SIZE=5][B]Stack trace[/B][/SIZE]
#0 src/addons/EWR/Discord/Repository/Discord.php(81): EWR\Discord\Repository\Discord->getGuild('/members/561264...')
#1 src/addons/EWR/Discord/Repository/Discord.php(219): EWR\Discord\Repository\Discord->patchMember(Object(SkMxK\HTMLTitles\XF\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(36): 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}
[SIZE=5][B]Request state[/B][/SIZE]
array(4) {
["url"] => string(14) "/forum/job.php"
["referrer"] => string(28) "https://www.lomcn.org/forum/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
1563822807241.png

should it also be displaying the chat box?

Oops! We ran into some problems.
An error occurred while connecting with Discord. Please try again later.: Client error: GET https://discordapp.com/api/guilds/602510470473318404/members/601101380593385524?limit=1000 resulted in a 403 FORBIDDEN response: {"code": 50001, "message": "Missing Access"}
 
Last edited:
If the Discord servers have a hiccup and produce a 500 error... there is nothing to be done. I too get this error about once a week... probably during server maintenance on Discord's end.
 
@Jaxel

Thanks for adding this feature! Understandable if 2 way sync cannot be done, but can you add the possibility to split the the Role syncing into 2 categories? EG:

From Xenforo to Discord
- XENFORO/DISCORD ROLES HERE

From Discord to XenForo
- DISCORD/XENFORO ROLES HERE

^

This way "some" of the forum roles can still be applied to their discord role, while other discord roles can be applied on the forum. I'd like to split up some of the role sync directions.
Still waiting for an answer regarding this @Jaxel

I heard you very clear that a 2 way sync is not possible, as such a 1 way direction for each discord role / forum role should be possible, regardless from Xenforo to Discord or Discord to Xenforo. I've been waiting for an answer for some time now, and I even asked you on Discord (where I am being simply ignored I might add)

As there are some forum roles I'd like to link to Discord, and Discord roles I'd like to link to the forums. Which would make this a great improvement to the system. Again, not asking for a 2 way sync! Merely a way to separate the Xenforo -> Discord & Discord -> XenForo function so it can do both ways, without it being a 2 way sync.

It's not that hard to give an answer.
 
@Jaxel

Don't ignore me.. it's a simple question if it's possible yes or no. Your add-on is amazing, but can't really say the same about you (reply wise).

Again, not that hard to answer. Fact you've been ignoring me for the past few weeks shows that you need to work on customer support/service.
 
Last edited:
Thanks for the update! Would have been nice though if you given an reply regarding it. But I still really appreciate you've added this function, so thanks!

Out of curiosity though. The Discord Server Boost role, is there anyway it can appear in the role syncing (only from discord to the forums), seeing it isn't an "official" server side role, I don't think this is possible. But can't hurt to ask.
 
Guess I missed that, but was to be expected.

Like to report a bug though.

1564598716332.png

Set it up so these 2 roles from discord, will be applied to their forum profile as well. And while that works perfectly fine:

1564598632069.png

Their roles are being erased from discord at the same time:

1564598652952.png

Is this intended? As I assume the sync would be to sync the roles they have from discord to Xenforo without erasing their discord roles at the same time.

EDIT:

Even setting the settings to "no" (while leaving D>XF tagged), the bot will still erase the discord roles.

See:

1564608385004.webp

and:

1564608411575.webp
 
Last edited:
In EWR\Discord\Repository\Discord.php, above line 123 add:
Code:
            if (empty($data['roles']))
            {
                unset($data['roles']);
            }
Tell me if that fixes it.
 
Afraid not.

I've added that part of the code above
Code:
if (!empty($groupChange))
(123)

And it still appears to be erasing roles from discord:

1564646679222.png

The forum linked role is a XF>D setting, rather than D>XF case you were wondering.
 
Getting an error since installing the last update:

Code:
ErrorException: Template error: Illegal string offset 'dir' internal_data/code_cache/templates/l1/s0/admin/option_template_EWRdiscord_roles.php:36

 

Stack trace

      
           #0 internal_data/code_cache/templates/l1/s0/admin/option_template_EWRdiscord_roles.php(36): XF\Template\Templater->handleTemplateError(2, 'Illegal string ...', '/mnt/fast/websi...', 36, Array)
#1 src/XF/Template/Templater.php(1315): XF\Template\Templater->{closure}(Object(SV\AlertImprovements\XF\Template\Templater), Array)
#2 src/XF/Option/AbstractOption.php(92): XF\Template\Templater->renderTemplate('option_template...', Array)
#3 src/addons/EWR/Discord/Option/Roles.php(37): XF\Option\AbstractOption::getTemplate('admin:option_te...', Object(XF\Entity\Option), Array, Array)
#4 [internal function]: EWR\Discord\Option\Roles::renderOption(Object(XF\Entity\Option), Array)
#5 src/XF/Entity/Option.php(76): call_user_func(Array, Object(XF\Entity\Option), Array)
#6 [internal function]: XF\Entity\Option->renderDisplayCallback(Array)
#7 src/XF/Template/Templater.php(999): call_user_func_array(Array, Array)
#8 internal_data/code_cache/templates/l1/s0/admin/option_macros.php(196): XF\Template\Templater->method(Object(XF\Entity\Option), 'renderDisplayCa...', Array)
#9 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(SV\AlertImprovements\XF\Template\Templater), Array, Array)
#10 internal_data/code_cache/templates/l1/s0/admin/addon_options.php(59): XF\Template\Templater->callMacro('option_macros', 'option_row', Array, Array)
#11 src/XF/Template/Templater.php(1315): XF\Template\Templater->{closure}(Object(SV\AlertImprovements\XF\Template\Templater), Array)
#12 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('addon_options', Array)
#13 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#14 src/XF/Mvc/Dispatcher.php(418): XF\Mvc\Renderer\Html->renderView('XF:AddOn\\Option...', 'admin:addon_opt...', Array)
#15 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#16 src/XF/Mvc/Dispatcher.php(360): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#17 src/XF/Mvc/Dispatcher.php(53): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#18 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
#19 src/XF.php(390): XF\App->run()
#20 admin.php(13): XF::runApp('XF\\Admin\\App')
#21 {main}
 
So exactly how does the new directional roles option work?
Xf>d and d>xf
Right now I just left them all to default setting.
I am guessing if xf>d is set then for example user group "registered" on XF will be given the role I set in the options on discord.

But if I do say d>xf then example a user on discord that has Mod role then registers on site they would be placed in Moderator user group?

Or am I thinking backwards on this? Lol
 
So exactly how does the new directional roles option work?
Xf>d and d>xf
Right now I just left them all to default setting.
I am guessing if xf>d is set the is say user group registered on XF will be given the role set in options in discord?

But if I do say d>xf then example a user on discord that has Mod role then registers on site they would be placed in Moderator user group?

Or am I thinking backwards on this? Lol
That depends. If you set the D>XF from example "Discord Role A" to "Forum Role B" then all people who have discord role A will gain the Forum Role B as well. However, it's currently not working properly. Using D>XF will give the user the forum roles, but erases their discord role that is supposed to sync.

And yes. XF>D is what it used to be. Giving people discord roles to whatever their forum role is. Of course, to what ever it has set to do :).
 
Nope. Uses a single server. Think it was asked before though, and not sure if Jaxel is any plans for it.

Thanks. I have no use for it with just single server integration but would pay far more if I could use this tool to integrate our single XF, with all 60 Discord servers I maintain for our Patreon patrons.
 
Top Bottom