XF2 [8WR] Discord Integration

XF2 [8WR] Discord Integration [Paid] 2.1.1.9

No permission to buy ($30.00)
@Jaxel I am curious whether this is a bug, or is intended functionality and would be a feature request. Currently, when I have the add-on configured to post about new media (photo) uploads, I get the following message:

Screen Shot 2022-10-16 at 16.28.36.webp

The name of the photo file is displayed in the embed, but I am wanting the photo itself to be displayed such that folks can see and react to the photo within the Discord, rather than have to click out to it. Is this possible?

I've already played around with the
Code:
EWRdiscord_x_posted_new_media_y
phrase that the add-on uses to format the message, but this doesn't affect the embed at all. I thought that maybe appending 'full' to the URL would do it, but the presence of the embed is (I think) over-riding what Discord would normally do by default, which is to preview the image when it links directly to an image file.
 
I don't use XFMG, so I can't test it. But the code clearly sends the image URL as an embed.
Well with my installation, at least, I can confirm 100% that the embed is sending the URL for previewing the image within a webpage on XenForo, and is not sending the image URL.

As an example, using a media image here on the XenForo forum, the add-on will send the following link in the embed: https://xenforo.com/community/media/finished.4745/

In order to have the image previewed within Discord, the direct link needs to be posted:

Now I'm even less sure if what I am seeing is a bug or not haha

EDIT: I am happy to test posting images, configuring things, etc. as my implementation is not yet productionalized.
 
The link and the embed are different URLs. It's sending the embed as:
Code:
$image = $this->getCurrentThumbnailUrl(true);
 
The link and the embed are different URLs. It's sending the embed as:
Code:
$image = $this->getCurrentThumbnailUrl(true);
Gotcha - so it sounds like the intended behavior is for a thumbnail of the image to appear, rather than the whole image, correct?

Why do you think, with all defaults left as-is, that the thumbnail is not appearing for a JPEG image file uploaded to Media?

EDIT: Just to demonstrate; this is what happens when a JPEG is uploaded via XFMG:
Screen Shot 2022-10-16 at 19.20.45.png

Both the link in the text (before the embed) and the link of the title of the embed, link to https://XXX/media/examplejpegupload-jpeg.39/
 
Does your forum allow non-registered users to see images/thumbnails?
Yes - and I can confirm that by opening the preview link sent by the Discord integration (the https://XXX/media/examplejpegupload-jpeg.39/) while not logged in/unregistered, as well as by observing that Discord previews the image in full (so not as a thumbnail) as expected when I simply copy-paste and post the direct image link (ending in /full, so https://XXX/media/examplejpegupload-jpeg.39/full).
 
is there any way to ping a server role?
EX: 🎮│Gamer

only @everyone & @here are working for me

Can you elaborate on this a bit - do you mean pinging a server role in Discord? That would just be '@[server role]' if you have the permission to do so.

Does your forum allow non-registered users to see images/thumbnails?
I still haven't been able to get this working after a re-install, but I've determined a workaround that is more flexible so this is resolved on my part (y)

I dont even know what this new forum channel type is... I dont have access to it on my servers.
I am still very keen to see this supported, as a substantial (and perhaps majority) of new threads/posts in my community's Discord are in forum channels. Being able to automatically cross-post forum content in the server is a major aspect of the value-add of this add-on for my community, at least... Is support of forum channels something you intend to support with your add-on at all @Jaxel?
 
I installed the plugin and configured following the video. However I have two problems. XF is version 2.2.10.

1. I am getting errors in the server log.

Stack trace​

#0 src/addons/EWR/Discord/Repository/Discord.php(329): usort(false, Object(Closure))
#1 src/addons/EWR/Discord/Option/Channels.php(13): EWR\Discord\Repository\Discord->parseChannels(false)
#2 src/XF/Entity/Option.php(79): EWR\Discord\Option\Channels::renderOption(Object(XF\Entity\Option), Array)
#3 src/XF/Template/Templater.php(1191): XF\Entity\Option->renderDisplayCallback(Array)
#4 internal_data/code_cache/templates/l1/s0/admin/option_macros.php(216): XF\Template\Templater->method(Object(XF\Entity\Option), 'renderDisplayCa...', Array)
#5 src/XF/Template/Templater.php(824): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, NULL)
#6 internal_data/code_cache/templates/l1/s0/admin/option_macros.php(523): XF\Template\Templater->callMacro('option_macros', 'option_row', Array, Array)
#7 src/XF/Template/Templater.php(824): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, NULL)
#8 internal_data/code_cache/templates/l1/s0/admin/option_list.php(90): XF\Template\Templater->callMacro('option_macros', 'option_form_blo...', Array, Array)
#9 src/XF/Template/Templater.php(1651): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, NULL)
#10 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('option_list', Array)
#11 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#12 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('XF:Option\\Listi...', 'admin:option_li...', Array)
#13 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#14 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#15 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#16 src/XF/App.php(2353): XF\Mvc\Dispatcher->run()
#17 src/XF.php(524): XF\App->run()
#18 admin.php(13): XF::runApp('XF\\Admin\\App')
#19 {main}


Request state​

array(4) {
["url"] => string(37) "/admin.php?options/groups/EWRdiscord/"
["referrer"] => string(48) "https://forum.****.com/admin.php?options/"
["_GET"] => array(1) {
["options/groups/EWRdiscord/"] => string(0) ""
}
["_POST"] => array(0) {
}
}


2. Whenever I attempt to connect an existing account to a Discord account the Discord authentication proceeds but returns with
Code:
An error occurred while connecting with Discord. Please try again later.

The Discord Oauth2 is configured with the requested redirects:
Code:
https://forum.*****.com/connected_account.php
https://forum.*****.com/connected_discord.php

Any ideas why these would be happening?
 
Hey, for some reason I haven't been getting any updates for this plugin pushed to my email to notify me, unless your system doesn't do that anymore. I've also lost my original email. I was wondering if I could PM you and get a message resent to my email?
 
@Jaxel bug report: this addon considers users in a XF rejected state to be valid for synching and for getting roles. They should probably be treated like banned users.
 
Is it possible to add a feature "force role sync" for when you eg created new roles? So it compares the forum / discord users if the role is missing and instantly add them without having to wait days for it to catch up.
 
Is it possible to add a feature "force role sync" for when you eg created new roles? So it compares the forum / discord users if the role is missing and instantly add them without having to wait days for it to catch up.
The reason why role syncs are rotated is to avoid Discord rate limiting.
 
I assumed as much. But isn't the number quite high before being limited? Currently it's doing a few per hour (or more) if you set up the role sync after the users already have the role.

It's much faster in syncing if you set up the sync prior the user getting the role.

I don't mind waiting a bit. But having to wait days for 100 roles to sync up is a tad long.
 
I don't know why but for a few months now the Xenforo roles of Verified member are not syncing over to Discord correctly. What can I do to trouble shoot this?

MineOne.webp
My connected account looks like this and has been connected for some time.

Any new user who connects their account it looks like this
SHow2.webp
With a weird link at the bottom to @me
The roles never sync up.
 
Last edited:
I assumed as much. But isn't the number quite high before being limited? Currently it's doing a few per hour (or more) if you set up the role sync after the users already have the role.

It's much faster in syncing if you set up the sync prior the user getting the role.

I don't mind waiting a bit. But having to wait days for 100 roles to sync up is a tad long.
It's actually set to do one per MINUTE. So it can do 60 an hour.

But the way cron jobs work in XenForo, is they only run when your forum is active. So if no one is visiting your forum, cron jobs get delayed. In order to get around that, you would have to set up a server based cron trigger.

I don't know why but for a few months now the Xenforo roles of Verified member are not syncing over to Discord correctly. What can I do to trouble shoot this?

View attachment 284555
My connected account looks like this and has been connected for some time.

Any new user who connects their account it looks like this
View attachment 284556
With a weird link at the bottom to @me
The roles never sync up.
Check your logs and your sync settings.
 
It's actually set to do one per MINUTE. So it can do 60 an hour.

But the way cron jobs work in XenForo, is they only run when your forum is active. So if no one is visiting your forum, cron jobs get delayed. In order to get around that, you would have to set up a server based cron trigger.


Check your logs and your sync settings.
It is working now. Was user error.
 
Hi i get allways this error:

Error: Call to undefined method GuzzleHttp\Psr7\Response::json() in src/addons/EWR/Discord/Repository/Discord.php at line 46
  1. EWR\Discord\Repository\Discord->getGuild() in src/addons/EWR/Discord/Pub/Controller/Index.php at line 46
  2. EWR\Discord\Pub\Controller\Index->actionBotPost() in src/XF/Mvc/Dispatcher.php at line 352
  3. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 259
  4. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
  5. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
  6. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2483
  7. XF\App->run() in src/XF.php at line 524
  8. XF::runApp() in index.php at line 20
 
Top Bottom