Jump to content

Discord Intergration


mehmet ersoy

Recommended Posts

Basically, i tried setting up this Discord Intergartion and i cant seem to get it too work.. Can someone help me. Everyone works but the application.php doesnt want too. I'll provide it dont below and see if any of you can see why it isnt working? I need help with all the Highlighted Red if someone can help.

<?php
/**
 * @brief        Discord Integration Application Class
 * @author        <a href=''>Ahmad E.</a>
 * @copyright    (c) 2017 Ahmad E.
 * @package        IPS Community Suite
 * @subpackage    Discord Integration
 * @since        01 Jan 2017
 */

namespace IPS\discord;

/**
 * Discord Integration Application Class
 * @TODO: name syncing
 * @TODO: Feature: Notifications for PMs.
 * @TODO: Feature: Notifications for watched topics.
 * @TODO: (User)Setting: Send notifications on Discord?
 * @TODO: (User)Setting: Send notifications for approved posts.
 */

class _Application extends \IPS\Application
{
    /**
     * Make sure we have our login handler in the correct table.
     * Make sure we move our login handler files.
     */
    public function installOther()
    {
        $maxLoginOrder = \IPS\Db::i()->select( 'MAX(login_order)', 'core_login_handlers' )->first();

        \IPS\Db::i()->insert('core_login_handlers', [
            'login_settings' => '',
            'login_key' => 'Discord',
            'login_enabled' => 1,
            'login_order' => $maxLoginOrder + 1,
            'login_acp' => 0
        ]);

        /* Copy to /applications/core/sources/ProfileSync/ */
        $profileSync = \copy(
            \IPS\ROOT_PATH . '/applications/discord/sources/MoveOnInstall/ProfileSync/Discord.php',
            \IPS\ROOT_PATH . '/applications/core/sources/ProfileSync/Discord.php'
        );

        /* Copy to /system/Login/ */
        $systemLogin = \copy(
            \IPS\ROOT_PATH . '/applications/discord/sources/MoveOnInstall/Login/Discord.php',
            \IPS\ROOT_PATH . '/system/Login/Discord.php'
        );

        /**
         * Fix: "Permission too open" error.
         * Chmod files that need to be directly called to 644.
         * Because on some server configurations those are set to 666 by default and thus error out.
         */
        \chmod(
            \IPS\ROOT_PATH . '/applications/discord/interface/oauth/auth.php',
            644
        );

        if ( !$profileSync || !$systemLogin )
        {
            throw new \OutOfRangeException( 'Copying required file failed.' );

        }
    }
}
 

If someone could help, much appreciated!

Link to comment
Share on other sites

Archived

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...