Discord Bot Bausatz đŸ€–

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.

The bot plugin is THIS one:

I’ve altered the OP accordingly, sorry about that!!

3 „GefĂ€llt mir“

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?

2 „GefĂ€llt mir“

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.

3 „GefĂ€llt mir“

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.

Appreciate the responses :slight_smile:

2 „GefĂ€llt mir“

This is on purpose to avoid keying off a description field which can:

a) have spaces in it
b) not be unique

(and is usually a terrible idea in computer science)

However, if there is a safe way of improving this I’m all ears. I appreciate it doesn’t ‘look’ very nice :slight_smile:

The plugin could definitely have additional functionality added to turn sync off for specific groups, at the admin’s discretion. PR accepted.

4 „GefĂ€llt mir“

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 ?

1 „GefĂ€llt mir“

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.

1 „GefĂ€llt mir“

Fair enough. Thanks for the help.

2 „GefĂ€llt mir“

Hallo.

Ich verwende aktuell dein Plugin und habe alles auf einem funktionsfÀhigen Stand. Es sieht wirklich gut aus, gute Arbeit!

Ich habe jedoch einige Fragen: Jetzt, wo alles lĂ€uft, mĂŒssen sich meine Benutzer ĂŒber Discord OAuth anmelden. Dadurch wird ein neues Konto erstellt.

Was ist der beste Weg, dies zu verwalten? Muss ich die neuen und alten Konten zusammenfĂŒhren? Ich habe dies mit meinem Admin-Konto versucht und erhalte den Fehler „You don’t have permission to execute command discsync!

2 „GefĂ€llt mir“

Vielen Dank fĂŒr dein Interesse an dem Plugin!

Dies ist keine Funktion des Plugins, sondern eine Kernfunktion. Discord OAuth ist standardmĂ€ĂŸig in Discourse enthalten:

Die oben genannten Einstellungen werden angezeigt, unabhĂ€ngig davon, ob du dieses Plugin zu deinem Discourse hinzufĂŒgst oder nicht.

Wenn du dich ĂŒber das soziale Konto anmeldest und die Registrierungs-E-Mail-Adressen ĂŒbereinstimmen, wird das Konto erkannt und es wird kein neues Konto erstellt. Wenn sich der Benutzer jedoch fĂŒr Discord mit einer anderen E-Mail-Adresse angemeldet hat als fĂŒr Discourse, kann das System natĂŒrlich nicht wissen, dass es sich um denselben Benutzer handelt, und es wird ein neues Konto erstellt.

Gemeint ist dein Admin-Konto auf dem Discord-Server? Hast du auch den Bot autorisiert?

Was ist das Ergebnis von Ping!?

4 „GefĂ€llt mir“

Stimme dem zu. Im schlimmsten Fall kann ich einfach Konten mit nicht ĂŒbereinstimmenden E-Mail-Adressen zusammenfĂŒhren.

Ja, das stimmt. Ich bin der Besitzer der Discord- und Discourse-Instanzen. Das Ergebnis von „Ping!" ist „Pong!". Es wurden keine Rollen von Discourse nach Discord migriert.

Der Bot befindet sich auf meinem Discord-Server und verfĂŒgt ĂŒber Admin-Rechte. Kannst du bitte prĂ€zisieren, was du mit „autorisiert" meinst?

3 „GefĂ€llt mir“

Hast du diesen Schritt bereits abgeschlossen? (Ich prĂŒfe nur alle Voraussetzungen, das hast du höchstwahrscheinlich schon erledigt).

2 „GefĂ€llt mir“

Ja, ich habe :slight_smile:

1 „GefĂ€llt mir“

Mein BauchgefĂŒhl sagt mir, dass deine Rechte oder die des Bots auf dem Discord-Server irgendwie nicht korrekt eingerichtet sind. Ich rufe mir die Funktionsweise dieses Plugins gerade wieder ins GedĂ€chtnis, da ich an Dutzenden anderen arbeite. Meine letzte Änderung an diesem Plugin ist schon eine Weile her!

1 „GefĂ€llt mir“

Roger! Ich habe das kurz auf meiner Seite geprĂŒft. Zur Information: Ich bin als Server-Inhaber aufgefĂŒhrt und habe Administratorrechte.

EDIT: Können wir klĂ€ren, welche Rechte der Bot benötigt? Er ist derzeit als Administrator aufgefĂŒhrt (dies wurde ihm jedoch ĂŒber eine Rolle und nicht ĂŒber die OAuth-Einladung gewĂ€hrt).

1 „GefĂ€llt mir“

Mein Bot hat Folgendes:

1 „GefĂ€llt mir“

Hier sind meine (Entschuldigung, als neuer Nutzer hier

muss ich erst 3 BeitrÀge verfassen
)

1 „GefĂ€llt mir“

Könntest du die Kanalberechtigungen ĂŒberprĂŒfen? Kanalberechtigungen auf Discord haben Vorrang vor Serverberechtigungen.

1 „GefĂ€llt mir“

Ja, es ist im Kanal in Ordnung. Es sind keine Berechtigungen deaktiviert, die das Senden/Empfangen von Nachrichten verhindern wĂŒrden.

Es kann „Pong!

1 „GefĂ€llt mir“

OK, ich versuche es nachzustellen, aber bisher kann ich beide Befehle ausfĂŒhren.

1 „GefĂ€llt mir“