Package Exports
- @akarui/aoi.panel
- @akarui/aoi.panel/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@akarui/aoi.panel) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@aoijs/aoi.panel
Table of Contents
Installation
npm i @aoijs/aoi.panel
Setup
const {Panel} = require("@aoijs/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",
}
});
// Ping Command
client.command({
name: "ping",
code: `Pong! $pingms`
});
client.loadCommands("./commands/", true);
const panel = new Panel({
port:3000,//port
client:bot,//aoi.js client
accounts : "/panel.userconfig.js" //accounts file (for security reasons must be a separate file)
})
panel.loadPanel();
Example userconfig file for panel:
File: panel.userconfig.js
module.exports = [
{
username: "administratorAccount",
password: "adminpassword",
perms: ["admin"]
}, {
username: "user",
password: "user",
perms: [ "startup"]
}
]
Panel Main Page
Panel Code Editor
Panel Terminal
Panel Code evaluate
Making Custom Pages
Panel uses the express.js framework. So all resources of express can be used while making custom pages e.t.c.
const app = panel.app;
app.get("/example", (req, res) => {
res.send("This is an example page.");
})