Skip to content

Instantly share code, notes, and snippets.

@shinmai
Last active September 14, 2024 18:36
Show Gist options
  • Save shinmai/a1d92b4b5a84b78c9aa70b5559731135 to your computer and use it in GitHub Desktop.
Save shinmai/a1d92b4b5a84b78c9aa70b5559731135 to your computer and use it in GitHub Desktop.
BetterDiscord plugin to try to stop being AFK
/**
* @name No AFK
* @description Try to stop being AFK
* @version 0.0.1
* @author shi
* @authorId 142594671078539264
* @website https://shi.wtf/
* @source https://gist.github.com/shinmai/a1d92b4b5a84b78c9aa70b5559731135/raw//NoAFK.plugin.js
*/
/**
* Changelog:
* 0.0.1 - initial version
*/
module.exports = meta => ({
start() {
BdApi.Patcher.before('NoAFK', BdApi.Webpack.getModule(m => m.dispatch && m.subscribe), 'dispatch', (that, args) => {
const [ event ] = args;
if (event.type === "AFK") {
event.afk = false;
}
})
},
stop() { BdApi.Patcher.unpatchAll('NoAFK') }
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment