Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why error? #13

Open
pandhu-rendra opened this issue Aug 3, 2024 · 5 comments
Open

Why error? #13

pandhu-rendra opened this issue Aug 3, 2024 · 5 comments

Comments

@pandhu-rendra
Copy link

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
Copy link
Collaborator

which version of panel are you using?

@pandhu-rendra
Copy link
Author

pandhu-rendra commented Aug 3, 2024

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants