Discord Integration

Discord Integration [Paid] 2.8.6

No permission to buy ($35.00)
What is the difference between having a DIscord and Chat 2 by Siropu?
The Chat by @Siropu is 100% on your server; you own the data. But it does not have AV and may have a negative impact on your server's performance, if it is heavily used.

Discord, on the other hand, is a free community, were you can create your space (they call it "server") and with this addon by @NixFifty you can sync your forum's user accounts with their discord accounts. They have to create their own discord accounts tough first (additional to an account on your forum). Downside: You don't own the data on your Discord "server"; on your forum you may be an admin, but on Discord you are only a user, who runs a "server".
 
  • Like
Reactions: psx
@NixFifty does this only sync roles/groups one way?

For example, if someone joins my patreon, they get a special role in discord. Assuming I set it up properly (connecting the discord role to the xenforo group), would that role sync to their account?

or is it only one way, like xenforo group > discord role and not discord role > xenforo group?
 
Since the Update to 2.7.7 I got these errors every second:

Code:
GuzzleHttp\Exception\ClientException: Discord Msg: 1206; Client error: `POST https://discord.com/api/channels/982736063300796526/messages` resulted in a `400 Bad Request` response: {"embeds": ["0"]} src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113

Stack-Trace
#0 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL)
#3 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\Promise\TaskQueue->run(true)
#5 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn()
#6 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending()
#7 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList()
#8 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#9 src/addons/Hampel/SparkPostMail/vendor/guzzlehttp/guzzle/src/Client.php(182): GuzzleHttp\Promise\Promise->wait()
#10 src/addons/NF/Discord/Api.php(1001): GuzzleHttp\Client->request('POST', 'https://discord...', Array)
#11 src/addons/NF/Discord/Api.php(654): NF\Discord\Api->request(Array, 'channels/982736...', Array)
#12 src/addons/NF/Discord/ApiMessage/MessageToUserDM.php(54): NF\Discord\Api->createMessage('982736063300796...', '', Array)
#13 src/addons/NF/Discord/ApiMessage/AbstractApiMessage.php(120): NF\Discord\ApiMessage\MessageToUserDM->NF\Discord\ApiMessage\{closure}()
#14 src/addons/NF/Discord/ApiMessage/MessageToUserDM.php(74): NF\Discord\ApiMessage\AbstractApiMessage->withApiThrow(Object(Closure))
#15 src/addons/NF/Discord/Repository/Queue.php(243): NF\Discord\ApiMessage\MessageToUserDM->dispatch()
#16 src/addons/NF/Discord/Job/DiscordSendQueue.php(22): NF\Discord\Repository\Queue->run(8)
#17 src/XF/Job/Manager.php(260): NF\Discord\Job\DiscordSendQueue->run(8)
#18 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 8)
#19 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 8)
#20 job.php(43): XF\Job\Manager->runQueue(false, 8)
#21 {main}

Request state
array(4) {
  ["url"] => string(8) "/job.php"
  ["referrer"] => string(39) "https://url/title/user.id/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
I am getting a very similar issue and the bot disconnects. Any idea what the workaround or solution is for this?

Code:
Server error log
[LIST]
[*]GuzzleHttp\Exception\ClientException: Discord Msg: 30; Client error: `POST https://discord.com/api/channels/506866050256863244/messages` resulted in a `400 Bad Request` response: {"embeds": ["0"]} 
[*]src/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
[*]Generated by: Unknown account
[*]Jan 23, 2023 at 4:43 PM
[/LIST]
[HEADING=2]Stack trace[/HEADING]
#0 src/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 src/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 src/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL)
#3 src/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 src/vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\Promise\TaskQueue->run(true)
#5 src/vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn()
#6 src/vendor/guzzlehttp/promises/src/Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending()
#7 src/vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList()
#8 src/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#9 src/vendor/guzzlehttp/guzzle/src/Client.php(182): GuzzleHttp\Promise\Promise->wait()
#10 src/addons/NF/Discord/Api.php(1001): GuzzleHttp\Client->request('POST', 'https://discord...', Array)
#11 src/addons/NF/Discord/Api.php(654): NF\Discord\Api->request(Array, 'channels/506866...', Array)
#12 src/addons/NF/Discord/ApiMessage/MessageToUserDM.php(54): NF\Discord\Api->createMessage('506866050256863...', '', Array)
#13 src/addons/NF/Discord/ApiMessage/AbstractApiMessage.php(120): NF\Discord\ApiMessage\MessageToUserDM->NF\Discord\ApiMessage\{closure}()
#14 src/addons/NF/Discord/ApiMessage/MessageToUserDM.php(51): NF\Discord\ApiMessage\AbstractApiMessage->withApiThrow(Object(Closure))
#15 src/addons/NF/Discord/Repository/Queue.php(243): NF\Discord\ApiMessage\MessageToUserDM->dispatch()
#16 src/addons/NF/Discord/Job/DiscordSendQueue.php(22): NF\Discord\Repository\Queue->run(7.98845)
#17 src/XF/Job/Manager.php(260): NF\Discord\Job\DiscordSendQueue->run(7.98845)
#18 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 7.98845)
#19 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 7.98845)
#20 job.php(43): XF\Job\Manager->runQueue(false, 8)
#21 {main}
[HEADING=2]Request state[/HEADING]
array(4) {
  ["url"] => string(8) "/job.php"
  ["referrer"] => string(111) "https://url/threads/civilizations-beyond-earth-application-failed-to-initialize-0xc0000142.212587/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
Hello, I'm using version 2.7.8. I want to disable mirroring alerts from the forum into Discord, however even though this setting is displayed in the screenshots on the addon page, that setting appears to be missing from the addon options screen. Did this get moved somewhere else or was it removed erroneously?
 
Hi @NixFifty,

Getting the same errors as the people above.

#0 src/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 src/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 src/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL)
#3 src/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 src/vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\Promise\TaskQueue->run(true)
#5 src/vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn()
#6 src/vendor/guzzlehttp/promises/src/Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending()
#7 src/vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList()
#8 src/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#9 src/vendor/guzzlehttp/guzzle/src/Client.php(182): GuzzleHttp\Promise\Promise->wait()
#10 src/addons/NF/Discord/Api.php(1001): GuzzleHttp\Client->request('POST', 'https://discord...', Array)
#11 src/addons/NF/Discord/Api.php(654): NF\Discord\Api->request(Array, 'channels/106016...', Array)
#12 src/addons/NF/Discord/ApiMessage/MessageToUserDM.php(54): NF\Discord\Api->createMessage('106016772051725...', '', Array)
#13 src/addons/NF/Discord/ApiMessage/AbstractApiMessage.php(120): NF\Discord\ApiMessage\MessageToUserDM->NF\Discord\ApiMessage\{closure}()
#14 src/addons/NF/Discord/ApiMessage/MessageToUserDM.php(74): NF\Discord\ApiMessage\AbstractApiMessage->withApiThrow(Object(Closure))
#15 src/addons/NF/Discord/Repository/Queue.php(243): NF\Discord\ApiMessage\MessageToUserDM->dispatch()
#16 src/addons/NF/Discord/Job/DiscordSendQueue.php(22): NF\Discord\Repository\Queue->run(8)
#17 src/XF/Job/Manager.php(260): NF\Discord\Job\DiscordSendQueue->run(8)
#18 src/XF/Job/Manager.php(202): XF\Job\Manager->runJobInternal(Array, 8)
#19 src/XF/Job/Manager.php(86): XF\Job\Manager->runJobEntry(Array, 8)
#20 job.php(43): XF\Job\Manager->runQueue(false, 8)
#21 {main}
 

Attachments

  • logs.webp
    logs.webp
    117.3 KB · Views: 13
That is a Discord limitation for embeds.

Discord limits 256 characters for titles, and 4096 for descriptions.
 
That is a Discord limitation for embeds.

Discord limits 256 characters for titles, and 4096 for descriptions.
Correct, but the integration add-on doesn't approach those limits, nor does it allow the forum owner to configure if they have a preferred length (particularly for descriptions) that they'd like the embed to max out at, within what the Discord API allows. Instead, there are fairly arbitrary limits implemented presently.

This obviously isn't a big deal one way or another, but there is nothing preventing the truncation from being configurable within what the Discord API prescribes as permissible. I have implemented exactly this sort of functionality in my own Discord bot for embeds with user-generated content. Meanwhile, whether the developer would prioritize supporting that kind of customization is itself a separate question :)
 
getting this error when trying to sync servers

Code:
NF\Discord\NotFoundException: Not found in src/addons/NF/Discord/Api.php at line 1019
[LIST=1]
[*]NF\Discord\Api->request() in src/addons/NF/Discord/Api.php at line 1060
[*]NF\Discord\Api->get() in src/addons/NF/Discord/Api.php at line 154
[*]NF\Discord\Api->getGuild() in src/addons/NF/Discord/ApiMessage/ResyncServerInfo.php at line 86
[*]NF\Discord\ApiMessage\ResyncServerInfo->dispatch() in src/addons/NF/Discord/ApiMessage/RecacheAllServersInfo.php at line 42
[*]NF\Discord\ApiMessage\RecacheAllServersInfo->dispatch() in src/addons/NF/Discord/Repository/Server.php at line 113
[*]NF\Discord\Repository\Server->resyncServers() in src/addons/NF/Discord/Admin/Controller/Server.php at line 175
[*]NF\Discord\Admin\Controller\Server->actionSync() in src/XF/Mvc/Dispatcher.php at line 352
[*]XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 259
[*]XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
[*]XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
[*]XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2483
[*]XF\App->run() in src/XF.php at line 524
[*]XF::runApp() in admin.php at line 13
[/LIST]
 
Last edited:
Top Bottom