Whoops, I deleted the wrong link from the OP. (There were two plugins, I should have deleted the OAuth one, but instead I deleted the link to the bot!)
Uninstall that plugin asap, as Core now supports Discord OAuth out of the box.
Do we know what the status might be of us getting this plugin to automatically update users at the time of their group joining instead of manually syncing? And potentially a way to tell it what groups/roles to sync together instead of it taking over / creating the roles itself?
First time thatās been requested so as you might imagine, itās not even in backlog as it were.
That would be quite tricky as the bot runs on a discrete thread. Youād have to add a method to message the bot and ensure itās listening for the request. An interesting exercise technically but not trivial.
Alternatively it might be better to explore a direct API call alternative instead of using the bot. Then you have to decide whether that warrants delivery in a different plugin based on discrete calls, not a bot.
Thatās a not a bad idea but why do you need them to be different out of interest?
This is more practical.
PR accepted. Unfortunately my time is very limited to work on significant features without funding.
Well as it is now, it appears to base the roles off of the ānameā instead of the title. Which means my roles on discord end up having dashing and no spaces for example. So I suppose an alternative solution is to have it base the roles not on the name but instead the full name, or default title.
That said, there are potentially groups on discourse that I would not want it to sync at all to discord.
Could we have the bot auto sync at a scheduled time in the meantime while an API method is explored? Something like, check once every hour, or 24, etc ?
I believe it would be possible to add ārepeat this again after x hoursā like functionality no problem.
The problem with that though is that will stop every time the bot goes down (e.g. on a reboot).
The absolute best approach would be to either:
a) add a discrete API call connected to a sidekiq job to this plugin OR
b) write a new plugin that used normal API calls instead of utilising a bot (and incorporate a batch sync in that).
Either of those things are going to need sponsorship or a PR.
Iām using your plugin currently and have everything at a workable point. It seems really nice, good work!
However, I have some questions: now that I have everything running I need my users to login via Discord OAuth. This creates a new account.
What is the best way for me to manage this? Do I need to merge the new and old accounts? I tried this with my Admin account and get the error āYou donāt have permission to execute command discsync!ā when trying to manually !discsync.
Additionally, it has not yet copied across any roles from my discourse.
For awareness, my discord account shows in my options as being an associated account.
This is not a feature of the plugin, this is a core feature. Discord OAuth is shipped with Discourse by default.:
The above settings appear regardless of you adding this plugin to your Discourse.
If you login via the social account, so long as the registration emails match, the account should be recognised and no new account will be created. If however, the user has signed up for Discord using a different email to Discourse, yes, of course, there is no way for it to know it is the same user, so a new account will be created.
Your admin account on the Discord server? Also did you authorise the bot?
Ack to that. I can just merge accounts with non-matching emails in a worst case scenario.
Yep, thatās right. Iām the owner of the discord and discourse instances. The result of āPing!ā Is āPong!ā. No roles have been migrated from the Discourse to Discord.
The bot is on my Discord server and has admin privs. Can I clarify what you mean by authorising?
My hunch is that your rights or that of the bot on the Discord server are not set up correctly somehow. Iām just refreshing my memory with this plugin as I work on dozens. My last change to this one was a while back!
Roger! Iāve had a quick check on my side, so for your awareness I am listed as the server owner and I have admin rights.
EDIT: Can we clarify what rights the bot requires? Itās currently listed as an admin (this was granted to it by a role as opposed to the OAuth invite, though).