toluschr / BetterDiscord-Animated-Status

Animate your Discord Status with this BetterDiscord Plugin
MIT License
256 stars 489 forks source link

Load could not be fired #137

Closed XiaoPatrick-TW closed 9 months ago

XiaoPatrick-TW commented 1 year ago

Notice taken

Discord Version

1.0.1024

Discord Release Channel

ptb

BetterDiscord Version

1.8.5

Plugin Version

0.13.2

Expected behavior

load() function should be fired, and the plugin should work normally.

Actual behavior

I don't know how most people download it. I clicked on https://raw.githubusercontent.com/toluschr/BetterDiscord-Animated-Status/master/Animated_Status.plugin.js, right-clicked the website, and saved it as a new file. After downloading it, I dragged it into the plugin pages, as you see, an error had occurred:

螢幕擷取畫面 2023-03-13 200739

(Don't care about those mandarin characters, because I am a Chinese) ("無法调用Load()" means "Load() could not be fired" Actually, I think that the problem occurs concerning the following codes:

/* Code related to Animations */
    load() {
        this.kSpacing = "15px";
        this.kMinTimeout = 2900;
        this.cancel = undefined;

        this.animation = this.GetData("animation") || [];
        this.timeout = this.GetData("timeout") || this.kMinTimeout;
        this.randomize = this.GetData("randomize") || false;

        this.modules = this.modules || (() => {
            let m = []
            webpackChunkdiscord_app.push([['AnimatedStatus'], {}, e => { m = m.concat(Object.values(e.c)) }])
            return m
        })();

        // Import Older Config Files
        if (typeof this.timeout == "string")
            this.timeout = parseInt(this.timeout);
        if (this.animation.length > 0 && Array.isArray(this.animation[0]))
            this.animation = this.animation.map(em => this.ConfigObjectFromArray(em));

        Status.authToken = this.modules.find(m => m.exports?.default?.getToken !== void 0).exports.default.getToken();
        this.currentUser = this.modules.find(m => m.exports?.default?.getCurrentUser !== void 0).exports.default.getCurrentUser();}

It seems like that someone have encountered the identical problems: #133 Hope that you solve that very soon. Thank you.

kroot007 commented 1 year ago

same here

tajito commented 1 year ago

happening to me too

CS1o commented 10 months ago

Hey, you can try my fix for this issue as it appeared again:

https://github.com/toluschr/BetterDiscord-Animated-Status/issues/158