XF2 [8WR] Discord Integration

XF2 [8WR] Discord Integration [Paid] 2.1.1.9

No permission to buy ($30.00)
Hi Jaxel,

I get an error at a fresh Install on XF2.0.1

Code:
XF\Db\DuplicateKeyException: MySQL query error [1062]: Duplicate entry 'discord' for key 'PRIMARY' in src/XF/Db/AbstractStatement.php at line 212
XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 174
XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 69
XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 74
XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 150
XF\Db\AbstractAdapter->insert() in src/addons/EWR/Discord/Setup.php at line 35
EWR\Discord\Setup->installStep2() in src/XF/AddOn/StepRunnerInstallTrait.php at line 60
EWR\Discord\Setup->installStepRunner() in src/XF/AddOn/StepRunnerInstallTrait.php at line 27
EWR\Discord\Setup->install() in src/XF/Admin/Controller/AddOn.php at line 378
XF\Admin\Controller\AddOn->actionInstall() in src/XF/Mvc/Dispatcher.php at line 249
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1880
XF\App->run() in src/XF.php at line 328
XF::runApp() in admin.php at line 13

What am I doing wrong? :( - I never installed it bevore or a other Plugin affil.. with Discord.
 
Hi Jaxel,

I get an error at a fresh Install on XF2.0.1

What am I doing wrong? :( - I never installed it bevore or a other Plugin affil.. with Discord.

As another user mentioned, [KL] User Improvements is one of the add-ons that will include a connected account setting for Discord. If you have that, you may be able to just uninstall it.

If you don't have that add-on, or don't want to remove it, you can search for 'Discord' in phpMyAdmin, and if there's 1 match in xf_connected_account_provider, since you're not using it/it doesn't work, you should be clear to delete it. Same for matching entries in xf_user_connected_accounts. After that, you should be able to install 8WR's add-on.
 
Got it thanks. This application works great so far!

I noticed that it said I could only use the link to download it three times. Does this link refresh each time you put out an update? How long do we get updates for?
 
Last edited:
Any way to make more then one bot? Would like to have a different bot assigned to another channel to post to the channel then the default bot

When posting an attachment, full image in the channel it doesn't post the image
 
Hey @Jaxel, just installed the addon and then directly after that installed UI.X 2, and I'm now getting this error:

Code:
An exception occurred: [TypeError] Argument 3 passed to XF\Template\Templater::fnCssUrl() must be of the type array, string given in src/XF/Template/Templater.php on line 1983

XF\Template\Templater->fnCssUrl()
call_user_func_array() in src/XF/Template/Templater.php at line 861
XF\Template\Templater->fn() in internal_data/code_cache/templates/l1/s2/public/helper_js_global.php at line 33
XF\Template\Templater->{closure}() in src/XF/Template/Templater.php at line 643
XF\Template\Templater->callMacro() in internal_data/code_cache/templates/l1/s2/public/PAGE_CONTAINER.php at line 2255
XF\Template\Templater->{closure}() in src/XF/Template/Templater.php at line 1230
XF\Template\Templater->renderTemplate() in src/XF/Pub/App.php at line 449
XF\Pub\App->renderPageHtml() in src/XF/App.php at line 1715
XF\App->renderPage() in src/XF/Mvc/Dispatcher.php at line 310
XF\Mvc\Dispatcher->render() in src/XF/Mvc/Dispatcher.php at line 44
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1880
XF\App->run() in src/XF.php at line 328
XF::runApp() in index.php at line 13

There are 3 different internal logs
Code:
TypeError: Argument 3 passed to XF\Template\Templater::fnCssUrl() must be of the type array, string given src/XF/Template/Templater.php:1983

#0 [internal function]: XF\Template\Templater->fnCssUrl(Object(XF\Template\Templater), true, '')
#1 src/XF/Template/Templater.php(861): call_user_func_array(Array, Array)
#2 internal_data/code_cache/templates/l1/s2/public/helper_js_global.php(33): XF\Template\Templater->fn('css_url', Array, true)
#3 src/XF/Template/Templater.php(643): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, Array)
#4 internal_data/code_cache/templates/l1/s2/public/PAGE_CONTAINER.php(2255): XF\Template\Templater->callMacro('helper_js_globa...', 'head', Array, Array)
#5 src/XF/Template/Templater.php(1230): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#6 src/XF/Pub/App.php(449): XF\Template\Templater->renderTemplate('PAGE_CONTAINER', Array)
#7 src/XF/App.php(1715): XF\Pub\App->renderPageHtml('\n\n\n\n\t\n\t\n\t\n\n\n\n\n\n...', Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#8 src/XF/Mvc/Dispatcher.php(310): XF\App->renderPage('\n\n\n\n\t\n\t\n\t\n\n\n\n\n\n...', Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#9 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#10 src/XF/App.php(1880): XF\Mvc\Dispatcher->run()
#11 src/XF.php(328): XF\App->run()
#12 index.php(13): XF::runApp('XF\\Pub\\App')
#13 {main}

array(4) {
  ["url"] => string(1) "/"
  ["referrer"] => string(37) "https://b.endercross.com/ewr-discord/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
Code:
Template error: Function uix_extra_css_urls is unknown src/XF/Template/Templater.php:840

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Function uix_ex...', '/var/www/sites/...', 840, Array)
#1 src/XF/Template/Templater.php(840): trigger_error('Function uix_ex...', 512)
#2 internal_data/code_cache/templates/l1/s2/public/helper_js_global.php(30): XF\Template\Templater->fn('uix_extra_css_u...', Array, false)
#3 src/XF/Template/Templater.php(643): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, Array)
#4 internal_data/code_cache/templates/l1/s2/public/PAGE_CONTAINER.php(2255): XF\Template\Templater->callMacro('helper_js_globa...', 'head', Array, Array)
#5 src/XF/Template/Templater.php(1230): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#6 src/XF/Pub/App.php(449): XF\Template\Templater->renderTemplate('PAGE_CONTAINER', Array)
#7 src/XF/App.php(1715): XF\Pub\App->renderPageHtml('\n\n\n\n\t\n\t\n\t\n\n\n\n\n\n...', Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#8 src/XF/Mvc/Dispatcher.php(310): XF\App->renderPage('\n\n\n\n\t\n\t\n\t\n\n\n\n\n\n...', Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#9 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#10 src/XF/App.php(1880): XF\Mvc\Dispatcher->run()
#11 src/XF.php(328): XF\App->run()
#12 index.php(13): XF::runApp('XF\\Pub\\App')
#13 {main}

array(4) {
  ["url"] => string(1) "/"
  ["referrer"] => string(37) "https://b.endercross.com/ewr-discord/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
Code:
ErrorException: Template error: Template public:uix_socialMedia is unknown src/XF/Template/Templater.php:564

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Template public...', '/var/www/sites/...', 564, Array)
#1 src/XF/Template/Templater.php(564): trigger_error('Template public...', 512)
#2 src/XF/Template/Templater.php(519): XF\Template\Templater->getTemplateData('public', 'uix_socialMedia')
#3 src/XF/Template/Templater.php(1229): XF\Template\Templater->getTemplateCode('public', 'uix_socialMedia')
#4 src/XF/Template/Templater.php(1304): XF\Template\Templater->renderTemplate('uix_socialMedia', Array)
#5 internal_data/code_cache/templates/l1/s2/public/PAGE_CONTAINER.php(1424): XF\Template\Templater->includeTemplate('public:uix_soci...', Array)
#6 src/XF/Template/Templater.php(1230): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#7 src/XF/Pub/App.php(449): XF\Template\Templater->renderTemplate('PAGE_CONTAINER', Array)
#8 src/XF/App.php(1715): XF\Pub\App->renderPageHtml('\n\n\n\n\t\n\t\n\t\n\n\n\n\n\n...', Array, Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#9 src/XF/Mvc/Dispatcher.php(310): XF\App->renderPage('\n\n\n\n\t\n\t\n\t\n\n\n\n\n\n...', Object(XF\Mvc\Reply\View), Object(XF\Mvc\Renderer\Html))
#10 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#11 src/XF/App.php(1880): XF\Mvc\Dispatcher->run()
#12 src/XF.php(328): XF\App->run()
#13 index.php(13): XF::runApp('XF\\Pub\\App')
#14 {main}

array(4) {
  ["url"] => string(1) "/"
  ["referrer"] => string(37) "https://b.endercross.com/ewr-discord/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

I've tried rebuilding the addon and disabling and then enabling. I'm running v2.0.0.5 of your addon and v2.0.1.2.0 of UI.X. It works fine in the default theme.

Edit: am now also getting errors on trying to edit per-node discord settings:
Code:
XF\PrintableException: Macro admin:option_macros :: option_row() error: An error occurred while connecting with Discord. Please try again later. src/addons/EWR/Discord/Repository/Discord.php:50

#0 src/addons/EWR/Discord/Option/Roles.php(12): EWR\Discord\Repository\Discord->getGuild('/roles')
#1 [internal function]: EWR\Discord\Option\Roles::renderOption(Object(XF\Entity\Option), Array)
#2 src/XF/Entity/Option.php(75): call_user_func(Array, Object(XF\Entity\Option), Array)
#3 [internal function]: XF\Entity\Option->renderDisplayCallback(Array)
#4 src/XF/Template/Templater.php(920): call_user_func_array(Array, Array)
#5 internal_data/code_cache/templates/l1/s0/admin/option_macros.php(194): XF\Template\Templater->method(Object(XF\Entity\Option), 'renderDisplayCa...', Array)
#6 src/XF/Template/Templater.php(643): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, Array)
#7 internal_data/code_cache/templates/l1/s0/admin/option_macros.php(478): XF\Template\Templater->callMacro('option_macros', 'option_row', Array, Array)
#8 src/XF/Template/Templater.php(643): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, Array)
#9 internal_data/code_cache/templates/l1/s0/admin/option_list.php(64): XF\Template\Templater->callMacro('option_macros', 'option_form_blo...', Array, Array)
#10 src/XF/Template/Templater.php(1230): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#11 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('option_list', Array)
#12 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#13 src/XF/Mvc/Dispatcher.php(332): XF\Mvc\Renderer\Html->renderView('XF:Option\\Listi...', 'admin:option_li...', Array)
#14 src/XF/Mvc/Dispatcher.php(303): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#15 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#16 src/XF/App.php(1880): XF\Mvc\Dispatcher->run()
#17 src/XF.php(328): XF\App->run()
#18 admin.php(13): XF::runApp('XF\\Admin\\App')
#19 {main}

array(4) {
  ["url"] => string(37) "/admin.php?options/groups/EWRdiscord/"
  ["referrer"] => string(61) "https://b.endercross.com/admin.php?options/groups/EWRdiscord/"
  ["_GET"] => array(1) {
    ["options/groups/EWRdiscord/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 
Last edited:
I run UI.X also with no issues.

I had UI.X installed first though. Maybe if you try installing UI.X and then this addon it will work okay.
I did a clean install, 2 different servers, and it's still giving me errors. Unsurprisingly Jaxel was right.
 
Untitled.webp

Why does it constantly want to download some file? To check I unlinked my account and it wanted me to download this file. If I click Authorize it gives me the download option to open or save. Only after I save it, exit Microsoft Edge, and retry will it work. My users keep reporting this. Windows 10 edge browser. This is not good and most people will not want to download a strange file to their computer.


People using Google Chrome get this when they click Authorize
show1.webp

I am using no other edits or addons.

Takes users multiple times and sometimes not at all. I did notice this yesterday too. Took me a few times, had to exit out of Discord and Windows Edge browser. Seems Chrome does not respond well at all. It does work for me but I have to download that file. Most people will see this as unsafe.
SHOW555.webp
 
Last edited:
To resolve conflict between @katsulynx addon and this. I figured out this work around.

If you have already installed Kat's addon, you'll need to go into PHPMyAdmin, find the xf_connected_account_provider table, open it and drop the discord row. Then install @Jaxel addon. Members will still be able to login using Discord, just be sure to use the same key and secret you configured for Kat's addon if you already did.

If you have not installed Kat's addon yet:
1) install this addon, but don't configure it yet as you will lose your settings
2) install Kat's addon, no need to fill anything out for Discord as Jaxel's addon will over ride it.
3) Go into your add-on list and on the pull-down menu for Jaxel's addon select rebuild. This will put Jaxel's Discord fields back in the options.
 
Why does it constantly want to download some file? To check I unlinked my account and it wanted me to download this file. If I click Authorize it gives me the download option to open or save. Only after I save it, exit Microsoft Edge, and retry will it work. My users keep reporting this. Windows 10 edge browser. This is not good and most people will not want to download a strange file to their computer.


People using Google Chrome get this when they click Authorize


I am using no other edits or addons.

Takes users multiple times and sometimes not at all. I did notice this yesterday too. Took me a few times, had to exit out of Discord and Windows Edge browser. Seems Chrome does not respond well at all. It does work for me but I have to download that file. Most people will see this as unsafe.

I didn't find a solution, necessarily, but I had a similar issue with another connected account type (Amazon, I think), and inconsistent between browsers as well, so this might not be related to this add-on. I removed the connected account type that was messing up, recreated it, and experienced no further issues. I assume it's caused by some misfire on the initial authorization with the forum.

Might want to see if Jaxel has a better solution than that.
 
Top Bottom