Jump to content

Discord Integration


Ahmad E.

Recommended Posts

On 2017-5-6 at 5:57 PM, ADKGamers said:

Also it appears with the latest version of IPB that you can't delete members without getting an error.  But it appears that it might be related to a connection time out from Discord. So could just be a coincidence of upgrading. 


IPS\Http\Request\CurlException: Failed to connect to discordapp.com port 443: Connection timed out (7)
#0 /home/*********/public_html/system/Http/Request/Curl.php(403): IPS\Http\Request\_Curl->_execute()
#1 /home/*********/public_html/system/Http/Request/Curl.php(340): IPS\Http\Request\_Curl->_executeAndFollowRedirects('DELETE', Array)
#2 /home/*********/public_html/applications/discord/sources/Api/Api.php(252): IPS\Http\Request\_Curl->__call('delete', Array)
#3 /home/*********/public_html/applications/discord/sources/Api/AbstractResponse.php(55): IPS\discord\_Api->send()
#4 /home/*********/public_html/applications/discord/sources/Api/GuildMember.php(96): IPS\discord\Api\_AbstractResponse->handleApi()
#5 /home/*********/public_html/applications/discord/extensions/core/MemberSync/membersync.php(85): IPS\discord\Api\_GuildMember->remove(Object(IPS\Member))
#6 [internal function]: IPS\discord\extensions\core\MemberSync\_membersync->onDelete(Object(IPS\Member))
#7 /home/*********/public_html/system/Member/Member.php(3146): call_user_func_array(Array, Array)
#8 /home/*********/public_html/system/Member/Member.php(285): IPS\_Member->memberSync('onDelete')
#9 /home/*********/public_html/applications/core/modules/admin/members/members.php(1852): IPS\_Member->delete(true, false)
#10 /home/*********/public_html/system/Dispatcher/Controller.php(86): IPS\core\modules\admin\members\_members->delete()
#11 /home/*********/public_html/system/Dispatcher/Dispatcher.php(129): IPS\Dispatcher\_Controller->execute()
#12 /home/*********/public_html/*********/index.php(14): IPS\_Dispatcher->run()
#13 {main}

 

But when I disable the integration I'm able to delete members.  So is there something that could be done to prevent this issue from occurring if there's an issue with discordapp.com? 

Seems like this was a coincidence and not related to the update itself. I have however added a fix for this, if discordapp.com is down or something, the member will still get deleted and the error will be logged.

On 2017-5-11 at 11:15 PM, Alacrity Gaming said:

One of the latest updates must have broken something, as there is no longer Discord options in the 'Forums' tabs. Previously set settings are still working as configured, but there is no way to access those settings. 

 

 

Capture.PNG

As mentioned by @donjuan this has been moved to "Posting Settings".

21 hours ago, donjuan said:

It would be awesome if this application could use the primary rank only (or have an option for it to only use primary rank)

Because I use plenty of secundary groups on my forum, and the Discord application adds them all but it doesn't keep an order, so most of the users get their secundary group at the top giving them the wrong rank. I would really love them to get their primary rank only.

They're under 'posting settings' now.

I don't think discord has a concept of primary/secondary groups, I'm afraid.

@everyone if someone is still having issues, please send me a PM. This way I can keep track of your issues and prioritize them much easier.
Use this thread for questions please, thanks.

 

Link to comment
  • Replies 441
  • Created
  • Last Reply
On 14-5-2017 at 9:30 PM, Ahmad E. said:

Seems like this was a coincidence and not related to the update itself. I have however added a fix for this, if discordapp.com is down or something, the member will still get deleted and the error will be logged.

As mentioned by @donjuan this has been moved to "Posting Settings".

I don't think discord has a concept of primary/secondary groups, I'm afraid.

@everyone if someone is still having issues, please send me a PM. This way I can keep track of your issues and prioritize them much easier.
Use this thread for questions please, thanks.

 

That's correct, but what I meant is an option to let IPB only send 1 group to Discord (the primary one) so if my user is in 6 groups, but 'admin' is his primary group, he doesn't end up as 'premium member' in discord because that was the last rank to synch. (Discord picks the last rank so if you add 6 ones to the user, the on-top rank will be used).

Link to comment

Hi @Ahmad E.

I ran into this error and a few other errors. Help over TeamViewer will be appreciated!

IPS\discord\Api\Exception\ForbiddenException:  (0)
#0 /home/xxxxxxxxx/public_html/applications/discord/sources/Api/AbstractResponse.php(64): IPS\discord\Api\_AbstractResponse->throwException(403)
#1 /home/xxxxxxxxx/public_html/applications/discord/sources/Api/GuildMember.php(57): IPS\discord\Api\_AbstractResponse->handleApi()
#2 /home/xxxxxxxxx/public_html/applications/core/sources/ProfileSync/Discord.php(63): IPS\discord\Api\_GuildMember->update(Object(IPS\Member))
#3 /home/xxxxxxxxx/public_html/applications/core/sources/ProfileSync/Discord.php(128): IPS\core\ProfileSync\_Discord->user()
#4 /home/xxxxxxxxx/public_html/system/Theme/Theme.php(780) : eval()'d code(6932): IPS\core\ProfileSync\_Discord->name()
#5 /home/xxxxxxxxx/public_html/system/Theme/SandboxedTemplate.php(57): IPS\Theme\class_core_front_system->settingsOverview(Array)
#6 /home/xxxxxxxxx/public_html/applications/core/modules/front/system/settings.php(148): IPS\Theme\_SandboxedTemplate->__call('settingsOvervie...', Array)
#7 [internal function]: IPS\core\modules\front\system\_settings->_overview()
#8 /home/xxxxxxxxx/public_html/applications/core/modules/front/system/settings.php(55): call_user_func(Array)
#9 /home/xxxxxxxxx/public_html/system/Dispatcher/Controller.php(97): IPS\core\modules\front\system\_settings->manage()
#10 /home/xxxxxxxxx/public_html/applications/core/modules/front/system/settings.php(35): IPS\Dispatcher\_Controller->execute()
#11 /home/xxxxxxxxx/public_html/system/Dispatcher/Dispatcher.php(129): IPS\core\modules\front\system\_settings->execute()
#12 /home/xxxxxxxxx/public_html/index.php(13): IPS\_Dispatcher->run()
#13 {main}
Link to comment
On 2017-5-22 at 5:37 PM, Hamza Sohail said:

Update: I realize the above error is caused due to Owner account not being editable. I also have other issues, my Login/Signup page breaks completely if I enable the Discord Application.

Please send me a PM with more information and possibly access to your community so I can debug the issue.

On 2017-5-26 at 8:30 PM, jimpjorps said:

Is role synchronization in the opposite direction (from Discord to IPforum) something planned for the future?  I've got a Discord server with an authorization bot that sets roles and I'd like to bring those roles over to a new forum.

No, it's not, I'm afraid. That is if Discord doesn't add an event api like. Kinda like Slack has: https://api.slack.com/events-api
They only offer the real-time API which needs to use WebSockets.

On 2017-5-26 at 9:40 PM, ADKGamers said:

@Ahmad E. any update to the PM that I sent you almost 2 weeks ago?  

Just replied, I'll have a look tomorrow in the morning.

PS. I'm really sorry for the late replies. I've been really busy with work.
If you want faster responses PM me your discord name and I'll add you. :) That way you can bug me more and faster ;)

PPS. I'll do an IPS 4.2 compatibility check on wednesday :)

Link to comment
  • 2 weeks later...
On 5/27/2017 at 1:25 PM, Ahmad E. said:

Please send me a PM with more information and possibly access to your community so I can debug the issue.

No, it's not, I'm afraid. That is if Discord doesn't add an event api like. Kinda like Slack has: https://api.slack.com/events-api
They only offer the real-time API which needs to use WebSockets.

Just replied, I'll have a look tomorrow in the morning.

PS. I'm really sorry for the late replies. I've been really busy with work.
If you want faster responses PM me your discord name and I'll add you. :) That way you can bug me more and faster ;)

PPS. I'll do an IPS 4.2 compatibility check on wednesday :)

Hey, what about that exception I posted when creating a new subforum? It's preventing my other admins from creating new subforums.

Link to comment

Good evening, @Ahmad E. 

I just got around to looking into my cron logs and I noticed that ProfileSync was failing over and over again. Here is the output of the errors.

Error: Call to undefined method IPS\core\ProfileSync\Discord::cover() (0)
#0 /***/applications/core/tasks/profilesync.php(46): IPS\core\ProfileSync\_ProfileSyncAbstract->sync()
#1 /***/system/Task/Task.php(249): IPS\core\tasks\_profilesync->execute()
#2 /***/system/Task/Task.php(218): IPS\_Task->run()
#3 /***/applications/core/interface/task/task.php(61): IPS\_Task->runAndLog()
#4 {main}

I have a feeling I could just add the cover() method and have it return NULL to get rid of the error, but of course I would prefer your input and see your fix. I wouldn't want to mess with anyone's source for future updates. I can only imagine others are having this too just haven't seen it in their logs. Or maybe it's just me?

Thank you!

Link to comment

Hello,


This doesn't seem to work if we linked Groups on the forums to roles in our discord, we get a massive error like the one here:

IPS\discord\Api\Exception\ForbiddenException:  (0)
#0 /home/www/forums/applications/discord/sources/Api/AbstractResponse.php(64): IPS\discord\Api\_AbstractResponse->throwException(403)
#1 /home/www/forums/applications/discord/sources/Api/GuildMember.php(57): IPS\discord\Api\_AbstractResponse->handleApi()
#2 /home/www/forums/system/Login/Discord.php(108): IPS\discord\Api\_GuildMember->update(Object(IPS\Member))
#3 /home/www/forums/applications/core/modules/front/system/settings.php(996): IPS\Login\_Discord->authenticate(Object(IPS\Http\Url\Friendly), Object(IPS\Member))
#4 [internal function]: IPS\core\modules\front\system\_settings->_profilesync()
#5 /home/www/forums/applications/core/modules/front/system/settings.php(55): call_user_func(Array)
#6 /home/www/forums/system/Dispatcher/Controller.php(97): IPS\core\modules\front\system\_settings->manage()
#7 /home/www/forums/applications/core/modules/front/system/settings.php(35): IPS\Dispatcher\_Controller->execute()
#8 /home/www/forums/system/Dispatcher/Dispatcher.php(129): IPS\core\modules\front\system\_settings->execute()
#9 /home/www/forums/index.php(13): IPS\_Dispatcher->run()
#10 {main}

 

If we do not setup any links in the Group > Groupname > Discord tab and then link this works fine, however users do not get ranks in discord as there is no way link. Can you assist? 

 

Also where does the discord ID get stored for the user on the database? 

Link to comment
On 2017-6-11 at 6:38 PM, Pydrex_ said:

Hello,


This doesn't seem to work if we linked Groups on the forums to roles in our discord, we get a massive error like the one here:


IPS\discord\Api\Exception\ForbiddenException:  (0)
#0 /home/www/forums/applications/discord/sources/Api/AbstractResponse.php(64): IPS\discord\Api\_AbstractResponse->throwException(403)
#1 /home/www/forums/applications/discord/sources/Api/GuildMember.php(57): IPS\discord\Api\_AbstractResponse->handleApi()
#2 /home/www/forums/system/Login/Discord.php(108): IPS\discord\Api\_GuildMember->update(Object(IPS\Member))
#3 /home/www/forums/applications/core/modules/front/system/settings.php(996): IPS\Login\_Discord->authenticate(Object(IPS\Http\Url\Friendly), Object(IPS\Member))
#4 [internal function]: IPS\core\modules\front\system\_settings->_profilesync()
#5 /home/www/forums/applications/core/modules/front/system/settings.php(55): call_user_func(Array)
#6 /home/www/forums/system/Dispatcher/Controller.php(97): IPS\core\modules\front\system\_settings->manage()
#7 /home/www/forums/applications/core/modules/front/system/settings.php(35): IPS\Dispatcher\_Controller->execute()
#8 /home/www/forums/system/Dispatcher/Dispatcher.php(129): IPS\core\modules\front\system\_settings->execute()
#9 /home/www/forums/index.php(13): IPS\_Dispatcher->run()
#10 {main}

 

If we do not setup any links in the Group > Groupname > Discord tab and then link this works fine, however users do not get ranks in discord as there is no way link. Can you assist? 

 

Also where does the discord ID get stored for the user on the database? 

 

 

I have fixed this, you must move the discord role of your bot right to the top of the roles list.

Link to comment
On 11/06/2017 at 7:38 PM, Pydrex_ said:

Also where does the discord ID get stored for the user on the database? 

In the core_members table, column discord_id.

 

On 13/06/2017 at 7:08 PM, inkredible said:

@Ahmad E. I just purchased your app and I am still setting everything up. However, is it possible to setup multiple discord roles for specific user groups? If it isn't possible yet, consider it as feature request :P.

If I understand correctly, this should already be possible.

On 13/06/2017 at 7:08 PM, inkredible said:

 

Feature request: Can you add "forumSection" as variable for the Discord topic format? (http://i.imgur.com/5GsuH9i.png)

What should it resolve to, the name of the forum?

On 14/06/2017 at 8:47 PM, General.V2 said:

Does this application auto post notifications to discord from "RSS/Atom Feed Imports" under IPB forums? If it does, I'll gladly purchase this application.

No it doesn't, at least not yet.

Link to comment
2 minutes ago, MikeChristopher said:

Does this work / being updated to work with 4.2?

Work probably not, I haven't had a lot of time to look into all the issues. But I'll definitely update it to support 4.2. Hopefully, I can get it done before the stable 4.2 release.

Link to comment

App seems to work great in IPS 4.2

To hotfix Forbidden Exception catched when app want to edit Owner of Discord Guild (Sync Nicknames enabled):

Replace this condition in GuildMember.php

/** @noinspection PhpUndefinedFieldInspection */
if ( \IPS\Settings::i()->discord_sync_names )
{
	/** @noinspection PhpUndefinedFieldInspection */
	$data['nick'] = $member->name;
}

By this:

/** @noinspection PhpUndefinedFieldInspection */
if ( \IPS\Settings::i()->discord_sync_names && $member->name !== 'JigSaw' )
{
	/** @noinspection PhpUndefinedFieldInspection */
	$data['nick'] = $member->name;
}

Just change nickname, use the display name of your guild owner, on your IPS instance.

Link to comment
  • 2 weeks later...

This error occurs when liked my account to Discord using the login handlers. Error shows when going to Account Settings.

IPS\discord\Api\Exception\ForbiddenException:  (0)
#0 /xxxxxxxxxxx/applications/discord/sources/Api/AbstractResponse.php(64): IPS\discord\Api\_AbstractResponse->throwException(403)
#1 /xxxxxxxxxxx/applications/discord/sources/Api/GuildMember.php(57): IPS\discord\Api\_AbstractResponse->handleApi()
#2 /xxxxxxxxxxx/applications/core/sources/ProfileSync/Discord.php(63): IPS\discord\Api\_GuildMember->update(Object(IPS\Member))
#3 /xxxxxxxxxxx/applications/core/sources/ProfileSync/Discord.php(128): IPS\core\ProfileSync\_Discord->user()
#4 /xxxxxxxxxxx/system/Theme/Theme.php(780) : eval()'d code(7043): IPS\core\ProfileSync\_Discord->name()
#5 /xxxxxxxxxxx/system/Theme/SandboxedTemplate.php(57): IPS\Theme\class_core_front_system->settingsOverview(Array)
#6 /xxxxxxxxxxx/applications/core/modules/front/system/settings.php(148): IPS\Theme\_SandboxedTemplate->__call('settingsOvervie...', Array)
#7 [internal function]: IPS\core\modules\front\system\_settings->_overview()
#8 /xxxxxxxxxxx/applications/core/modules/front/system/settings.php(55): call_user_func(Array)
#9 /xxxxxxxxxxx/system/Dispatcher/Controller.php(97): IPS\core\modules\front\system\_settings->manage()
#10 /xxxxxxxxxxx/applications/core/modules/front/system/settings.php(35): IPS\Dispatcher\_Controller->execute()
#11 /xxxxxxxxxxx/system/Dispatcher/Dispatcher.php(129): IPS\core\modules\front\system\_settings->execute()
#12 /xxxxxxxxxxx/index.php(13): IPS\_Dispatcher->run()
#13 {main}

Only way to remove error is to disable the Discord Login Handler.

 

Just noticed its because im the Server Owner? and it can b fixed by unlinking my account, how can I do that if I cant get into my settings.?

Thanks

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...