diff --git a/.env_example b/.env_example index 894f144..7bf1e2f 100644 --- a/.env_example +++ b/.env_example @@ -1,7 +1,7 @@ # Compatiplural -url_override="https://v2.apparyllis.com" +url_override="https://api.apparyllis.com" api_version="v1" -socket="wss://v2.apparyllis.com/v1/socket" +socket="wss://api.apparyllis.com/v1/socket" pk_url="https://api.pluralkit.me/v2" token="SIMPLYPLURAL_TOKEN" userId="abcd1234" @@ -9,4 +9,5 @@ pk_token= "PLURALKIT_TOKEN" heartbeat=4500000 max_workers=1 silence_connections=true -full_swap=false \ No newline at end of file +full_swap=false +primary_tag="primary" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0befe13..33014e4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ config.json package-lock.json .env .vercel +docker_build.bat +docker_run.bat diff --git a/README.md b/README.md index b4c458c..9a8cd91 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ This project already has a Procfile set up, so it's super easy to get started. O These can be set either in the .env file, in terminal, or in the config vars section of Heroku. | Setting | Default | Description | | ---------| ------- | ------------------ | -| url_override | https://v2.apparyllis.com | The base URL for all SimplyPlural API requests. Unless you are running your own fork of Simply Plural, you shouldn't change this. | +| url_override | https://api.apparyllis.com | The base URL for all SimplyPlural API requests. Unless you are running your own fork of Simply Plural, you shouldn't change this. | | api_version | v1 | The target SimplyPlural API version. Unless you are running your own fork of Simply Plural, you shouldn't change this. | -| socket | wss://v2.apparyllis.com/v1/socket | The socket URL for SimplyPlural. Unless you are running your own fork of Simply Plural, you shouldn't change this. | +| socket | wss://api.apparyllis.com/v1/socket | The socket URL for SimplyPlural. Unless you are running your own fork of Simply Plural, you shouldn't change this. | | pk_url | https://api.pluralkit.me/v2 | The base URL for all PluralKit API requests. Unless you are running your own fork of PluralKit, you shouldn't change this. | | token | token_here | Your SimplyPlural account token. As of now, the only permission necessary is the Read permission. | | userId | user_id | Your SimplyPlural account/system ID. You can find it in account info near the bottom. | diff --git a/dataManager.js b/dataManager.js index ec1cc5f..203df1d 100644 --- a/dataManager.js +++ b/dataManager.js @@ -50,7 +50,7 @@ async function findPrimary() { return new Promise(async (resolve) => { await Util.asyncForEach(fronters, async (fronter) => { if (fronter.content.customStatus) { - if (fronter.content.customStatus.toLowerCase().includes("primary")) { + if (fronter.content.customStatus.toLowerCase().includes(Config.primary_tag)) { let member = await system.getMemberById(fronter.content.member) resolve({ name: member.content.name, pkId: member.content.pkId }) found = true @@ -116,11 +116,14 @@ async function swapFront() { for (member of front) { let m = await system.getMemberById(member.content.member) - if (m.content.pkId) { + if (m.content && m.content.pkId) { // fronting member pkID has been found newFront.push(m.content.pkId) frontNames.push(m.content.name) } + else { + console.warn('::SimplyWS:: System member not found, this may be a custom front which is unsupported.') + } } // shift primary fronter to first in list