aoijs / aoi.panel

A developer panel for Aoi.js Users
MIT License
16 stars 12 forks source link

Why error? #13

Open pandhu-rendra opened 2 months ago

pandhu-rendra commented 2 months ago

Why my bot can running?

F:! OVERWRITE STORE\OVERWRITE BOT\index.js:81 panel.loadPanel(); ^

TypeError: panel.loadPanel is not a function at Object. (F:! OVERWRITE STORE\OVERWRITE BOT\index.js:81:7) at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Module.load (node:internal/modules/cjs/loader:1208:32) at Module._load (node:internal/modules/cjs/loader:1024:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12) at node:internal/main/run_main_module:28:49

Node.js v20.14.0

and this is my code // Panel const panel = new Panel({ port:3000,//port client:client,//aoi.js client accounts : "./panel.userconfig.js" //accounts file (for security reasons must be a separate file) })

panel.loadPanel();

panel.userconfig.js i have too

Bumblebee-3 commented 2 months ago

which version of panel are you using?

pandhu-rendra commented 2 months ago

i'm using latest version form npm i just following instalation command from npm "npm i @akarui/aoi.panel", and i use latest aoi.js too

Bumblebee-3 commented 2 months ago

You are using the setup of unreleased version of panel... Try this instead:

const {Panel} = require("@akarui/aoi.panel")
const {AoiClient} = require("aoi.js");

const client = new AoiClient({
    intents: ["MessageContent", "Guilds", "GuildMessages"],
    events: ["onMessage", "onInteractionCreate"],
    prefix: "Discord Bot Prefix",
    token: "Discord Bot Token",
    database: {
        type: "aoi.db",
        db: require("@akarui/aoi.db"),
        dbType: "KeyValue",
        tables: ["main"],
        securityKey: "a-32-characters-long-string-here",
    }
});

client.loadCommands("./commands/", true);

const panel = new Panel({
    port: 3000,
    client: client
})

panel.loadAPI({
    auth: "Authentication-Key"//No spaces, keep it only alphanumeric.
})

panel.loadGUI({
    username: ["username 1"],
    password: ["Password 1"],
})
pandhu-rendra commented 2 months ago

it works and I can open the panel, but for

panel.loadAPI({ auth: "Authentication-Key"//No spaces, keep it only alphanumeric. })

What should I change the authentication-key to?

Bumblebee-3 commented 2 months ago

it can be any string with only numbers or alphabets. basically like a password, try to keep it without any specialcharacters