XF2 [8WR] Discord Integration

XF2 [8WR] Discord Integration [Paid] 2.1.1.8

No permission to buy ($30.00)

Hyprem

Member
Jus a small Optimization Request. Is it possible to ping certain Roles in Discord? Liek when I add Discord to a Node I would like to notify the specific Discord Role with @role so tehy get a push. I tried this when going to Nodes->Node->Discord->{user} Shares a new Post: {title} ({url}) @TESTROLE
 

Jaxel

Well-known member
Jus a small Optimization Request. Is it possible to ping certain Roles in Discord? Liek when I add Discord to a Node I would like to notify the specific Discord Role with @role so tehy get a push. I tried this when going to Nodes->Node->Discord->{user} Shares a new Post: {title} ({url}) @TESTROLE
It's specifically programmed NOT to ping roles.
 

StarArmy

Well-known member
Bug report: When a user posts to a forum that requires moderator approval, the bot posts a link to the topic. When the post gets approved, the bot posts a second, duplicate link to the topic. Ideally it should send the notification only once, at the time the topic is approved.
 

Jonathan Carl

Active member
Just installed latest version of the add-on with board version v2.2.4. I have received multiple error logs.

ErrorException: Template error: [E_WARNING] usort() expects parameter 1 to be array, bool given src/addons/EWR/Discord/Repository/Discord.php:329
Apr 12, 2021 at 8:28 PM

Code:
#0 [internal function]: XF\Template\Templater->handleTemplateError(2, '[E_WARNING] uso...', '/var/www/vhosts...', 329, Array)
#1 src/addons/EWR/Discord/Repository/Discord.php(329): usort(false, Object(Closure))
#2 src/addons/EWR/Discord/Option/Channels.php(13): EWR\Discord\Repository\Discord->parseChannels(false)
#3 [internal function]: EWR\Discord\Option\Channels::renderOption(Object(XF\Entity\Option), Array)
#4 src/XF/Entity/Option.php(77): call_user_func(Array, Object(XF\Entity\Option), Array)
#5 [internal function]: XF\Entity\Option->renderDisplayCallback(Array)
#6 src/XF/Template/Templater.php(1166): call_user_func_array(Array, Array)
#7 internal_data/code_cache/templates/l1/s0/admin/option_macros.php(206): XF\Template\Templater->method(Object(XF\Entity\Option), 'renderDisplayCa...', Array)
#8 src/XF/Template/Templater.php(799): XF\Template\Templater->{closure}(Object(ThemeHouse\UserImprovements\XF\Template\Templater), Array, NULL)
#9 internal_data/code_cache/templates/l1/s0/admin/option_macros.php(501): XF\Template\Templater->callMacro('option_macros', 'option_row', Array, Array)
#10 src/XF/Template/Templater.php(799): XF\Template\Templater->{closure}(Object(ThemeHouse\UserImprovements\XF\Template\Templater), Array, NULL)
#11 internal_data/code_cache/templates/l1/s0/admin/option_list.php(77): XF\Template\Templater->callMacro('option_macros', 'option_form_blo...', Array, Array)
#12 src/XF/Template/Templater.php(1626): XF\Template\Templater->{closure}(Object(ThemeHouse\UserImprovements\XF\Template\Templater), Array, NULL)
#13 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('option_list', Array)
#14 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#15 src/XF/Mvc/Dispatcher.php(458): XF\Mvc\Renderer\Html->renderView('XF:Option\\Listi...', 'admin:option_li...', Array)
#16 src/XF/Mvc/Dispatcher.php(440): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#17 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#18 src/XF/Mvc/Dispatcher.php(58): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#19 src/XF/App.php(2326): XF\Mvc\Dispatcher->run()
#20 src/XF.php(488): XF\App->run()
#21 admin.php(13): XF::runApp('XF\\Admin\\App')
#22 {main}

Code:
Request state
array(4) {
  ["url"] => string(37) "/admin.php?options/groups/EWRdiscord/"
  ["referrer"] => string(62) "https://www.*************.com/admin.php?options/groups/EWRdiscord/"
  ["_GET"] => array(1) {
    ["options/groups/EWRdiscord/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 
Last edited:

StarArmy

Well-known member
I'm not an expert, but based on the error messages above, it looks to me like the Themehouse User Improvements plugin has altered the way users are handled, and the Discord plugin is trying to get a list of users' groups and it's getting unexpected results, causing an error.
 

erich

Active member
Jaxel, curious if this would send new articles created in Article Management System to discord channels?
 

Jonathan Carl

Active member
I uninstalled Themehouse, and re-installed the add-on. The error appears again.

Code:
#0 [internal function]: XF\Template\Templater->handleTemplateError(2, '[E_WARNING] uso...', '/var/www/vhosts...', 329, Array)
#1 src/addons/EWR/Discord/Repository/Discord.php(329): usort(false, Object(Closure))
#2 src/addons/EWR/Discord/Option/Channels.php(13): EWR\Discord\Repository\Discord->parseChannels(false)
#3 [internal function]: EWR\Discord\Option\Channels::renderOption(Object(XF\Entity\Option), Array)
#4 src/XF/Entity/Option.php(77): call_user_func(Array, Object(XF\Entity\Option), Array)
#5 [internal function]: XF\Entity\Option->renderDisplayCallback(Array)
#6 src/XF/Template/Templater.php(1166): call_user_func_array(Array, Array)
#7 internal_data/code_cache/templates/l1/s0/admin/option_macros.php(206): XF\Template\Templater->method(Object(XF\Entity\Option), 'renderDisplayCa...', Array)
#8 src/XF/Template/Templater.php(799): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, NULL)
#9 internal_data/code_cache/templates/l1/s0/admin/option_macros.php(501): XF\Template\Templater->callMacro('option_macros', 'option_row', Array, Array)
#10 src/XF/Template/Templater.php(799): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, NULL)
#11 internal_data/code_cache/templates/l1/s0/admin/option_list.php(77): XF\Template\Templater->callMacro('option_macros', 'option_form_blo...', Array, Array)
#12 src/XF/Template/Templater.php(1626): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, NULL)
#13 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('option_list', Array)
#14 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#15 src/XF/Mvc/Dispatcher.php(458): XF\Mvc\Renderer\Html->renderView('XF:Option\\Listi...', 'admin:option_li...', Array)
#16 src/XF/Mvc/Dispatcher.php(440): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#17 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#18 src/XF/Mvc/Dispatcher.php(58): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#19 src/XF/App.php(2326): XF\Mvc\Dispatcher->run()
#20 src/XF.php(488): XF\App->run()
#21 admin.php(13): XF::runApp('XF\\Admin\\App')
#22 {main}
 
Last edited:

Ivancas

Active member
I'm not an expert, but based on the error messages above, it looks to me like the Themehouse User Improvements plugin has altered the way users are handled, and the Discord plugin is trying to get a list of users' groups and it's getting unexpected results, causing an error.
Any thoughts about my question above?
 

StarArmy

Well-known member
Bug report: When a user posts to a forum that requires moderator approval, the bot posts a link to the topic. When the post gets approved, the bot posts a second, duplicate link to the topic. Ideally it should send the notification only once, at the time the topic is approved.
Bump for visibility
 
Top