• We would like to invite you to check out the latest 1.0 alpha versions. You can read more about what's new here. Please note, that this is still an early release and will contain new bugs ¯\_(ツ)_/¯
  • If you need help or want to discuss things, you now can also join us on our Discord Server!

DE Problem with saving Config - Sinusbot 1.0a4 [BETA]

Lukas Westholt

Member
Contributor
Hey,
ich habe das Problem, dass mein Script unter der 1.0.0-alpha.4 mit engine.saveConfig() nicht funktioniert. Die engine.saveConfig(config) gibt immer false aus und speichert nichts. Auch engine.saveConfig({}) == false und funktioniert nicht. Woran liegt das? Das Problem hatte ich mit dem Script unter 0.14.3 noch nicht.

JavaScript:
registerPlugin({
        name: 'Config saver tester',
        version: '1.0',
        description: 'tester',
        author: 'Lukas Westholt <[email protected]>',
        backends: ["ts3"],
        engine: ">= 1.0",
        vars: [{
            name: 'language',
            title: 'Select your Language | Wähle deine Sprache',
            type: 'string'
        }]
    },

    function (_, config) {

        const engine = require('engine');
        let language;
        let result;
        engine.log(config);
        if (!config || !config.language) {
            engine.log("not configured yet. Disabling it...");
            return;
        } else if (engine.getBackend() === "discord") {
            engine.log("not supporting discord. Disabling it...");
            return;
        } else {
            language = config.language;
        }
        engine.log(language);

        config.language = "ES FUNKTIONIERT!";

        engine.log(config);

        result = engine.saveConfig(config);
        if (result) {
            engine.log("Update of configuration successful");
        } else {
            engine.log("Update of configuration FAILED");
        }
        engine.log(result);

        result = engine.saveConfig({});
        if (result) {
            engine.log("Update of configuration successful");
        } else {
            engine.log("Update of configuration FAILED");
        }
        engine.log(result);
    }
);
gibt mir
Code:
[ tester:50:16] false
[ tester:48:20] Update of configuration FAILED
[ tester:42:16] false
[ tester:40:20] Update of configuration FAILED
[ tester:34:16] {"language":"ES FUNKTIONIERT!"}
[ tester:30:16] 100
[ tester:20:16] {"language":"100"}
 

flyth

is reticulating splines
Staff member
Developer
Contributor
Schaue ich mir an, danke für die Meldung!
 

flyth

is reticulating splines
Staff member
Developer
Contributor
Ja, ist reproduzierbar und buggy in der aktuellen Alpha. Ich hab's bereits gefixt, so dass es in der nächsten Version wieder funktionieren wird. :)
 

Similar threads

Top