إعداد إشعارات Discord باستخدام إضافة discourse-chat-integration

Can you try refreshing the page? A refresh will be required after enabling the plugin.

3 إعجابات

I see it now, thanks!

he guys. getting a error setting up this plugin with discord. channel created. webhook setup with the plugin.

now i get the next error.

and when i send a test. i get this error.

and the logs give me this.

any help would be appreciated.

Can you share the contents of the “info” tab for this? If you can copy/paste, that would be great - it’s hard to read logs in a screenshot.

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

Message (2 copies reported)

Test provider failed {:error_key=>nil, :message=>{:content=>"", :embeds=>[{:title=>"FAYN Rule Book [Alliance/Announcements] ", :color=>12525102, :description=>"[image] \nFAYN is a group of Corporations working together as a collective to grow both the individual and the group within this set of guidelines and rules. \nAdministration Tools\nAs part of FAYN you are required to have  ALL  of your characters, however insignificant linked to your main character on SeAT  This is part of the recruitment requirements and supports the ongoing management of our corp...", :url=>"https://forum.darksideoftheeclipse.co.uk/t/fayn-rule-book/45/1", :author=>{:name=>"@PJHustle", :url=>"https://forum.darksideoftheeclipse.co.uk/u/PJHustle", :icon_url=>"https://forum.darksideoftheeclipse.co.uk/user_avatar/forum.darksideoftheeclipse.co.uk/pjhustle/45/4_2.png"}}]}, :response_body=>"<html>\r\n<head><title>403 Forbidden</title></head>\r\n<body>\r\n<center><h1>403 Forbidden</h1></center>\r\n<hr><center>cloudflare</center>\r\n</body>\r\n</html>\r\n"}

Backtrace

/var/www/discourse/plugins/discourse-chat-integration/app/controllers/chat_controller.rb:43:in `rescue in test'
/var/www/discourse/plugins/discourse-chat-integration/app/controllers/chat_controller.rb:22:in `test'
actionpack-6.0.3.3/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack-6.0.3.3/lib/abstract_controller/base.rb:195:in `process_action'
actionpack-6.0.3.3/lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack-6.0.3.3/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport-6.0.3.3/lib/active_support/callbacks.rb:112:in `block in run_callbacks'
/var/www/discourse/app/controllers/application_controller.rb:354:in `block in with_resolved_locale'
i18n-1.8.5/lib/i18n.rb:313:in `with_locale'
/var/www/discourse/app/controllers/application_controller.rb:354:in `with_resolved_locale'

Env

HTTP HOSTS: forum.darksideoftheeclipse.co.uk

First resort should be to contact Discord support with this information and ask why this is happening.

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

yeah maybe. but i will pass. i am not a dev. and have no clue what to do or what to ask. i dont understand much about this. just posting this as it used to work. now it doesnt.

maybe cause discord is changing stuff ? no idea.
i have a feeling i wont be the only one getting this issue soon.

It is helpful to share, we’re just pointing out that based on the data it looks like the problem is on Discord’s side. We can’t control that.

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

i found the issue.

the discord webhook has changed from discordapp.com to discord.com
when i altered the webhook from discord.com to discordapp.com it started to work.

so for now its working. i send a ticket to discord support with this issue.
but not sure where the issue lies right now. discord or the app?

edit: the webhook url on discourse i altered.

5 إعجابات

thanks for posting the solution. I was going mad trying to debug this.

Hi there.

I’m having the same issue either. Seeing DiscourseChat::ProviderError message when I click test at Plugins - Chat integrations, and getting 403 forbidden from the Discord Webhook URL.

Any hint to fix it?

You still need to alter your webhook url to use discordapp.com domain instead of discord.com.

4 إعجابات

Hey. That solved my issue. Thanks.

I think the plugin itself should support the new API domain form on a new update too.

إعجابَين (2)

Awesome, this fixed it for me as well.


I’m getting these errors in the console and the plugin channel thing isn’t loading, is it because of a theme and do I need to disable it?

You need to check your server config and it changes if you are in Apache or Nginx. You can search that message :love_you_gesture:

On topic, could be possible to add thumbnails and reduce the message quoted in Discord? It’s very long and breaks our chat :neutral_face:

BTW thanks for your (all community) work, as always!

There was such an error in the log:

/var/www/discourse/plugins/discourse-chat-integration/app/controllers/chat_controller.rb:43:in `rescue in test'
/var/www/discourse/plugins/discourse-chat-integration/app/controllers/chat_controller.rb:22:in `test'
actionpack-6.1.4.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack-6.1.4.1/lib/abstract_controller/base.rb:228:in `process_action'
actionpack-6.1.4.1/lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack-6.1.4.1/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport-6.1.4.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/var/www/discourse/app/controllers/application_controller.rb:397:in `block in with_resolved_locale'
i18n-1.8.10/lib/i18n.rb:314:in `with_locale'
/var/www/discourse/app/controllers/application_controller.rb:397:in `with_resolved_locale'

i just change webhook url from discord.com to discordapp.com and all is OK :+1:

3 إعجابات

My initial motivation for looking for a discourse to discord integration was to inject flagged posts into discord for quicker notification and review among a team of people. The stock plugin does not support this. So, injecting flagged posts into discord is now supported here

Note that there’s probably a more Ruby-esque way to do this, and perhaps on(:reviewable) should use a queue specific to reviewables, and passing around the flagged boolean is a bit of a hack, and perhaps there’s other more generic things to do with a reviewable, but works for my purposes.

Proceed with caution: I don’t plan to try to upstream this as I have no plans to support anything other than discord, and no plans to spend more time on any of the other issues for improvement identified above.

Ends up looking like this…

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

مرحباً بالجميع.
تعمل خطافات الويب مع Discord بشكل صحيح … باستثناء أن محتوى الرسالة فارغ. لا يتم عرض موضوع/رد الخطاب على خادم Discord.

إذا قمت بتضمين ‘محتوى رسالة Discord للتكامل الدردشة’، يتم تضمين هذا الجزء بشكل جيد.

شكرا لك،

لقد نجحت أخيرًا، من خلال بعض التجربة والخطأ. لمن يأتي بعدي…

تقول هذه التعليمات:

:warning: ملاحظة : إذا تلقيت خطأ عند استخدام خطاف الويب، فتأكد من أن اسم النطاق هو discordapp.com بدلاً من discord.com.

عندما نسخت خطاف الويب الخاص بي من Discord، كان بالتنسيق التالي. https://discordapp.com/api/webhooks/xxx/yyy-zzz-aaa

لذلك، التعليمات المذكورة أعلاه متوافقة مع عنوان URL الذي يوفره Discord.

تكمن المشكلة عند اتباع التعليمات. ترفض إعدادات المكون الإضافي مخطط عنوان URL الموثق، وتقبل مخطط عنوان URL المحظور. يبدو الأمر وكأن “!” كانت مفقودة في مكان ما في الكود.

لحسن الحظ، يعمل عنوان URL لخطاف الويب عند استخدام العنوان الثاني، كما هو موضح في لقطة الشاشة أدناه.

لذا، إليك بعض الاقتراحات التي يمكن أن توضح هذه المشكلة، للشخص التالي الذي قد لا يقوم بالكثير من التجربة والخطأ مثلي:

  1. تحديث المدقق ليكون “discordapp.com” مقبولاً و “discord.com” مرفوضاً.
  2. تحديث المدقق ليكون كل من “discordapp.com” و “discord.com” مقبولين.
  3. تحديث الصياغة في التعليمات لعدم وجود تلك الملاحظة المتناقضة.

اقتراحات إضافية،
ضمن إعداد “إعداد Discourse”:
الخطوة 0: بعد تثبيت المكون الإضافي، قم بتمكين المكون الإضافي.
الخطوة 1: قدم لقطة شاشة.
الخطوة 3: قدم لقطة شاشة.

أنا قلق بعض الشيء من أن Discord ستتوقف عن دعم المخطط “الخاطئ” الذي أستخدمه حاليًا، لذلك أود أن يتمكن Discourse من إصلاح هذا حتى لا أضطر إلى استخدام الحل البديل قبل أن يوقف Discord عنوان URL البديل الخاص بي.