JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 22
  • Score
    100M100P100Q65701F
  • License MIT

The aoi.panel module provides a panel component for the aoi.js library using express.

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

aoi.panel

@aoijs/aoi.panel

npm GitHub GitHub package.json version GitHub last commit GitHub repo size GitHub forks GitHub Repo stars GitHub watchers

Table of Contents

Installation

npm i @aoijs/aoi.panel

Login Page

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 Main Page

Panel Code Editor

code editor

Panel Terminal

terminal

Panel Code evaluate

eval1 eval2

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.");
})