Skip to content

Instantly share code, notes, and snippets.

@CuteLifeBot
Last active July 19, 2020 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CuteLifeBot/fb108b46c037f078be39 to your computer and use it in GitHub Desktop.
Save CuteLifeBot/fb108b46c037f078be39 to your computer and use it in GitHub Desktop.
BetterDiscord - Animated playing status plugin

BetterDiscord - Animated playing status plugin

This BetterDiscord plugin allows you to customize (and animate) your playing status in Discord.

##Step 1

##Step 2

  • Download the file animatedGame.plugin.js included with this gist. This is the plugin itself.
  • Place it in C:\Users\<yourUsername>\AppData\Roaming\BetterDiscord\Plugins
    • If you are on a mac, this is probably somewhere in ~Library/Preferences, ~Library/Application Support, or ~/Library/app support/pref
    • While finding the folder, beware that there may be two BetterDiscord folders. This belongs in the one that already has the Plugins folder

##Step 3

  • Restart Discord
    • You need to do a hard shutdown of Discord. When you close the window, Discord may still be running in the background. Kill it
    • If you cannot figure out how to do that, just restart your computer

##Step 4

  • Enable the plugin
    • In Discord... Settings > BetterDiscord > Plugins, the plugin "Animated Game" should be listed. Check the checkbox. Press the settings cogwheel next to the checkbox to set your custom game!
//META{"name":"animatedGamePlugin"}*//
function animatedGamePlugin() {}
animatedGamePlugin.prototype.load = function() {
};
animatedGamePlugin.prototype.unload = function() {
};
animatedGamePlugin.prototype.start = function() {
var self = this;
this.enabled = true;
this.duration = 60000;
this.minDuration = 250;
this.interval = setInterval(function() {
self.setPlaying();
}, this.duration);
this.setPlaying();
};
animatedGamePlugin.prototype.stop = function() {
var gp = this.game;
this.game = [""];
this.modulo = 0;
this.setPlaying();
this.game = gp;
clearInterval(this.interval);
this.enabled = false;
};
animatedGamePlugin.prototype.getName = function() {
return "Animated Game";
};
animatedGamePlugin.prototype.getDescription = function() {
return "Animate your playing status";
};
animatedGamePlugin.prototype.getVersion = function() {
return "1.1";
};
animatedGamePlugin.prototype.getAuthor = function() {
return "Jiiks (arr. Bloom)";
};
animatedGamePlugin.prototype.getSettingsPanel = function() {
if(this.game == null) this.game = [""];
if(this.modulo == null) this.modulo = 0;
return '<h1>Usage</h1>'+
'<p>Enter each frame to animate on a new line. Enter the duration (in milliseconds) to stay on each frame ('+this.minDuration+' millisecond lower limit).</p>' +
'<p> Press the \'Set game\' button to activate.</p>' +
'<label for="agPluginGame">Frames: </label> ' +
'<br />' +
'<textarea placeholder="First frame\nSecond frame\netc" name="agPluginGame" id="agPluginGame" cols="40" rows="10">'+this.game.join("\n")+'</textarea>' +
'<br />' +
'<label for="agPluginDuration">Duration (ms): </label> ' +
'<br />' +
'<input type="number" placeholder="60000" name="agPluginDuration" id="agPluginDuration" value="'+this.duration+'" />' +
'<br />' +
'<button onclick="BdApi.getPlugin(\'Animated Game\').setGame()"><b>Set game</b></button>';
};
animatedGamePlugin.prototype.setGame = function() {
var gameVal;
var durationVal;
gameVal = document.getElementById("agPluginGame").value;
durationVal = document.getElementById("agPluginDuration").value;
this.game = gameVal.split(/\n/);
this.duration = Math.max(parseInt(durationVal), this.minDuration);
clearInterval(this.interval);
var self = this;
this.interval = setInterval(function() {
self.setPlaying();
}, this.duration);
this.modulo = 0;
};
animatedGamePlugin.prototype.setPlaying = function() {
if(!this.enabled) return;
if(this.uid == null) {
if($(".account .avatar-small").css("background-image") == undefined)return;
this.uid = $(".account .avatar-small").css("background-image").match(/\d+/);
}
if(this.game == null) this.game = [""];
if(this.modulo == null) this.modulo = 0;
var minner = $('.channel-members .member[data-reactid*="'+this.uid+'"]').find(".member-inner")
var mgame = minner.find(".member-game");
if(this.game[this.modulo] != "") {
if(mgame.length) {
mgame.find("strong").text(this.game[this.modulo]);
} else {
minner.append('<div class="member-game"><span>Playing: </span><strong>'+this.game[this.modulo]+'</strong></div>');
}
} else {
if(mgame.length) {
mgame.remove();
}
}
BdApi.setPlaying(this.game[this.modulo]);
this.modulo++;
this.modulo %= this.game.length;
};
@YuseiEleven
Copy link

doesn't work for me

@Guarmanda
Copy link

doesn't work

@NeXzRo
Copy link

NeXzRo commented Jul 10, 2017

same, doesnt work

Copy link

ghost commented Dec 31, 2017

Doesn't work because BetterDiscord deactivated the "BdApi.setPlaying("game");" API Call.

@JohnCale47
Copy link

no plugins or better discord option in Settings..imma assume it doesnt work nomore

@SpoderMan3288
Copy link

no plugins show up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment