XF2 [8WR] Discord Integration

XF2 [8WR] Discord Integration [Paid] 2.1.1.9

No permission to buy ($30.00)
It seems like I keep getting
"An error occurred while connecting with Discord. Please try again later." when trying to connect or login with a Discord account.
 
@Jaxel any updates on fixing up the connected account info?

1574120334155.webp

I get that the avatar changes constantly, so maybe it's best to change that to the users nick+ID and UserID instead.. such as:

Skyrider#1337 (133631162894516225)

What I find even more strange, is that the username that you see below the avatar doesn't work after some time either:

1574120471456.webp

Even when I go to connected_account_associated_discord and remove the avatar img src, username doesn't appear at all. Apparently besides the avatar, $providerData.username breaks as well.
 
One more thing. I noticed that as of today from one user (and one in the past), some of them are getting:

Oops! We ran into some problems.
This account's email is already associated with another member. Please log into that account to associate this account.

But I can't find any indication that it is associated with another member (at least, not on the forums). Not even when I search the database for the discord ID which comes up with no results. The email belongs to the user that is trying to link it.. So not sure what the deal is. The user in question is also logged in.

Any idea how can I solve this?
 
Nvm, solved the issue with the above reply but I'm unable to remove it. Issue is caused that the Discord's email you are trying to link with your forum account is used by another user on the forums.

Anycase. Would appreciate a fix regarding removing avatar and showing UserID instead.

Also.. Can you make it so we can look up discord ID's in the adminCP to see who the ID is tied to?
 
For some reason, discord roles are not always given from xenforo roles (in this case forum registered member which is their primary role.) (XF -> Discord) , at least.. not right away. Even when I run the sync manually (while the user is linked on discord) role isn't given out on discord. Sometimes it takes ages, and sometimes I have to adjust their profiles in the adminCP (without changing anything) to force a sync, which also doesn't always work. Any idea as to why that might be?
 
Last edited:
Got that issue, too. AFAIR, I have also reported it numerous times :)
Yea, just a shame nothing is being done about it. Again, I get that the avatar URL might be updated if the user changes the avatar. But it doesn't really "need" the avatar perse.. User/ID is enough, especially for administration to keep a track of the ID's connected for easy checkups.

Because all I can see in the AdminCP on the user check ups are their avatar, nickname and a @me link. No full UserID is mentioned. I have to check their discord ID in the database all the time to find to whom it has been linked to on the forums.

Speaking off.. I noticed that the cron only updates 1 person at a time (if its regarding 1 role sync), rather than multiple.. Is this normal? Sometimes it never does unless I specifically run it manually.. then it gives out roles.. which, I find odd.

Small example:

1574637909922.png

Top given out when I manually ran the cron. Then the new cron I set up (per 2 minutes) didn't do anything until I started another cron manually, which resulted in the below role being given. Oddly enough however (as mentioned above), it only syncs 1 person at a time for a specific role (max 2, but rarely) rather than giving out to all members at once.

Another example:

1574639143387.png

12:37, sync manually. 12:45, synced with 3 crons added per minute base.

Here what happens if I run the cron manually 5x.

1574639226355.png

Why on earth would a manual cron be more effective over an automated cron? The automated cron takes way more minutes to add roles over manual crons, which I find odd.

I have a bot who is more API extensive which still isn't hitting the limit but grants over 3k roles within 2 hours. I have a feeling your add-on is very careful on the API.
 
Last edited:
I still can't reproduce any sync issues you guys are having.
What happens if you add a new role and apply it to all existing discord users? (XF -> Discord). It's been 24 hours, and it still hasn't added the discord roles to all 300+ users. I know bots that can add 3.000 roles on discord within hours, without hitting the API. So it should not be a limitation issue.
 
You can redefine the cron job frequency. By default it does 1 account every 5 minutes.
Does it sync exactly every 5 minutes to all your 3,514 members on your discord server (if they are linked by any chance) ? I noticed sometimes there's a gap between syncs, like 10/20 min or more. And I'm talking about 1 role sync. Even when I set the sync to 1 minute, there's still random gaps.

If I may ask though. Why is the sync set-up to only sync 1 at a time? Why not in batches? For larger boards (both forum & discord), cron jobs with 1 per xx minute(s) may be inconvenient as it would take forever for roles to catch up.

I did notice the following though:

1574765406930.png

See the next run timestamp:

1574765436346.png

^ And my system timestamp.

Just refreshing the cron list now shows the proper next run, but there was a 3 minutes delay. Maybe because the cron job seems to get stuck somewhere? When I run the cron job by php cmd.php (CLI cron) it takes forever to go forward. So the automated cron is indeed getting suck. But when I run it manually, it instantly says:

Cron entry was run successfully.

But I can't see why the cron job takes so long to load, as it doesn't create any debug logs. I can tell for sure that the discord cron job sometimes runs over a few minutes.

As I mentioned to you on Discord:

Maybe instant role give would be nice to have with certain conditions without a cron job, such as:

Gets a role on the forums and is discord linked --> Checks if this role is part of XF-D sync --> System checks user ID --> Checks discord role --> Missing? --> Add it.

As I noticed that I manually had to remove/re-add the roles on certain users for them to get the discord role, while they should have gotten it days ago. I have no clue as to why, because I can't see what exactly the cron jobs are doing and how they could have missed those users. I'd be glad to attempt to replicate it, but this only appears to be an issue on larger boards.

While among others, if there is a role with a lot of members that needs to be synced, a batch job would do the trick for this so it can queue how many to do per minute. And output any errors it might have, such as if by any chance the API (returning errors).
 
Last edited:
I still can't reproduce any sync issues you guys are having.

Do you consider the "connected account info" thing to be a sync issue, too? I don't know the mechanisms of this and if this falls under sync issues or not.
any updates on fixing up the connected account info?

---

? Why not in batches? For larger boards (both forum & discord), cron jobs with 1 per xx minute(s) may be inconvenient as it would take forever for roles to catch up.
I can second this. Assigned a new group in XF on August 18th, got synced to Discord on November 26th (yes, the user was on the Discord server before, didn't leave and got a different group earlier this year).
 
Hmm, I have no errors related to this add-on in the error log, but when I post a new thread in my newsroom board, it doesn't auto-post to Discord. I do have it set up to auto-post new threads. The "Discord" text in node list is highlighted light blue as it being setup.

1574784163292.webp
 
@KensonPlays Does the bot you've set up have access to the specific channel on discord?

Also:

My bot is not auto-posting messages to my channels
The bot needs to complete a handshake at least once with the Discord servers before it can auto-post messages. In your Admin CP, after you have set everything up, you will find a "Test Connection" button next to the Server ID (guild) field. Click this button. When you see your bot come "online" on your server's user list, you know you're done. That's it! Your bot will log off when you navigate away from your Admin CP; but you shouldn't ever need to click the connect button again.
 
@KensonPlays Does the bot you've set up have access to the specific channel on discord?

Also:
I have already done the 'handshake' a week or so ago. All bots have "Admin" perms so yes, it should be able too.

Edit: Odd... I removed the discord info from the discord page on the board and readded it, NOW it works.
 
Last edited:
Jaxel updated XF2 [8WR] Discord Integration with a new update entry:

2.1.0.8 - CHANGELOG

  • The account sync cron job has been made faster. Instead of syncing 1 account every 5 minutes (which limits to 288 accounts per day); the cron has been updated to run every 1 minute (which limits to 1440 accounts per day).
  • You can now redefine the sync buffer limit on the options page. In previous versions, an account could only be synced with Discord once every 24 hours. You can now redefine this limit to make the buffer longer or shorter if needed.
  • The connected accounts...

Read the rest of this update entry...
 
@Revenact you should receive a separate email with the download link with each update. Have you received it by any chance by this time? I think it's send out in batches.
 
Top Bottom