Skip to content

Commit

Permalink
Merge pull request #45 from RoguedBear/setting-ignore-vc-state
Browse files Browse the repository at this point in the history
add setting to ignore vc state
  • Loading branch information
RoguedBear committed Jun 4, 2023
2 parents c8ee59d + 7bb45ef commit ef8d569
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 78 deletions.
81 changes: 13 additions & 68 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "betterdiscordplugin-autoidleonafk",
"version": "0.3.2",
"version": "0.4.0",
"description": "Automatically updates your discord status to 'idle' when you haven't opened your discord client for more than 5 minutes",
"scripts": {
"build": "zpl build AutoIdleOnAFK"
Expand Down Expand Up @@ -29,4 +29,4 @@
"@types/bandagedbd__bdapi": "^0.3.4",
"zerespluginlibrary": "^2.0.6"
}
}
}
21 changes: 14 additions & 7 deletions src/AutoIdleOnAFK/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@
"link": "https://github.com/RoguedBear"
}
],
"version": "0.3.2",
"version": "0.4.0",
"description": "Automatically updates your discord status to 'idle' when you haven't opened your discord client for more than 5 minutes.\nPlugin only works when your status is 'online' and you are not in a voice channel. \n\nFor Bugs or Feature Requests open an issue on my Github",
"github": "https://github.com/RoguedBear/BetterDiscordPlugin-AutoIdleOnAFK",
"github_raw": "https://raw.githubusercontent.com/RoguedBear/BetterDiscordPlugin-AutoIdleOnAFK/main/release/AutoIdleOnAFK.plugin.js"
},
"changelog": [
{
"type": "fixed",
"title": "Fixed the plugin :) 🎉",
"type": "added",
"title": "Added a setting to optionally ignore VC state when going AFK",
"items": [
"Fixed the plugin after a long wait!!!",
"Thanks to: `@Violet-Vibes` for nudging me in the right direction, and `DevilBro's` BDFDB library for showing me the way!",
"so glad to have the plugin back working"
"Earlier if you were in a VC you couldn't go in AFK mode. Now you can toggle a setting to ignore whether you are in VC or not before going AFK.",
"default value: off"
]
}
],
Expand Down Expand Up @@ -87,6 +86,14 @@
120
]
},
{
"type": "switch",
"name": "Ignore VC state when going AFK",
"note": "Allows going to Idle mode even when you are in a VC. default: off",
"id": "ignoreVCState",
"value": false,
"defaultValue": false
},
{
"type": "switch",
"name": "Always Revert To Online",
Expand All @@ -104,4 +111,4 @@
"value": true
}
]
}
}
5 changes: 4 additions & 1 deletion src/AutoIdleOnAFK/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,10 @@ module.exports = (Plugin, Library) => {
* @returns {boolean} if user is in a VC
*/
inVoiceChannel() {
return getVoiceChannelId() !== null;
return (
this.settings.ignoreVCState === false &&
getVoiceChannelId() !== null
);
}

/**
Expand Down

0 comments on commit ef8d569

Please sign in to comment.