Well, I didn’t go through that way…
I’ve forked your repo, and made a new plugin that suited our needs:
It basically syncs all groups with Discord roles, but automatically. When a user is added or removed from a group, it will run a sync job and update their roles according to the public groups. In addition, I’ve added a setting to mark a “verified role”, that will be added to all users who have a Discourse account. And also it supports adding a list of safe roles, which the bot will ignore when syncing users (useful, for example, if wanting to set different admins and mods in the server than in the forum).
I’ve also added a username-nickname syncer. It can enforce users to have the same server nickname as the forum username.
I’ll open a #plugin topic after cleaning up a couple of things, as maybe someone can find it useful.