طقم بناء بوت Discord 🤖

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 إعجابات

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)

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 إعجابات

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)

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 إعجابات

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)

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)

Fair enough. Thanks for the help.

إعجابَين (2)

مرحبًا.

أنا أستخدم إضافةك حاليًا، وقد وصلت إلى مرحلة عمل مقبولة. يبدو الأمر رائعًا حقًا، عمل ممتاز!

ومع ذلك، لدي بعض الأسئلة: الآن بعد أن يعمل كل شيء، أحتاج إلى أن يسجل مستخدموا الدخول عبر Discord OAuth. وهذا يؤدي إلى إنشاء حساب جديد.

ما هي أفضل طريقة لإدارة هذا؟ هل أحتاج إلى دمج الحساب الجديد مع القديم؟ لقد جربت ذلك مع حساب المسؤول، وحصلت على الخطأ “ليس لديك إذن بتنفيذ أمر discsync!” عند محاولة تشغيل !discsync يدويًا.

بالإضافة إلى ذلك، لم يتم نسخ أي أدوار من منصة Discourse الخاصة بي حتى الآن.

للعلم، يظهر حساب Discord الخاص بي في خياراتي على أنه حساب مرتبط.

شكرًا مقدمًا على مساعدتكم!

إعجابَين (2)

شكرًا لاهتمامك بالإضافة!

هذه ليست ميزة من مميزات الإضافة، بل هي ميزة أساسية. حيث يأتي OAuth الخاص بـ Discord مع Discourse افتراضيًا:

تظهر الإعدادات المذكورة أعلاه بغض النظر عما إذا كنت قد أضفت هذه الإضافة إلى Discourse أم لا.

إذا قمت بتسجيل الدخول عبر الحساب الاجتماعي، وطابقت عناوين البريد الإلكتروني المسجلة، فسيتم التعرف على الحساب ولن يتم إنشاء حساب جديد. أما إذا كان المستخدم قد سجل في Discord باستخدام بريد إلكتروني مختلف عن بريد Discourse، فبالطبع لا توجد طريقة لمعرفة أنهما نفس المستخدم، وبالتالي سيتم إنشاء حساب جديد.

هل تقصد حساب المسؤول على خادم Discord؟ وهل قمت أيضًا بتفويض البوت؟

ما هي نتيجة الأمر Ping!؟

4 إعجابات

أوافق على ذلك. في أسوأ الحالات، يمكنني دمج الحسابات ذات عناوين البريد الإلكتروني غير المتطابقة.

نعم، هذا صحيح. أنا مالك كل من خادم Discord ونسخة Discourse. نتيجة أمر “Ping!” هي “Pong!”. لم يتم ترحيل أي أدوار من Discourse إلى Discord.

البوت موجود على خادم Discord الخاص بي ويتمتع بصلاحيات المسؤول. هل يمكنني توضيح ما تقصده بـ “تفويض”؟

3 إعجابات

هل أكملت هذه الخطوة؟ (فقط للتحقق من جميع المتطلبات الأساسية، فأنت على الأرجح قد فعلت ذلك بالفعل).

إعجابَين (2)

نعم، لدي :slight_smile:

إعجاب واحد (1)

تخميني هو أن حقوقك أو حقوق البوت على خادم ديسكورد لم تُعد بشكل صحيح بطريقة ما. أنا فقط أجدد ذاكرتي مع هذه الإضافة بينما أعمل على عشرات الإضافات. آخر تغيير قمت به لهذه الإضافة كان منذ فترة!

إعجاب واحد (1)

روجر! قمت بفحص سريع من جانبي، لذا لأغراض اطلاعك، أنا مدرج كمالك للخادم ولدي حقوق المسؤول.

تعديل: هل يمكننا توضيح الحقوق التي يحتاجها البوت؟ حاليًا مدرج كمشرف (تم منح هذه الصلاحية له عبر دور وليس عبر دعوة OAuth، على الرغم من ذلك).

إعجاب واحد (1)

يحتوي البوت الخاص بي على هذه العناصر:

إعجاب واحد (1)

إليك صوري (آسف، بصفتي مستخدمًا جديدًا هنا

، أحتاج إلى نشر 3 مشاركات…)

إعجاب واحد (1)

هل يمكنك التحقق من أذونات القناة؟ أذونات القناة في Discord تتجاوز أذونات الخادم.

إعجاب واحد (1)

نعم، إنه يعمل بشكل جيد في القناة. لا توجد أي أذونات معطلة هناك قد تمنع إرسال أو استقبال الرسائل.

يمكنه إرسال “Pong!”، لكنه يخبرني أنني لا أملك الأذونات المطلوبة لتشغيل أمر “!discsync”.

إعجاب واحد (1)

حسنًا، أحاول إعادة إنشاء المشكلة، لكن حتى الآن تمكنت من تشغيل كلا الأمرين.

إعجاب واحد (1)