This add-on enables connecting your MemberPress enabled website to your discord server. Now you can add/remove MemberPress members directly to your discord server roles, assign roles according to your member levels, unassign roles when they expire, change role when they change membership.
This code is written inside Public class, which is wrong place to put this code.
`if ( isset( $_GET['action'] ) && 'discord-connectToBot' === $_GET['action'] ) { $params = array( 'client_id' => sanitize_text_field( trim( get_option( 'ets_memberpress_discord_client_id' ) ) ), 'permissions' => MEMBERPRESS_DISCORD_BOT_PERMISSIONS, 'scope' => 'bot', 'guild_id' => sanitize_text_field( trim( get_option( 'ets_memberpress_discord_server_id' ) ) ), ); $discord_authorise_api_url = MEMBERPRESS_DISCORD_API_URL . 'oauth2/authorize?' . http_build_query( $params );