This commit is contained in:
Bxio 2025-04-04 19:46:15 +01:00
parent 1acc2e1fd0
commit 819e906b47
4475 changed files with 1563037 additions and 0 deletions

190
LICENSE Normal file
View File

@ -0,0 +1,190 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
Copyright 2024 Ethical Programmer
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

289
admin/dashboard.js Normal file
View File

@ -0,0 +1,289 @@
const express = require('express');
const bodyParser = require('body-parser');
const fs = require('fs');
const path = require('path');
const app = express();
const port = 3000;
const client = require('../src/index')
const multer = require('multer');
const upload = multer();
const { getActivities } = require('../src/functions/handlers/handleCommands');
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.static(path.join(__dirname, 'public')));
app.use(upload.fields([{ name: 'new-bot-avatar' }, { name: 'new-bot-banner' }]));
function loadConfig() {
const configPath = path.join(__dirname, '../config.json');
if (fs.existsSync(configPath)) {
return JSON.parse(fs.readFileSync(configPath, 'utf-8'));
}
return {};
}
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'views', 'index.html'));
});
app.get('/bot', (req, res) => {
res.sendFile(path.join(__dirname, 'views', 'botprofile.html'));
});
app.get('/config', (req, res) => {
res.sendFile(path.join(__dirname, 'views', 'config.html'));
});
app.get('/commands', (req, res) => {
res.sendFile(path.join(__dirname, 'views', 'commands.html'));
});
app.get('/errors', (req, res) => {
res.sendFile(path.join(__dirname, 'views', 'errors.html'));
});
app.get('/guilds', (req, res) => {
res.sendFile(path.join(__dirname, 'views', 'guilds.html'));
});
app.get('/api/bot-info', async (req, res) => {
try {
const fetchedUser = await client.users.fetch(client.user.id, { force: true });
const botStatus = client.presence.status;
const botName = client.user.username;
const botAvatar = `https://cdn.discordapp.com/avatars/${client.user.id}/${client.user.avatar}.png`;
const botId = client.user.id;
const botBanner = `https://cdn.discordapp.com/banners/${client.user.id}/${fetchedUser.banner}.png`;
const isVerified = client.user.verified;
res.json({
botStatus,
botName,
botId,
botBanner,
botAvatar,
isVerified
})
} catch (err) {
console.error('Error fetching bot info:', err);
res.status(500).json({ error: 'Internal Server Error' });
}
})
app.post('/api/update-bot', async (req, res) => {
const { newBotName } = req.body;
if (newBotName) {
try {
await client.user.setUsername(newBotName);
} catch (error) {
console.error('Error updating bot name:', error);
return res.json({ success: false, message: 'Failed to update bot name' });
}
}
// Update bot avatar if provided
const avatarFile = req.files['new-bot-avatar']?.[0];
if (avatarFile) {
try {
await client.user.setAvatar(avatarFile.buffer); // Use buffer for the image
} catch (error) {
console.error('Error updating bot avatar:', error);
return res.json({ success: false, message: 'Failed to update bot avatar' });
}
}
const bannerFile = req.files['new-bot-banner']?.[0];
if (bannerFile) {
try {
await client.user.setBanner(bannerFile.buffer);
} catch (error) {
console.error('Error updating bot banner:', error);
return res.json({ success: false, message: 'Failed to update bot banner' });
}
}
return res.json({ success: true });
});
app.get('/api/guilds', async (req, res) => {
const guildsData = client.guilds.cache.map(guild => ({
id: guild.id,
name: guild.name,
icon: guild.iconURL(),
memberCount: guild.memberCount,
}));
res.json(guildsData);
});
app.get('/api/bot-stats', async (req, res) => {
try {
const totalServers = client.guilds.cache.size;
const totalCommands = (client.commands ? client.commands.size : 0) + (client.prefix ? client.prefix.size : 0);
const botName = client.user.username;
const botIcon = `https://cdn.discordapp.com/avatars/${client.user.id}/${client.user.avatar}.png`;
let totalUsers = 0;
client.guilds.cache.forEach(guild => {
totalUsers += guild.memberCount;
});
res.json({
totalServers,
totalUsers,
totalCommands,
botName,
botIcon
});
} catch (err) {
console.error('Error fetching bot stats:', err);
res.status(500).json({ error: 'Internal Server Error' });
}
});
app.post('/update-config', (req, res) => {
// Load the existing config
const currentConfig = loadConfig();
// Update only the fields that are provided
const newConfig = {
bot: {
...currentConfig.bot, // Keep existing values
...(req.body.token && { token: req.body.token }), // Update token if provided
...(req.body.id && { id: req.body.id }), // Update id if provided
...(req.body.admins && { admins: req.body.admins.split(',') }), // Update admins if provided
...(req.body.ownerId && { ownerId: req.body.ownerId }), // Update ownerId if provided
...(req.body.developerCommandsServerIds && {
developerCommandsServerIds: req.body.developerCommandsServerIds.split(','),
}), // Update developerCommandsServerIds if provided
},
database: {
...(currentConfig.database || {}),
...(req.body.mongodbUrl && { mongodbUrl: req.body.mongodbUrl }),
},
logging: {
...(currentConfig.logging || {}),
...(req.body.guildJoinLogsId && { guildJoinLogsId: req.body.guildJoinLogsId }),
...(req.body.guildLeaveLogsId && { guildLeaveLogsId: req.body.guildLeaveLogsId }),
...(req.body.commandLogsChannelId && { commandLogsChannelId: req.body.commandLogsChannelId }),
...(req.body.errorLogs && { errorLogs: req.body.errorLogs }),
},
prefix: {
...(currentConfig.prefix || {}),
...(req.body.prefix && { value: req.body.prefix }),
},
};
fs.writeFileSync(path.join(__dirname, '../config.json'), JSON.stringify(newConfig, null, 2));
res.redirect('/config?success=true');
});
app.get('/api/commands', (req, res) => {
const slashCommandsDir = path.join(__dirname, '../src/commands');
const prefixCommandsDir = path.join(__dirname, '../src/messages');
const commands = {
slash: [],
prefix: []
};
// A function to read commands from a directory
function readCommands(dir, commandArray, type) {
return new Promise((resolve, reject) => {
fs.readdir(dir, (err, files) => {
if (err) {
return reject(`Error reading ${type} commands`);
}
const promises = files.map(file => {
const filePath = path.join(dir, file);
return new Promise((resolveFile, rejectFile) => {
fs.stat(filePath, (err, stats) => {
if (err) {
return rejectFile('Error reading file stats');
}
if (stats.isDirectory()) {
readCommands(filePath, commandArray, type).then(resolveFile).catch(rejectFile);
} else if (path.extname(file) === '.js') {
const command = require(filePath);
if (type === 'slash') {
commandArray.push({
name: command.data.name,
description: command.data.description
});
} else {
commandArray.push({
name: command.name,
description: command.description
});
}
resolveFile();
} else {
resolveFile(); // Handle non-JS files gracefully
}
});
});
});
// Wait for all promises to resolve
Promise.all(promises).then(resolve).catch(reject);
});
});
}
// Read slash commands and then prefix commands
readCommands(slashCommandsDir, commands.slash, 'slash')
.then(() => readCommands(prefixCommandsDir, commands.prefix, 'prefix'))
.then(() => {
res.json(commands); // Send response after both commands are read
})
.catch(err => {
console.error(err);
res.status(500).json({ error: err });
});
});
app.get('/api/activities', (req, res) => {
const activities = getActivities();
res.json(activities);
});
app.get('/api/errors', (req, res) => {
const errorsDir = path.join(__dirname, '../errors'); // Path to the errors folder
// Ensure that the folder exists
if (!fs.existsSync(errorsDir)) {
return res.json({ errors: [], message: 'No errors found' });
}
// Read the files from the errors folder
fs.readdir(errorsDir, (err, files) => {
if (err) {
return res.status(500).json({ error: 'Unable to read error logs' });
}
// Sort files by date (latest first)
files.sort((a, b) => fs.statSync(path.join(errorsDir, b)).mtime - fs.statSync(path.join(errorsDir, a)).mtime);
// Prepare an array to store errors
const errorLogs = [];
// Read the content of each error file
files.forEach(file => {
const filePath = path.join(errorsDir, file);
const content = fs.readFileSync(filePath, 'utf8');
errorLogs.push({ fileName: file, content });
});
// Send the error logs to the front-end
res.json({ errors: errorLogs });
});
});
// Start the server
app.listen(port, () => {
console.log(`Admin dashboard running at http://localhost:${port}`);
});

266
admin/public/botProfile.css Normal file
View File

@ -0,0 +1,266 @@
:root {
--primary-color: #a69cec;
--secondary-color: #00cec9;
--background-color: #2d3436;
--card-background: rgba(255, 255, 255, 0.1);
--text-color: #ffffff;
--card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
--success-color: #2ecc71;
--error-color: #e74c3c;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, var(--background-color), #4834d4);
color: var(--text-color);
line-height: 1.6;
min-height: 100vh;
}
.navbar {
background-color: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
position: fixed;
width: 100%;
top: 0;
z-index: 1000;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: var(--text-color);
}
nav ul {
list-style-type: none;
display: flex;
gap: 2rem;
}
.nav-link {
color: var(--text-color);
text-decoration: none;
font-weight: bold;
transition: color 0.3s ease, border-bottom 0.3s ease;
padding-bottom: 0.25rem;
}
.nav-link:hover {
color: var(--secondary-color);
border-bottom: 2px solid var(--secondary-color);
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 6rem 2rem 2rem;
}
.title {
text-align: center;
margin-bottom: 2rem;
font-size: 2.5rem;
color: var(--secondary-color);
}
.bot-info {
background-color: var(--card-background);
border-radius: 10px;
padding: 2rem;
box-shadow: var(--card-shadow);
margin-bottom: 2rem;
animation: fadeInUp 0.5s ease;
}
.bot-header {
display: flex;
align-items: center;
margin-bottom: 1rem;
}
.bot-avatar {
width: 100px;
height: 100px;
border-radius: 50%;
object-fit: cover;
margin-right: 1rem;
border: 3px solid var(--primary-color);
}
.bot-name-status {
flex-grow: 1;
}
.bot-name {
font-size: 1.5rem;
color: var(--secondary-color);
margin-bottom: 0.5rem;
}
.bot-banner {
width: 100%;
height: 200px;
object-fit: cover;
border-radius: 10px;
margin-bottom: 1rem;
}
.bot-details {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
}
.bot-detail {
background-color: rgba(255, 255, 255, 0.05);
padding: 1rem;
border-radius: 5px;
}
.bot-detail h3 {
color: var(--secondary-color);
margin-bottom: 0.5rem;
}
.bot-status {
display: inline-block;
padding: 0.25rem 0.5rem;
border-radius: 20px;
font-size: 0.9rem;
font-weight: bold;
}
.status-online {
background-color: var(--success-color);
}
.status-offline {
background-color: var(--error-color);
}
.bot-actions {
margin-top: 2rem;
}
.bot-actions h3 {
color: var(--secondary-color);
margin-bottom: 1rem;
}
.form-group {
margin-bottom: 1rem;
}
.bot-button {
display: flex;
align-items: center;
margin-left: 2rem;
/* Adjust spacing as needed */
}
.bot-button .nav-link {
display: flex;
align-items: center;
background-color: var(--secondary-color);
padding: 0.5rem 1rem;
border-radius: 20px;
color: var(--text-color);
transition: background-color 0.3s ease;
}
.bot-button .nav-link:hover {
background-color: #009999;
/* Darker shade for hover effect */
}
.bot-icon {
width: 40px;
height: 40px;
border-radius: 50%;
overflow: hidden;
margin-right: 0.5rem;
}
.bot-icon img {
width: 100%;
height: 100%;
object-fit: cover;
}
.bot-name {
font-weight: bold;
}
label {
display: block;
margin-bottom: 0.5rem;
color: var(--secondary-color);
}
input[type="text"],
input[type="file"] {
width: 100%;
padding: 0.5rem;
border: none;
background-color: rgba(255, 255, 255, 0.1);
color: var(--text-color);
border-radius: 5px;
}
button {
background-color: var(--primary-color);
color: var(--text-color);
border: none;
padding: 0.5rem 1rem;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
}
button:hover {
background-color: var(--secondary-color);
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@media (max-width: 768px) {
.container {
padding: 5rem 1rem 1rem;
}
.bot-details {
grid-template-columns: 1fr;
}
.bot-header {
flex-direction: column;
text-align: center;
}
.bot-avatar {
margin-right: 0;
margin-bottom: 1rem;
}
}

174
admin/public/commands.css Normal file
View File

@ -0,0 +1,174 @@
:root {
--primary-color: #a69cec;
--secondary-color: #00cec9;
--background-color: #2d3436;
--card-background: rgba(255, 255, 255, 0.1);
--text-color: #ffffff;
--card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, var(--background-color), #4834d4);
color: var(--text-color);
line-height: 1.6;
min-height: 100vh;
}
.navbar {
background-color: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
position: fixed;
width: 100%;
top: 0;
z-index: 1000;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: var(--text-color);
}
nav ul {
list-style-type: none;
display: flex;
gap: 2rem;
}
.nav-link {
color: var(--text-color);
text-decoration: none;
font-weight: bold;
transition: color 0.3s ease, border-bottom 0.3s ease;
padding-bottom: 0.25rem;
}
.nav-link:hover {
color: var(--secondary-color);
border-bottom: 2px solid var(--secondary-color);
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 6rem 2rem 2rem;
}
.title {
text-align: center;
margin-bottom: 2rem;
font-size: 2.5rem;
color: var(--secondary-color);
}
.commands-section {
margin-bottom: 3rem;
}
h2 {
color: var(--secondary-color);
margin-bottom: 1.5rem;
font-size: 1.8rem;
}
.command-cards {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 1.5rem;
}
.command-card {
background-color: var(--card-background);
border-radius: 10px;
padding: 1.5rem;
box-shadow: var(--card-shadow);
transition: transform 0.3s ease, box-shadow 0.3s ease;
opacity: 0;
transform: translateY(20px);
animation: fadeInUp 0.5s ease forwards;
}
.command-card:hover {
transform: translateY(-5px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
.bot-button {
display: flex;
align-items: center;
margin-left: 2rem;
/* Adjust spacing as needed */
}
.bot-button .nav-link {
display: flex;
align-items: center;
background-color: var(--secondary-color);
padding: 0.5rem 1rem;
border-radius: 20px;
color: var(--text-color);
transition: background-color 0.3s ease;
}
.bot-button .nav-link:hover {
background-color: #009999;
/* Darker shade for hover effect */
}
.bot-icon {
width: 40px;
height: 40px;
border-radius: 50%;
overflow: hidden;
margin-right: 0.5rem;
}
.bot-icon img {
width: 100%;
height: 100%;
object-fit: cover;
}
.bot-name {
font-weight: bold;
}
.command-card h3 {
color: var(--primary-color);
margin-bottom: 0.5rem;
font-size: 1.2rem;
}
.command-card p {
font-size: 0.9rem;
color: rgba(255, 255, 255, 0.8);
}
@keyframes fadeInUp {
to {
opacity: 1;
transform: translateY(0);
}
}
@media (max-width: 768px) {
.container {
padding: 5rem 1rem 1rem;
}
.command-cards {
grid-template-columns: 1fr;
}
}

140
admin/public/config.css Normal file
View File

@ -0,0 +1,140 @@
:root {
--primary-color: #ff6b6b;
--secondary-color: #4ecdc4;
--background-color: #1a1a2e;
--text-color: #ffffff;
--input-background: #2a2a3e;
--input-text: #ffffff;
--button-hover: #ff8787;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
color: var(--text-color);
display: flex;
justify-content: center;
align-items: center;
padding: 2rem;
}
.container {
background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
backdrop-filter: blur(10px);
border-radius: 20px;
padding: 2rem;
width: 100%;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
margin-bottom: 2rem;
color: var(--secondary-color);
font-size: 2.5rem;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}
form {
display: grid;
gap: 2rem;
}
.form-row {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1.5rem;
}
.form-group {
display: flex;
flex-direction: column;
}
label {
margin-bottom: 0.5rem;
font-weight: bold;
color: var(--secondary-color);
}
input {
padding: 0.75rem;
border: none;
border-radius: 8px;
background-color: var(--input-background);
color: var(--input-text);
font-size: 1rem;
transition: all 0.3s ease;
}
input:focus {
outline: none;
box-shadow: 0 0 0 2px var(--secondary-color);
}
.submit-button {
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
color: white;
border: none;
padding: 1rem;
border-radius: 8px;
font-size: 1.1rem;
cursor: pointer;
transition: all 0.3s ease;
text-transform: uppercase;
letter-spacing: 1px;
font-weight: bold;
width: 100%;
max-width: 300px;
justify-self: center;
}
.submit-button:hover {
background: linear-gradient(135deg, var(--button-hover), var(--secondary-color));
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.form-group-special {
position: relative;
overflow: hidden;
}
.form-group-special::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: conic-gradient(from 0deg, transparent, var(--primary-color), transparent 30%);
animation: rotate 4s linear infinite;
z-index: -1;
}
.form-group-special label,
.form-group-special input {
position: relative;
z-index: 1;
}
@keyframes rotate {
100% {
transform: rotate(360deg);
}
}
@media (max-width: 768px) {
.container {
padding: 1.5rem;
}
h1 {
font-size: 2rem;
}
.form-row {
grid-template-columns: 1fr;
}
}

166
admin/public/errors.css Normal file
View File

@ -0,0 +1,166 @@
:root {
--primary-color: #6c5ce7;
--secondary-color: #00cec9;
--background-color: #2d3436;
--card-background: rgba(255, 255, 255, 0.1);
--text-color: #ffffff;
--error-color: #ff6b6b;
--card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, var(--background-color), #4834d4);
color: var(--text-color);
line-height: 1.6;
min-height: 100vh;
}
.navbar {
background-color: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
position: fixed;
width: 100%;
top: 0;
z-index: 1000;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: var(--text-color);
}
nav ul {
list-style-type: none;
display: flex;
gap: 2rem;
}
.nav-link {
color: var(--text-color);
text-decoration: none;
font-weight: bold;
transition: color 0.3s ease, border-bottom 0.3s ease;
padding-bottom: 0.25rem;
}
.nav-link:hover {
color: var(--secondary-color);
border-bottom: 2px solid var(--secondary-color);
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 6rem 2rem 2rem;
}
.title {
text-align: center;
margin-bottom: 2rem;
font-size: 2.5rem;
color: var(--secondary-color);
}
.error-container {
background-color: var(--card-background);
border-radius: 10px;
padding: 1.5rem;
box-shadow: var(--card-shadow);
margin-bottom: 1.5rem;
transition: transform 0.3s ease, box-shadow 0.3s ease;
opacity: 0;
transform: translateY(20px);
animation: fadeInUp 0.5s ease forwards;
}
.error-container:hover {
transform: translateY(-5px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
.error-container h3 {
color: var(--error-color);
margin-bottom: 1rem;
font-size: 1.2rem;
}
.bot-button {
display: flex;
align-items: center;
margin-left: 2rem;
/* Adjust spacing as needed */
}
.bot-button .nav-link {
display: flex;
align-items: center;
background-color: var(--secondary-color);
padding: 0.5rem 1rem;
border-radius: 20px;
color: var(--text-color);
transition: background-color 0.3s ease;
}
.bot-button .nav-link:hover {
background-color: #009999;
/* Darker shade for hover effect */
}
.bot-icon {
width: 40px;
height: 40px;
border-radius: 50%;
overflow: hidden;
margin-right: 0.5rem;
}
.bot-icon img {
width: 100%;
height: 100%;
object-fit: cover;
}
.bot-name {
font-weight: bold;
}
pre {
background-color: rgba(0, 0, 0, 0.3);
color: #f8f8f2;
padding: 1rem;
border-radius: 5px;
overflow-x: auto;
font-family: 'Courier New', Courier, monospace;
font-size: 0.9rem;
}
.no-errors {
text-align: center;
font-size: 1.2rem;
color: var(--secondary-color);
}
@keyframes fadeInUp {
to {
opacity: 1;
transform: translateY(0);
}
}
@media (max-width: 768px) {
.container {
padding: 5rem 1rem 1rem;
}
}

148
admin/public/guilds.css Normal file
View File

@ -0,0 +1,148 @@
:root {
--primary-color: #a69cec;
--secondary-color: #00cec9;
--background-color: #2d3436;
--card-background: rgba(255, 255, 255, 0.1);
--text-color: #ffffff;
--card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, var(--background-color), #4834d4);
color: var(--text-color);
line-height: 1.6;
min-height: 100vh;
}
.navbar {
background-color: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
position: fixed;
height: 70px;
width: 100%;
top: 0;
z-index: 1000;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: var(--text-color);
}
nav ul {
list-style-type: none;
display: flex;
gap: 2rem;
align-items: center;
}
.nav-link {
color: var(--text-color);
text-decoration: none;
font-weight: bold;
transition: color 0.3s ease, border-bottom 0.3s ease;
padding-bottom: 0.25rem;
}
.nav-link:hover {
color: var(--secondary-color);
border-bottom: 2px solid var(--secondary-color);
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 6rem 2rem 2rem;
}
.title {
text-align: center;
margin-bottom: 2rem;
font-size: 2.5rem;
color: var(--secondary-color);
}
.guilds-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.5rem;
}
.guild-card {
background-color: var(--card-background);
border-radius: 10px;
padding: 1.5rem;
box-shadow: var(--card-shadow);
transition: transform 0.3s ease, box-shadow 0.3s ease;
opacity: 0;
transform: translateY(20px);
animation: fadeInUp 0.5s ease forwards;
}
.guild-card:hover {
transform: translateY(-5px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
.guild-header {
display: flex;
align-items: center;
margin-bottom: 1rem;
}
.guild-icon {
width: 64px;
height: 64px;
border-radius: 50%;
margin-right: 1rem;
object-fit: cover;
}
.guild-name {
font-size: 1.2rem;
font-weight: bold;
color: var(--primary-color);
}
.guild-members {
display: flex;
align-items: center;
color: var(--secondary-color);
font-size: 1rem;
}
.guild-members::before {
content: '\1F465';
/* Unicode for 'busts in silhouette' emoji */
margin-right: 0.5rem;
font-size: 1.2rem;
}
@keyframes fadeInUp {
to {
opacity: 1;
transform: translateY(0);
}
}
@media (max-width: 768px) {
.container {
padding: 5rem 1rem 1rem;
}
.guilds-grid {
grid-template-columns: 1fr;
}
}

55
admin/public/style.css Normal file
View File

@ -0,0 +1,55 @@
body {
margin: 0;
padding: 0;
font-family: 'Arial', sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: #ffffff;
min-height: 100vh;
display: flex;
width: 96vw;
flex-direction: column;
}
.banner {
margin-top: 80px;
text-align: center;
}
.banner-img {
width: 103.2%; /* Make the banner image responsive */
max-height: 300px; /* Adjust as needed */
object-fit: cover; /* Cover the space nicely */
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
flex: 1;
}
.features {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
margin-top: 2rem; /* Reduce space above the features */
}
.feature-card {
background-color: rgba(255, 255, 255, 0.1);
border-radius: 10px;
padding: 2rem;
text-align: center;
transition: transform 0.3s ease;
}
.feature-card:hover {
transform: translateY(-5px);
}
.feature-card h3 {
font-size: 1.5rem;
margin-bottom: 1rem;
}

123
admin/views/botprofile.html Normal file
View File

@ -0,0 +1,123 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="botprofile.css">
<title>DiscoBase - Bot Information</title>
</head>
<body>
<div class="navbar">
<h1 class="logo">DiscoBase</h1>
<nav>
<ul>
<li><a href="/" class="nav-link">Home</a></li>
<li><a href="/config" class="nav-link">Manage Configuration</a></li>
<li><a href="/commands" class="nav-link">Commands</a></li>
<li><a href="/errors" class="nav-link">Errors</a></li>
<li><a href="/guilds" class="nav-link">Guilds</a></li>
<li><a href="/bot" class="nav-link">Bot</a></li>
</ul>
</nav>
</div>
<div class="container">
<h1 class="title">Bot Information</h1>
<div class="bot-info">
<div class="bot-header">
<img src="" alt="Bot Avatar" class="bot-avatar" id="bot-avatar">
<div class="bot-name-status">
<h2 class="bot-name" id="bot-name">DiscoBot</h2>
<span class="bot-status status-online" id="bot-status">Online</span>
</div>
</div>
<img src="https://i.ibb.co/kGVsBgN/botbanner.png" alt="Bot Banner" class="bot-banner" id="bot-banner">
<div class="bot-details">
<div class="bot-detail">
<h3>Bot ID</h3>
<p id="bot-id">123456789</p>
</div>
<div class="bot-detail">
<h3>isVerified</h3>
<p id="bot-verify">Loading..</p>
</div>
</div>
<div class="bot-actions">
<h3>Update Bot Information</h3>
<form id="update-bot-form" method="POST" enctype="multipart/form-data">
<div class="form-group">
<label for="new-bot-name">New Bot Name</label>
<input type="text" id="new-bot-name" name="newBotName" placeholder="Enter new bot name">
</div>
<div class="form-group">
<label for="new-bot-avatar">New Bot Avatar</label>
<input type="file" id="new-bot-avatar" name="new-bot-avatar" accept="image/*">
</div>
<div class="form-group">
<label for="new-bot-banner">New Bot Banner</label>
<input type="file" id="new-bot-banner" name="new-bot-banner" accept="image/*">
</div>
<button type="submit">Update Bot</button>
</form>
</div>
</div>
</div>
<script>
// Fetch bot information
window.onload = function () {
fetch('/api/bot-info')
.then(response => response.json())
.then(data => {
document.getElementById('bot-name').textContent = data.botName;
document.getElementById('bot-status').textContent = data.botStatus;
document.getElementById('bot-status').className = `bot-status status-${data.botStatus.toLowerCase()}`;
document.getElementById('bot-id').textContent = data.botId;
document.getElementById('bot-verify').textContent = data.isVerified;
if (data.botAvatar) {
document.getElementById('bot-avatar').src = data.botAvatar;
}
if (data.botBanner) {
document.getElementById('bot-banner').src = data.botBanner;
}
})
.catch(error => console.error('Error fetching bot info:', error));
}
// Handle form submission
document.getElementById('update-bot-form').addEventListener('submit', function (e) {
e.preventDefault();
const formData = new FormData(this);
fetch('/api/update-bot', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
if (data.success) {
alert('Bot information updated successfully!');
// Refresh the page or update the displayed information
location.reload();
} else {
alert('Failed to update bot information. Please try again.');
}
})
.catch(error => {
console.error('Error updating bot info:', error);
alert('An error occurred while updating bot information.');
});
});
</script>
</body>
</html>

78
admin/views/commands.html Normal file
View File

@ -0,0 +1,78 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DiscoBase - Commands</title>
<link rel="shortcut icon" href="https://i.ibb.co/1QRfxtD/Untitled-design.png" type="image/x-icon">
<link rel="stylesheet" href="commands.css">
</head>
<body>
<div class="navbar">
<h1 class="logo">DiscoBase</h1>
<nav>
<ul>
<li><a href="/" class="nav-link">Home</a></li>
<li><a href="/config" class="nav-link">Manage Configuration</a></li>
<li><a href="/commands" class="nav-link">Commands</a></li>
<li><a href="/errors" class="nav-link">Errors</a></li>
<li><a href="/guilds" class="nav-link">Guilds</a></li>
<li><a href="/bot" class="nav-link">Bot</a></li>
</ul>
</nav>
</div>
<div class="container">
<h1 class="title">Commands</h1>
<div class="commands-section">
<h2>Slash Commands</h2>
<div class="command-cards" id="slash-commands"></div>
</div>
<div class="commands-section">
<h2>Prefix Commands</h2>
<div class="command-cards" id="prefix-commands"></div>
</div>
</div>
<script>
async function fetchCommands() {
try {
const response = await fetch('/api/commands');
const commands = await response.json();
const slashCommandsContainer = document.getElementById('slash-commands');
const prefixCommandsContainer = document.getElementById('prefix-commands');
function createCommandCard(command, index) {
const card = document.createElement('div');
card.className = 'command-card';
card.style.animationDelay = `${index * 0.1}s`;
card.innerHTML = `<h3>${command.name}</h3><p>${command.description}</p>`;
return card;
}
commands.slash.forEach((command, index) => {
slashCommandsContainer.appendChild(createCommandCard(command, index));
});
commands.prefix.forEach((command, index) => {
prefixCommandsContainer.appendChild(createCommandCard(command, index));
});
} catch (error) {
console.error('Error fetching commands:', error);
}
}
fetchCommands();
</script>
</body>
</html>

216
admin/views/config.html Normal file
View File

@ -0,0 +1,216 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="config.css">
<title>DiscoBase - Configuration Management</title>
<link rel="shortcut icon" href="https://i.ibb.co/1QRfxtD/Untitled-design.png" type="image/x-icon">
<style>
:root {
--primary-color: #a69cec;
--secondary-color: #00cec9;
--background-color: #2d3436;
--card-background: rgba(255, 255, 255, 0.1);
--text-color: #ffffff;
--card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, var(--background-color), #4834d4);
color: var(--text-color);
line-height: 1.6;
min-height: 100vh;
}
.navbar {
background-color: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
position: fixed;
width: 100%;
top: 0;
z-index: 1000;
}
.bot-button {
display: flex;
align-items: center;
margin-left: 2rem;
/* Adjust spacing as needed */
}
.bot-button .nav-link {
display: flex;
align-items: center;
background-color: var(--secondary-color);
padding: 0.5rem 1rem;
border-radius: 20px;
color: var(--text-color);
transition: background-color 0.3s ease;
}
.bot-button .nav-link:hover {
background-color: #009999;
/* Darker shade for hover effect */
}
.bot-icon {
width: 40px;
height: 40px;
border-radius: 50%;
overflow: hidden;
margin-right: 0.5rem;
}
.bot-icon img {
width: 100%;
height: 100%;
object-fit: cover;
}
.bot-name {
font-weight: bold;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: var(--text-color);
}
nav ul {
list-style-type: none;
display: flex;
gap: 2rem;
}
.nav-link {
color: var(--text-color);
text-decoration: none;
font-weight: bold;
transition: color 0.3s ease, border-bottom 0.3s ease;
padding-bottom: 0.25rem;
}
.nav-link:hover {
color: var(--secondary-color);
border-bottom: 2px solid var(--secondary-color);
}
</style>
</head>
<body>
<div class="navbar">
<h1 class="logo">DiscoBase</h1>
<nav>
<ul>
<li><a href="/" class="nav-link">Home</a></li>
<li><a href="/config" class="nav-link">Manage Configuration</a></li>
<li><a href="/commands" class="nav-link">Commands</a></li>
<li><a href="/commands" class="nav-link">Errors</a></li>
<li><a href="/guilds" class="nav-link">Guilds</a></li>
<li><a href="/bot" class="nav-link">Bot</a></li>
</ul>
</nav>
</div>
<div class="container">
<h1>Configuration Management</h1>
<form action="/update-config" method="POST">
<div class="form-row">
<div class="form-group form-group-special">
<label for="token">Bot Token:</label>
<input type="password" id="token" name="token">
</div>
<div class="form-group form-group-special">
<label for="id">Bot ID:</label>
<input type="text" id="id" name="id">
</div>
<div class="form-group">
<label for="prefix">Command Prefix:</label>
<input type="text" id="prefix" name="prefix">
</div>
</div>
<div class="form-row">
<div class="form-group">
<label for="admins">Admin IDs (comma-separated):</label>
<input type="text" id="admins" name="admins">
</div>
<div class="form-group">
<label for="ownerId">Owner ID:</label>
<input type="text" id="ownerId" name="ownerId">
</div>
<div class="form-group">
<label for="developerCommandsServerIds">Developer Commands Server IDs:</label>
<input type="text" id="developerCommandsServerIds" name="developerCommandsServerIds">
</div>
</div>
<div class="form-row">
<div class="form-group">
<label for="mongodbUrl">MongoDB URL:</label>
<input type="password" id="mongodbUrl" name="mongodbUrl">
</div>
<div class="form-group">
<label for="guildJoinLogsId">Guild Join Logs Channel ID:</label>
<input type="text" id="guildJoinLogsId" name="guildJoinLogsId">
</div>
<div class="form-group">
<label for="guildLeaveLogsId">Guild Leave Logs Channel ID:</label>
<input type="text" id="guildLeaveLogsId" name="guildLeaveLogsId">
</div>
</div>
<div class="form-row">
<div class="form-group">
<label for="commandLogsChannelId">Command Logs Channel ID:</label>
<input type="text" id="commandLogsChannelId" name="commandLogsChannelId">
</div>
<div class="form-group">
<label for="errorLogs">Error Logs Webhook URL:</label>
<input type="password" id="errorLogs" name="errorLogs">
</div>
</div>
<button type="submit" class="submit-button">Update Config</button>
</form>
</div>
<script>
window.onload = function () {
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.get('success') === 'true') {
alert('Configuration updated successfully!');
}
};
</script>
</body>
</html>

71
admin/views/errors.html Normal file
View File

@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DiscoBase - Error Logs</title>
<link rel="shortcut icon" href="https://i.ibb.co/1QRfxtD/Untitled-design.png" type="image/x-icon">
<link rel="stylesheet" href="errors.css">
</head>
<body>
<div class="navbar">
<h1 class="logo">DiscoBase</h1>
<nav>
<ul>
<li><a href="/" class="nav-link">Home</a></li>
<li><a href="/config" class="nav-link">Manage Configuration</a></li>
<li><a href="/commands" class="nav-link">Commands</a></li>
<li><a href="/errors" class="nav-link">Error</a></li>
<li><a href="/guilds" class="nav-link">Guilds</a></li>
<li><a href="/bot" class="nav-link">Bot</a></li>
</ul>
</nav>
</div>
<div class="container">
<h1 class="title">Error Logs</h1>
<div id="errorLogs"></div>
</div>
<script>
// Fetch error logs from the server
fetch('/api/errors')
.then(response => response.json())
.then(data => {
const errorLogsContainer = document.getElementById('errorLogs');
// Check if there are any errors
if (data.errors.length === 0) {
errorLogsContainer.innerHTML = '<p class="no-errors">No error logs found.</p>';
return;
}
// Display each error log
data.errors.forEach((log, index) => {
const logDiv = document.createElement('div');
logDiv.classList.add('error-container');
logDiv.style.animationDelay = `${index * 0.1}s`;
const fileName = document.createElement('h3');
fileName.textContent = `Error File: ${log.fileName}`;
logDiv.appendChild(fileName);
const errorContent = document.createElement('pre');
errorContent.textContent = log.content;
logDiv.appendChild(errorContent);
errorLogsContainer.appendChild(logDiv);
});
})
.catch(error => {
console.error('Error fetching logs:', error);
document.getElementById('errorLogs').innerHTML = '<p class="no-errors">Error loading logs.</p>';
});
</script>
</body>
</html>

74
admin/views/guilds.html Normal file
View File

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DiscoBase - Guilds</title>
<link rel="shortcut icon" href="https://i.ibb.co/1QRfxtD/Untitled-design.png" type="image/x-icon">
<link rel="stylesheet" href="guilds.css">
</head>
<body>
<div class="navbar">
<h1 class="logo">DiscoBase</h1>
<nav>
<ul>
<li><a href="/" class="nav-link">Home</a></li>
<li><a href="/config" class="nav-link">Manage Configuration</a></li>
<li><a href="/commands" class="nav-link">Commands</a></li>
<li><a href="/errors" class="nav-link">Error</a></li>
<li><a href="/guilds" class="nav-link">Guilds</a></li>
<li><a href="/bot" class="nav-link">Bot</a></li>
</ul>
</nav>
</div>
<div class="container">
<h1 class="title">Guilds</h1>
<div class="guilds-grid" id="guilds-container">
<!-- Guild cards will be dynamically added here -->
</div>
</div>
<script>
async function fetchGuilds() {
try {
// Replace this URL with your actual API endpoint
const response = await fetch('/api/guilds');
if (!response.ok) throw new Error('Network response was not ok');
const guilds = await response.json();
return guilds;
} catch (error) {
console.error('Error fetching guilds:', error);
return []; // Return an empty array on error
}
}
function createGuildCard(guild) {
return `
<div class="guild-card">
<div class="guild-header">
<img src="${guild.icon}" alt="${guild.name}" class="guild-icon">
<h3 class="guild-name">${guild.name}</h3>
</div>
<div class="guild-members">${guild.memberCount} members</div>
</div>
`;
}
window.onload = async function () {
const guildsContainer = document.getElementById('guilds-container');
const guilds = await fetchGuilds(); // Fetch the guilds dynamically
guilds.forEach(guild => {
guildsContainer.innerHTML += createGuildCard(guild);
});
}
</script>
</body>
</html>

309
admin/views/index.html Normal file
View File

@ -0,0 +1,309 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DiscoBase - Dashboard</title>
<link rel="shortcut icon" href="https://i.ibb.co/1QRfxtD/Untitled-design.png" type="image/x-icon">
<style>
:root {
--primary-color: #a69cec;
--secondary-color: #00cec9;
--background-color: #2d3436;
--card-background: rgba(255, 255, 255, 0.1);
--text-color: #ffffff;
--card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, var(--background-color), #4834d4);
color: var(--text-color);
line-height: 1.6;
min-height: 100vh;
}
.navbar {
background-color: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
position: fixed;
height: 70px;
width: 100%;
top: 0;
z-index: 1000;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: var(--text-color);
}
nav ul {
list-style-type: none;
display: flex;
gap: 2rem;
align-items: center;
}
.nav-link {
color: var(--text-color);
text-decoration: none;
font-weight: bold;
transition: color 0.3s ease, border-bottom 0.3s ease;
padding-bottom: 0.25rem;
}
.nav-link:hover {
color: var(--secondary-color);
border-bottom: 2px solid var(--secondary-color);
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 6rem 2rem 2rem;
}
.title {
text-align: center;
margin-bottom: 2rem;
font-size: 2.5rem;
color: var(--secondary-color);
}
.dashboard-cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.5rem;
margin-bottom: 2rem;
}
.dashboard-card {
background-color: var(--card-background);
border-radius: 10px;
padding: 1.5rem;
box-shadow: var(--card-shadow);
transition: transform 0.3s ease, box-shadow 0.3s ease;
opacity: 0;
transform: translateY(20px);
animation: fadeInUp 0.5s ease forwards;
}
.dashboard-card:hover {
transform: translateY(-5px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
.dashboard-card h3 {
color: var(--primary-color);
margin-bottom: 0.5rem;
font-size: 1.2rem;
}
.dashboard-card p {
font-size: 1.8rem;
font-weight: bold;
color: var(--secondary-color);
}
.recent-activity {
background-color: var(--card-background);
border-radius: 10px;
padding: 1.5rem;
box-shadow: var(--card-shadow);
}
.recent-activity h2 {
color: var(--secondary-color);
margin-bottom: 1rem;
font-size: 1.5rem;
}
.activity-list {
list-style-type: none;
}
.activity-item {
background-color: rgba(255, 255, 255, 0.05);
border-radius: 5px;
padding: 1rem;
margin-bottom: 0.5rem;
}
.bot-button {
display: flex;
align-items: center;
margin-left: 2rem;
/* Adjust spacing as needed */
}
.bot-button .nav-link {
display: flex;
align-items: center;
background-color: var(--secondary-color);
padding: 0.5rem 1rem;
border-radius: 20px;
color: var(--text-color);
transition: background-color 0.3s ease;
}
.bot-button .nav-link:hover {
background-color: #009999;
/* Darker shade for hover effect */
}
.bot-icon {
width: 40px;
height: 40px;
border-radius: 50%;
overflow: hidden;
margin-right: 0.5rem;
}
.bot-icon img {
width: 100%;
height: 100%;
object-fit: cover;
}
.bot-name {
font-weight: bold;
}
@keyframes fadeInUp {
to {
opacity: 1;
transform: translateY(0);
}
}
@media (max-width: 768px) {
.container {
padding: 5rem 1rem 1rem;
}
.dashboard-cards {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="navbar">
<h1 class="logo">DiscoBase</h1>
<nav>
<ul>
<li><a href="/" class="nav-link">Home</a></li>
<li><a href="/config" class="nav-link">Manage Configuration</a></li>
<li><a href="/commands" class="nav-link">Commands</a></li>
<li><a href="/errors" class="nav-link">Error</a></li>
<li><a href="/guilds" class="nav-link">Guilds</a></li>
<li class="bot-button">
<a href="/bot" class="nav-link">
<div class="bot-icon">
<img id="botIcon" src="" alt="Bot Icon" />
</div>
<span class="bot-name" id="bot-name">Loading..</span>
</a>
</li>
</ul>
</nav>
</div>
<div class="container">
<h1 class="title">Dashboard</h1>
<div class="dashboard-cards">
<div class="dashboard-card">
<h3>Total Servers</h3>
<p id="total-servers">0</p>
</div>
<div class="dashboard-card">
<h3>Total Users</h3>
<p id="total-users">0</p>
</div>
<div class="dashboard-card">
<h3>Total Commands (Prefix & Slash)</h3>
<p id="total-commands">0</p>
</div>
</div>
<div class="recent-activity">
<h2>Recent Activity</h2>
<ul class="activity-list" id="activity-list">
<!-- Activity items will be dynamically added here -->
</ul>
</div>
</div>
<script>
window.onload = function () {
fetch('/api/bot-stats')
.then(response => response.json())
.then(data => {
document.getElementById('total-servers').textContent = data.totalServers;
document.getElementById('total-users').textContent = data.totalUsers;
document.getElementById('total-commands').textContent = data.totalCommands;
document.getElementById('bot-name').innerHTML = data.botName;
document.getElementById('botIcon').src = data.botIcon;
console.log(data.botIcon)
}).catch(error => console.error('Error fetching dashboard stats:', error));
fetch('/api/activities')
.then(response => response.json())
.then(activities => {
const activityList = document.getElementById('activity-list');
activities.forEach(activity => {
const li = document.createElement('li');
li.className = 'activity-item';
// Change color based on the action
if (activity.action === 'added') {
li.style.backgroundColor = '#d4edda'; // Light green for added
li.style.color = 'black'
} else if (activity.action === 'removed') {
li.style.backgroundColor = '#f8d7da'; // Light red for removed
li.style.color = 'black'
} else if (activity.action === 'changed') {
li.style.backgroundColor = '#fff3cd'; // Light yellow for changed
li.style.color = 'black'
}
const details = document.createElement('div');
details.className = 'activity-details';
details.innerHTML = `<strong>${activity.action}</strong> - ${activity.filePath}`;
const timestamp = document.createElement('span');
timestamp.className = 'timestamp';
timestamp.textContent = new Date(activity.timestamp).toLocaleString();
li.appendChild(details);
li.appendChild(timestamp);
// Insert new activity items at the top
activityList.prepend(li);
});
})
.catch(error => console.error('Error fetching activities:', error));
}
</script>
</body>
</html>

153
cli.js Normal file
View File

@ -0,0 +1,153 @@
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const { select, text, confirm } = require('@clack/prompts');
const chalk = require('chalk');
// Templates for different file types
const templates = {
command: `const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('your-command')
.setDescription('Describe your command here.'),
async execute(interaction, client) {
// Command execution logic goes here
}
};`,
prefix: `//! This is a basic structure for a prefix command in discoBase using discord.js
module.exports = {
name: 'command-name',
description: 'command-description.',
aliases: ['alias_1', 'alias_2'],
run: async (client, message, args) => {
// Command execution logic goes here
},
};`,
event: `module.exports = {
name: 'event-name',
async execute(eventObject, client) {
// Event handling logic goes here
}
};`
};
// Logging function with styling
const logWithStyle = (message, type = 'info') => {
const styles = {
success: chalk.green.bold(`${message}`),
error: chalk.red.bold(`${message}`),
info: chalk.blueBright.bold(` ${message}`),
};
console.log(styles[type] || message);
};
// Function to create a file with content
const createFile = (filePath, template) => {
fs.writeFile(filePath, template.trim(), (err) => {
if (err) return logWithStyle(`Error: ${err.message}`, 'error');
const relativePath = path.relative(path.join(__dirname, 'src'), filePath);
logWithStyle(`File created at ${relativePath}`, 'success');
});
};
// Main execution of the 'generate' command
(async () => {
// Ask for the file type
const fileType = await select({
message: 'Select the type of file to generate:',
options: [
{ value: 'command', label: 'Command' },
{ value: 'event', label: 'Event' },
{ value: 'prefix', label: 'Prefix Command' }
],
});
const fileName = await text({
message: `Enter the name of the ${fileType} file (without extension):`,
initial: '',
});
const folderMap = {
command: 'commands',
event: 'events',
prefix: 'messages'
};
const folderSelection = folderMap[fileType];
const selectedFolderPath = path.join(__dirname, 'src', folderSelection);
// Check if the folder exists, if not, ask to create it
if (!fs.existsSync(selectedFolderPath)) {
const createFolder = await confirm({
message: `The folder ${folderSelection} does not exist. Do you want to create it?`,
});
if (createFolder) {
fs.mkdirSync(selectedFolderPath, { recursive: true });
logWithStyle(`Folder ${folderSelection} created successfully.`, 'success');
} else {
logWithStyle('Folder creation aborted.', 'error');
return;
}
}
// Get the subfolders within the selected folder
let subFolders = fs.readdirSync(selectedFolderPath).filter(item => fs.statSync(path.join(selectedFolderPath, item)).isDirectory());
// If no subfolders, ask if the user wants to create one
if (subFolders.length === 0) {
const createSubfolder = await confirm({
message: `No subfolders exist in ${folderSelection}. Would you like to create one?`,
});
if (createSubfolder) {
const subfolderName = await text({
message: `Enter the name of the new subfolder:`,
initial: '',
});
const newSubfolderPath = path.join(selectedFolderPath, subfolderName);
fs.mkdirSync(newSubfolderPath, { recursive: true });
logWithStyle(`Subfolder ${subfolderName} created successfully.`, 'success');
subFolders = [subfolderName];
} else {
logWithStyle('Subfolder creation aborted.', 'error');
return;
}
}
// Let the user select an existing subfolder or create a new one
const subfolderSelection = await select({
message: 'Select the subfolder to create the file in (or choose to create a new folder):',
options: [
...subFolders.map(subfolder => ({ value: subfolder, label: subfolder })),
{ value: 'new', label: 'Create new folder' }
]
});
let subfolderPath;
if (subfolderSelection === 'new') {
const newSubfolderName = await text({
message: 'Enter the name of the new subfolder:',
initial: '',
});
subfolderPath = path.join(selectedFolderPath, newSubfolderName);
fs.mkdirSync(subfolderPath, { recursive: true });
logWithStyle(`New subfolder ${newSubfolderName} created successfully.`, 'success');
} else {
subfolderPath = path.join(selectedFolderPath, subfolderSelection);
}
// Create the file
const filePath = path.join(subfolderPath, `${fileName}.js`);
if (fs.existsSync(filePath)) {
logWithStyle(`File already exists: ${filePath}`, 'error');
} else {
createFile(filePath, templates[fileType]);
}
})();

26
config.json Normal file
View File

@ -0,0 +1,26 @@
{
"bot": {
"token": "MTM1Njk3NTM4MzgxMTA2ODAzMQ.GUqXj_.tKGhbBytofKo79Uvrmd8_08kKDPrWX1yYAxpbw",
"id": "1356975383811068031",
"admins": [
"477999574804594708",
"428524753213456385"
],
"ownerId": "477999574804594708",
"developerCommandsServerIds": [
"477999574804594708"
]
},
"database": {
"mongodbUrl": "YOUR_MONGODB_URL"
},
"logging": {
"guildJoinLogsId": "GUILD_JOIN_LOGS_CHANNEL_ID",
"guildLeaveLogsId": "GUILD_LEAVE_LOGS_CHANNEL_ID",
"commandLogsChannelId": "COMMAND_LOGS_CHANNEL_ID",
"errorLogs": "YOUR_WEBHOOK_URL"
},
"prefix": {
"value": "/"
}
}

66
contributing.md Normal file
View File

@ -0,0 +1,66 @@
# Contributing to discoBase
First of all, thank you for considering contributing to discoBase! Your support helps improve this package and make it better for everyone.
## How Can You Contribute?
- Reporting bugs
- Suggesting features
- Submitting code improvements or new features
- Improving documentation
## Guidelines for Contribution
### 1. Reporting Bugs
If you find a bug, please report it by opening an [issue]([https://github.com/your-repo/discoBase/issues](https://github.com/ethical-programmer/discobase/issues)). Provide as much detail as possible:
- Steps to reproduce the bug
- Version of discoBase you're using
- Any error logs
### 2. Suggesting Features
Do you have an idea for a new feature? We'd love to hear it! Open an [issue]([https://github.com/your-repo/discoBase/issues](https://github.com/ethical-programmer/discobase/issues)) and explain the feature you'd like to see, along with any use cases.
### 3. Submitting Code Changes
To submit a code change:
1. **Fork the repository** on GitHub.
2. **Clone your fork** locally:
```bash
git clone https://github.com/ethical-programmer/discobase
```
3. **Create a new branch** for your changes:
```bash
git checkout -b feature/your-feature
```
4. **Make your changes** to the codebase.
5. **Commit your changes**:
```bash
git commit -m "Added a cool new feature"
```
6. **Push to your branch**:
```bash
git push origin feature/your-feature
```
7. **Open a Pull Request** on GitHub.
### 4. Coding Standards
- Use consistent formatting and indentation.
- Write clear, concise commit messages.
- Make sure your code is well-documented and includes comments where necessary.
### 5. Testing Your Changes
Ensure that your changes do not introduce any errors or issues by thoroughly testing them before submitting. You can run the project locally to verify this.
### 6. Improving Documentation
Even if you're not a developer, improving the documentation is a great way to contribute! You can submit fixes for typos or add missing sections that help other users understand the project better.
---
Thank you for taking the time to contribute!

14
database/db.js Normal file
View File

@ -0,0 +1,14 @@
const mysql = require('mysql2/promise');
const pool = mysql.createPool({
host: "192.168.88.134",
user: "bxio_loginn",
password: "MasterOKEM#1",
database: "bxio_discord",
waitForConnections: true,
connectionLimit: 10,
queueLimit: 0
});
// Exporta o pool para ser usado com conn.query(...)
module.exports = pool;

View File

@ -0,0 +1,20 @@
Error: Cannot find module 'mongoose'
Require stack:
- /root/arisu/src/events/handlers/ready.js
- /root/arisu/src/functions/handlers/handelEvents.js
- /root/arisu/src/index.js
Error: Cannot find module 'mongoose'
Require stack:
- /root/arisu/src/events/handlers/ready.js
- /root/arisu/src/functions/handlers/handelEvents.js
- /root/arisu/src/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
at Module._load (node:internal/modules/cjs/loader:975:27)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at Object.<anonymous> (/root/arisu/src/events/handlers/ready.js:2:18)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,20 @@
Error: Cannot find module 'mongoose'
Require stack:
- /root/arisu/src/events/handlers/ready.js
- /root/arisu/src/functions/handlers/handelEvents.js
- /root/arisu/src/index.js
Error: Cannot find module 'mongoose'
Require stack:
- /root/arisu/src/events/handlers/ready.js
- /root/arisu/src/functions/handlers/handelEvents.js
- /root/arisu/src/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
at Module._load (node:internal/modules/cjs/loader:975:27)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at Object.<anonymous> (/root/arisu/src/events/handlers/ready.js:2:18)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,20 @@
Error: Cannot find module 'mongoose'
Require stack:
- /root/arisu/src/events/handlers/ready.js
- /root/arisu/src/functions/handlers/handelEvents.js
- /root/arisu/src/index.js
Error: Cannot find module 'mongoose'
Require stack:
- /root/arisu/src/events/handlers/ready.js
- /root/arisu/src/functions/handlers/handelEvents.js
- /root/arisu/src/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
at Module._load (node:internal/modules/cjs/loader:975:27)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at Object.<anonymous> (/root/arisu/src/events/handlers/ready.js:2:18)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,24 @@
Error: Cannot find module 'mysql2/promise'
Require stack:
- /root/arisu/database/db.js
- /root/arisu/src/commands/Community/testeadd.js
- /root/arisu/src/functions/handlers/handleCommands.js
- /root/arisu/admin/dashboard.js
- /root/arisu/src/index.js
Error: Cannot find module 'mysql2/promise'
Require stack:
- /root/arisu/database/db.js
- /root/arisu/src/commands/Community/testeadd.js
- /root/arisu/src/functions/handlers/handleCommands.js
- /root/arisu/admin/dashboard.js
- /root/arisu/src/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
at Module._load (node:internal/modules/cjs/loader:975:27)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at Object.<anonymous> (/root/arisu/database/db.js:1:15)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,24 @@
Error: Cannot find module 'mysql2/promise'
Require stack:
- /root/arisu/database/db.js
- /root/arisu/src/commands/Community/testeadd.js
- /root/arisu/src/functions/handlers/handleCommands.js
- /root/arisu/admin/dashboard.js
- /root/arisu/src/index.js
Error: Cannot find module 'mysql2/promise'
Require stack:
- /root/arisu/database/db.js
- /root/arisu/src/commands/Community/testeadd.js
- /root/arisu/src/functions/handlers/handleCommands.js
- /root/arisu/admin/dashboard.js
- /root/arisu/src/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
at Module._load (node:internal/modules/cjs/loader:975:27)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at Object.<anonymous> (/root/arisu/database/db.js:1:15)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,24 @@
Error: Cannot find module 'mysql2/promise'
Require stack:
- /root/arisu/database/db.js
- /root/arisu/src/commands/Community/testeadd.js
- /root/arisu/src/functions/handlers/handleCommands.js
- /root/arisu/admin/dashboard.js
- /root/arisu/src/index.js
Error: Cannot find module 'mysql2/promise'
Require stack:
- /root/arisu/database/db.js
- /root/arisu/src/commands/Community/testeadd.js
- /root/arisu/src/functions/handlers/handleCommands.js
- /root/arisu/admin/dashboard.js
- /root/arisu/src/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
at Module._load (node:internal/modules/cjs/loader:975:27)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at Object.<anonymous> (/root/arisu/database/db.js:1:15)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,24 @@
Error: Cannot find module 'mysql2/promise'
Require stack:
- /root/arisu/database/db.js
- /root/arisu/src/commands/Community/testeadd.js
- /root/arisu/src/functions/handlers/handleCommands.js
- /root/arisu/admin/dashboard.js
- /root/arisu/src/index.js
Error: Cannot find module 'mysql2/promise'
Require stack:
- /root/arisu/database/db.js
- /root/arisu/src/commands/Community/testeadd.js
- /root/arisu/src/functions/handlers/handleCommands.js
- /root/arisu/admin/dashboard.js
- /root/arisu/src/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
at Module._load (node:internal/modules/cjs/loader:975:27)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at Object.<anonymous> (/root/arisu/database/db.js:1:15)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,24 @@
Error: Cannot find module 'mysql2/promise'
Require stack:
- /root/arisu/database/db.js
- /root/arisu/src/commands/Community/testeadd.js
- /root/arisu/src/functions/handlers/handleCommands.js
- /root/arisu/admin/dashboard.js
- /root/arisu/src/index.js
Error: Cannot find module 'mysql2/promise'
Require stack:
- /root/arisu/database/db.js
- /root/arisu/src/commands/Community/testeadd.js
- /root/arisu/src/functions/handlers/handleCommands.js
- /root/arisu/admin/dashboard.js
- /root/arisu/src/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
at Module._load (node:internal/modules/cjs/loader:975:27)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at Object.<anonymous> (/root/arisu/database/db.js:1:15)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,24 @@
Error: Cannot find module 'mysql2/promise'
Require stack:
- /root/arisu/database/db.js
- /root/arisu/src/commands/Community/testeadd.js
- /root/arisu/src/functions/handlers/handleCommands.js
- /root/arisu/admin/dashboard.js
- /root/arisu/src/index.js
Error: Cannot find module 'mysql2/promise'
Require stack:
- /root/arisu/database/db.js
- /root/arisu/src/commands/Community/testeadd.js
- /root/arisu/src/functions/handlers/handleCommands.js
- /root/arisu/admin/dashboard.js
- /root/arisu/src/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
at Module._load (node:internal/modules/cjs/loader:975:27)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at Object.<anonymous> (/root/arisu/database/db.js:1:15)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,24 @@
Error: Cannot find module 'mysql2/promise'
Require stack:
- /root/arisu/database/db.js
- /root/arisu/src/commands/Community/testeadd.js
- /root/arisu/src/functions/handlers/handleCommands.js
- /root/arisu/admin/dashboard.js
- /root/arisu/src/index.js
Error: Cannot find module 'mysql2/promise'
Require stack:
- /root/arisu/database/db.js
- /root/arisu/src/commands/Community/testeadd.js
- /root/arisu/src/functions/handlers/handleCommands.js
- /root/arisu/admin/dashboard.js
- /root/arisu/src/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
at Module._load (node:internal/modules/cjs/loader:975:27)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at Object.<anonymous> (/root/arisu/database/db.js:1:15)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,12 @@
TypeError: Found non-callable @@iterator
TypeError: Found non-callable @@iterator
at /root/arisu/src/commands/Community/testeadd.js:40:18
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:36:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)

View File

@ -0,0 +1,12 @@
TypeError: Found non-callable @@iterator
TypeError: Found non-callable @@iterator
at /root/arisu/src/commands/Community/testeadd.js:40:18
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:36:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)

View File

@ -0,0 +1,12 @@
TypeError: Found non-callable @@iterator
TypeError: Found non-callable @@iterator
at /root/arisu/src/commands/Community/testeadd.js:40:18
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:36:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)

View File

@ -0,0 +1,12 @@
TypeError: Found non-callable @@iterator
TypeError: Found non-callable @@iterator
at /root/arisu/src/commands/Community/testeadd.js:40:18
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:36:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,12 @@
ReferenceError: choicess is not defined
ReferenceError: choicess is not defined
at /root/arisu/src/commands/Community/testeadd.js:46:32
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:42:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,12 @@
ReferenceError: choicess is not defined
ReferenceError: choicess is not defined
at /root/arisu/src/commands/Community/testeadd.js:46:32
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:42:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,16 @@
SyntaxError: Unexpected token 'async'
/root/arisu/src/commands/Community/testeadd.js:32
async execute(interaction, client) {
^^^^^
SyntaxError: Unexpected token 'async'
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1274:20)
at Module._compile (node:internal/modules/cjs/loader:1320:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at loadCommand (/root/arisu/src/functions/handlers/handleCommands.js:77:25)
at FSWatcher.<anonymous> (/root/arisu/src/functions/handlers/handleCommands.js:263:13)

View File

@ -0,0 +1,16 @@
SyntaxError: Unexpected token 'async'
/root/arisu/src/commands/Community/testeadd.js:32
async execute(interaction, client) {
^^^^^
SyntaxError: Unexpected token 'async'
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1274:20)
at Module._compile (node:internal/modules/cjs/loader:1320:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at loadCommand (/root/arisu/src/functions/handlers/handleCommands.js:77:25)
at loadCommands (/root/arisu/src/functions/handlers/handleCommands.js:102:25)

View File

@ -0,0 +1,16 @@
SyntaxError: await is only valid in async functions and the top level bodies of modules
/root/arisu/src/commands/Community/testeadd.js:14
const choices = await getChoicesFromDatabase();
^^^^^
SyntaxError: await is only valid in async functions and the top level bodies of modules
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1274:20)
at Module._compile (node:internal/modules/cjs/loader:1320:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at loadCommand (/root/arisu/src/functions/handlers/handleCommands.js:77:25)
at FSWatcher.<anonymous> (/root/arisu/src/functions/handlers/handleCommands.js:263:13)

View File

@ -0,0 +1,12 @@
TypeError: Found non-callable @@iterator
TypeError: Found non-callable @@iterator
at /root/arisu/src/commands/Community/testeadd.js:24:14
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:20:6)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)

View File

@ -0,0 +1,12 @@
TypeError: Found non-callable @@iterator
TypeError: Found non-callable @@iterator
at /root/arisu/src/commands/Community/testeadd.js:24:14
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:20:6)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)

View File

@ -0,0 +1,16 @@
SyntaxError: await is only valid in async functions and the top level bodies of modules
/root/arisu/src/commands/Community/testeadd.js:7
const [rows] = await conn.execute(query);
^^^^^
SyntaxError: await is only valid in async functions and the top level bodies of modules
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1274:20)
at Module._compile (node:internal/modules/cjs/loader:1320:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at loadCommand (/root/arisu/src/functions/handlers/handleCommands.js:77:25)
at loadCommands (/root/arisu/src/functions/handlers/handleCommands.js:102:25)

View File

@ -0,0 +1,16 @@
SyntaxError: await is only valid in async functions and the top level bodies of modules
/root/arisu/src/commands/Community/testeadd.js:7
const [rows] = await conn.execute(query);
^^^^^
SyntaxError: await is only valid in async functions and the top level bodies of modules
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1274:20)
at Module._compile (node:internal/modules/cjs/loader:1320:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at loadCommand (/root/arisu/src/functions/handlers/handleCommands.js:77:25)
at FSWatcher.<anonymous> (/root/arisu/src/functions/handlers/handleCommands.js:263:13)

View File

@ -0,0 +1,16 @@
SyntaxError: await is only valid in async functions and the top level bodies of modules
/root/arisu/src/commands/Community/testeadd.js:7
const [rows] = await conn.execute(query);
^^^^^
SyntaxError: await is only valid in async functions and the top level bodies of modules
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1274:20)
at Module._compile (node:internal/modules/cjs/loader:1320:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at loadCommand (/root/arisu/src/functions/handlers/handleCommands.js:77:25)
at loadCommands (/root/arisu/src/functions/handlers/handleCommands.js:102:25)

View File

@ -0,0 +1,12 @@
TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))
TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))
at getChoicesFromDatabase (/root/arisu/src/commands/Community/testeadd.js:7:20)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:14:17)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at loadCommand (/root/arisu/src/functions/handlers/handleCommands.js:77:25)
at FSWatcher.<anonymous> (/root/arisu/src/functions/handlers/handleCommands.js:263:13)

View File

@ -0,0 +1,12 @@
TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))
TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))
at getChoicesFromDatabase (/root/arisu/src/commands/Community/testeadd.js:7:20)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:14:17)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at loadCommand (/root/arisu/src/functions/handlers/handleCommands.js:77:25)
at loadCommands (/root/arisu/src/functions/handlers/handleCommands.js:102:25)

View File

@ -0,0 +1,16 @@
SyntaxError: await is only valid in async functions and the top level bodies of modules
/root/arisu/src/commands/Community/testeadd.js:14
const choices = await getChoicesFromDatabase();
^^^^^
SyntaxError: await is only valid in async functions and the top level bodies of modules
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1274:20)
at Module._compile (node:internal/modules/cjs/loader:1320:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at loadCommand (/root/arisu/src/functions/handlers/handleCommands.js:77:25)
at FSWatcher.<anonymous> (/root/arisu/src/functions/handlers/handleCommands.js:263:13)

View File

@ -0,0 +1,16 @@
SyntaxError: await is only valid in async functions and the top level bodies of modules
/root/arisu/src/commands/Community/testeadd.js:14
const choices = await getChoicesFromDatabase();
^^^^^
SyntaxError: await is only valid in async functions and the top level bodies of modules
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1274:20)
at Module._compile (node:internal/modules/cjs/loader:1320:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at loadCommand (/root/arisu/src/functions/handlers/handleCommands.js:77:25)
at loadCommands (/root/arisu/src/functions/handlers/handleCommands.js:102:25)

View File

@ -0,0 +1,16 @@
SyntaxError: await is only valid in async functions and the top level bodies of modules
/root/arisu/src/commands/Community/testeadd.js:14
const choices = await getChoicesFromDatabase();
^^^^^
SyntaxError: await is only valid in async functions and the top level bodies of modules
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1274:20)
at Module._compile (node:internal/modules/cjs/loader:1320:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at loadCommand (/root/arisu/src/functions/handlers/handleCommands.js:77:25)
at FSWatcher.<anonymous> (/root/arisu/src/functions/handlers/handleCommands.js:263:13)

View File

@ -0,0 +1,16 @@
SyntaxError: await is only valid in async functions and the top level bodies of modules
/root/arisu/src/commands/Community/testeadd.js:14
const choices = await getChoicesFromDatabase();
^^^^^
SyntaxError: await is only valid in async functions and the top level bodies of modules
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1274:20)
at Module._compile (node:internal/modules/cjs/loader:1320:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at loadCommand (/root/arisu/src/functions/handlers/handleCommands.js:77:25)
at loadCommands (/root/arisu/src/functions/handlers/handleCommands.js:102:25)

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,16 @@
SyntaxError: await is only valid in async functions and the top level bodies of modules
/root/arisu/src/commands/Community/testeadd.js:6
const [rows] = await conn.execute(query);
^^^^^
SyntaxError: await is only valid in async functions and the top level bodies of modules
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1274:20)
at Module._compile (node:internal/modules/cjs/loader:1320:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at loadCommand (/root/arisu/src/functions/handlers/handleCommands.js:77:25)
at FSWatcher.<anonymous> (/root/arisu/src/functions/handlers/handleCommands.js:263:13)

View File

@ -0,0 +1,12 @@
TypeError: rows.map is not a function
TypeError: rows.map is not a function
at getChoicesFromDatabase (/root/arisu/src/commands/Community/testeadd.js:16:26)
at /root/arisu/src/commands/Community/testeadd.js:40:32
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:35:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,12 @@
TypeError: rows.map is not a function
TypeError: rows.map is not a function
at getChoicesFromDatabase (/root/arisu/src/commands/Community/testeadd.js:16:26)
at /root/arisu/src/commands/Community/testeadd.js:40:32
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:35:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,12 @@
TypeError: rows.map is not a function
TypeError: rows.map is not a function
at getChoicesFromDatabase (/root/arisu/src/commands/Community/testeadd.js:16:26)
at /root/arisu/src/commands/Community/testeadd.js:40:32
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:35:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,12 @@
TypeError: rows.map is not a function
TypeError: rows.map is not a function
at getChoicesFromDatabase (/root/arisu/src/commands/Community/testeadd.js:16:26)
at /root/arisu/src/commands/Community/testeadd.js:40:32
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:35:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,12 @@
TypeError: rows.map is not a function
TypeError: rows.map is not a function
at getChoicesFromDatabase (/root/arisu/src/commands/Community/testeadd.js:16:26)
at /root/arisu/src/commands/Community/testeadd.js:42:32
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:37:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,12 @@
TypeError: rows.map is not a function
TypeError: rows.map is not a function
at getChoicesFromDatabase (/root/arisu/src/commands/Community/testeadd.js:16:26)
at /root/arisu/src/commands/Community/testeadd.js:42:32
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:37:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,12 @@
ReferenceError: choices is not defined
ReferenceError: choices is not defined
at getChoicesFromDatabase (/root/arisu/src/commands/Community/testeadd.js:34:5)
at /root/arisu/src/commands/Community/testeadd.js:47:32
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:42:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,12 @@
ReferenceError: choices is not defined
ReferenceError: choices is not defined
at getChoicesFromDatabase (/root/arisu/src/commands/Community/testeadd.js:34:5)
at /root/arisu/src/commands/Community/testeadd.js:47:32
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:42:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,12 @@
TypeError: Found non-callable @@iterator
TypeError: Found non-callable @@iterator
at /root/arisu/src/commands/Community/testeadd.js:47:18
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:42:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)

View File

@ -0,0 +1,12 @@
TypeError: Found non-callable @@iterator
TypeError: Found non-callable @@iterator
at /root/arisu/src/commands/Community/testeadd.js:47:18
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:42:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)

View File

@ -0,0 +1,12 @@
TypeError: Found non-callable @@iterator
TypeError: Found non-callable @@iterator
at /root/arisu/src/commands/Community/testeadd.js:48:18
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:43:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)

View File

@ -0,0 +1,12 @@
TypeError: Found non-callable @@iterator
TypeError: Found non-callable @@iterator
at /root/arisu/src/commands/Community/testeadd.js:48:18
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:43:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)

View File

@ -0,0 +1,12 @@
ReferenceError: choices is not defined
ReferenceError: choices is not defined
at getChoicesFromDatabase (/root/arisu/src/commands/Community/testeadd.js:34:5)
at /root/arisu/src/commands/Community/testeadd.js:47:32
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:42:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,12 @@
ReferenceError: choices is not defined
ReferenceError: choices is not defined
at getChoicesFromDatabase (/root/arisu/src/commands/Community/testeadd.js:34:5)
at /root/arisu/src/commands/Community/testeadd.js:47:32
at MixedClass._sharedAddOptionMethod (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2439:50)
at MixedClass.addStringOption (/root/arisu/node_modules/@discordjs/builders/dist/index.js:2411:17)
at Object.<anonymous> (/root/arisu/src/commands/Community/testeadd.js:42:10)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,16 @@
SyntaxError: Unexpected identifier
/root/arisu/src/commands/Community/testeadd.js:27
O que muda
^^^
SyntaxError: Unexpected identifier
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1274:20)
at Module._compile (node:internal/modules/cjs/loader:1320:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at loadCommand (/root/arisu/src/functions/handlers/handleCommands.js:77:25)
at FSWatcher.<anonymous> (/root/arisu/src/functions/handlers/handleCommands.js:263:13)

View File

@ -0,0 +1,16 @@
SyntaxError: Unexpected identifier
/root/arisu/src/commands/Community/testeadd.js:27
O que muda
^^^
SyntaxError: Unexpected identifier
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1274:20)
at Module._compile (node:internal/modules/cjs/loader:1320:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at loadCommand (/root/arisu/src/functions/handlers/handleCommands.js:77:25)
at loadCommands (/root/arisu/src/functions/handlers/handleCommands.js:102:25)

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

View File

@ -0,0 +1,2 @@
undefined: undefined
undefined

33
node_modules/.bin/mkdirp generated vendored Normal file
View File

@ -0,0 +1,33 @@
#!/usr/bin/env node
var mkdirp = require('../');
var minimist = require('minimist');
var fs = require('fs');
var argv = minimist(process.argv.slice(2), {
alias: { m: 'mode', h: 'help' },
string: [ 'mode' ]
});
if (argv.help) {
fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout);
return;
}
var paths = argv._.slice();
var mode = argv.mode ? parseInt(argv.mode, 8) : undefined;
(function next () {
if (paths.length === 0) return;
var p = paths.shift();
if (mode === undefined) mkdirp(p, cb)
else mkdirp(p, mode, cb)
function cb (err) {
if (err) {
console.error(err.message);
process.exit(1);
}
else next();
}
})();

2
node_modules/.bin/tsc generated vendored Normal file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env node
require('../lib/tsc.js')

2
node_modules/.bin/tsserver generated vendored Normal file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env node
require('../lib/tsserver.js')

1564
node_modules/.package-lock.json generated vendored Normal file

File diff suppressed because it is too large Load Diff

249
node_modules/@clack/core/CHANGELOG.md generated vendored Normal file
View File

@ -0,0 +1,249 @@
# @clack/core
## 0.4.1
### Patch Changes
- 8093f3c: Adds `Error` support to the `validate` function
- e5ba09a: Fixes a cursor display bug in terminals that do not support the "hidden" escape sequence. See [Issue #127](https://github.com/bombshell-dev/clack/issues/127).
- 8cba8e3: Fixes a rendering bug with cursor positions for `TextPrompt`
## 0.4.0
### Minor Changes
- a83d2f8: Adds a new `updateSettings()` function to support new global keybindings.
`updateSettings()` accepts an `aliases` object that maps custom keys to an action (`up | down | left | right | space | enter | cancel`).
```ts
import { updateSettings } from "@clack/core";
// Support custom keybindings
updateSettings({
aliases: {
w: "up",
a: "left",
s: "down",
d: "right",
},
});
```
> [!WARNING]
> In order to enforce consistent, user-friendly defaults across the ecosystem, `updateSettings` does not support disabling Clack's default keybindings.
- 801246b: Adds a new `signal` option to support programmatic prompt cancellation with an [abort controller](https://kettanaito.com/blog/dont-sleep-on-abort-controller).
- a83d2f8: Updates default keybindings to support Vim motion shortcuts and map the `escape` key to cancel (`ctrl+c`).
| alias | action |
| ----- | ------ |
| `k` | up |
| `l` | right |
| `j` | down |
| `h` | left |
| `esc` | cancel |
### Patch Changes
- 51e12bc: Improves types for events and interaction states.
## 0.3.5
### Patch Changes
- 4845f4f: Fixes a bug which kept the terminal cursor hidden after a prompt is cancelled
- d7b2fb9: Adds missing `LICENSE` file. Since the `package.json` file has always included `"license": "MIT"`, please consider this a licensing clarification rather than a licensing change.
## 0.3.4
### Patch Changes
- a04e418: fix(@clack/core): keyboard input not working after await in spinner
- 4f6fcf5: feat(@clack/core): allow tab completion for placeholders
## 0.3.3
### Patch Changes
- cd79076: fix: restore raw mode on unblock
## 0.3.2
### Patch Changes
- c96eda5: Enable hard line-wrapping behavior for long words without spaces
## 0.3.1
### Patch Changes
- 58a1df1: Fix line duplication bug by automatically wrapping prompts to `process.stdout.columns`
## 0.3.0
### Minor Changes
- 8a4a12f: Add `GroupMultiSelect` prompt
### Patch Changes
- 8a4a12f: add `groupMultiselect` prompt
## 0.2.1
### Patch Changes
- ec812b6: fix `readline` hang on Windows
## 0.2.0
### Minor Changes
- d74dd05: Adds a `selectKey` prompt type
- 54c1bc3: **Breaking Change** `multiselect` has renamed `initialValue` to `initialValues`
## 0.1.9
### Patch Changes
- 1251132: Multiselect: return `Value[]` instead of `Option[]`.
- 8994382: Add a password prompt to `@clack/prompts`
## 0.1.8
### Patch Changes
- d96071c: Don't mutate `initialValue` in `multiselect`, fix parameter type for `validate()`.
Credits to @banjo for the bug report and initial PR!
## 0.1.7
### Patch Changes
- 6d9e675: Add support for neovim cursor motion (`hjkl`)
Thanks [@esau-morais](https://github.com/esau-morais) for the assist!
## 0.1.6
### Patch Changes
- 7fb5375: Adds a new `defaultValue` option to the text prompt, removes automatic usage of the placeholder value.
## 0.1.5
### Patch Changes
- de1314e: Support `required` option for multi-select
## 0.1.4
### Patch Changes
- ca77da1: Fix multiselect initial value logic
- 8aed606: Fix `MaxListenersExceededWarning` by detaching `stdin` listeners on close
## 0.1.3
### Patch Changes
- a99c458: Support `initialValue` option for text prompt
## 0.1.2
### Patch Changes
- Allow isCancel to type guard any unknown value
- 7dcad8f: Allow placeholder to be passed to TextPrompt
- 2242f13: Fix multiselect returning undefined
- b1341d6: Improved placeholder handling
## 0.1.1
### Patch Changes
- 4be7dbf: Ensure raw mode is unset on submit
- b480679: Preserve value if validation fails
## 0.1.0
### Minor Changes
- 7015ec9: Create new prompt: multi-select
## 0.0.12
### Patch Changes
- 9d371c3: Fix rendering bug when using y/n to confirm
## 0.0.11
### Patch Changes
- 441d5b7: fix select return undefined
- d20ef2a: Update keywords, URLs
- fe13c2f: fix cursor missing after submit
## 0.0.10
### Patch Changes
- a0cb382: Add `main` entrypoint
## 0.0.9
### Patch Changes
- Fix node@16 issue (cannot read "createInterface" of undefined)
## 0.0.8
### Patch Changes
- a4b5e13: Bug fixes, exposes `block` utility
## 0.0.7
### Patch Changes
- Fix cursor bug
## 0.0.6
### Patch Changes
- Fix error with character check
## 0.0.5
### Patch Changes
- 491f9e0: update readme
## 0.0.4
### Patch Changes
- 7372d5c: Fix bug with line deletion
## 0.0.3
### Patch Changes
- 5605d28: Do not bundle dependencies (take II)
## 0.0.2
### Patch Changes
- 2ee67cb: don't bundle deps
## 0.0.1
### Patch Changes
- 306598e: Initial publish, still WIP

9
node_modules/@clack/core/LICENSE generated vendored Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) Nate Moore
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

22
node_modules/@clack/core/README.md generated vendored Normal file
View File

@ -0,0 +1,22 @@
# `@clack/core`
Clack contains low-level primitives for implementing your own command-line applications.
Currently, `TextPrompt`, `SelectPrompt`, and `ConfirmPrompt` are exposed as well as the base `Prompt` class.
Each `Prompt` accepts a `render` function.
```js
import { TextPrompt, isCancel } from '@clack/core';
const p = new TextPrompt({
render() {
return `What's your name?\n${this.valueWithCursor}`;
},
});
const name = await p.prompt();
if (isCancel(name)) {
process.exit(0);
}
```

15
node_modules/@clack/core/dist/index.cjs generated vendored Normal file

File diff suppressed because one or more lines are too long

1
node_modules/@clack/core/dist/index.cjs.map generated vendored Normal file

File diff suppressed because one or more lines are too long

209
node_modules/@clack/core/dist/index.d.cts generated vendored Normal file
View File

@ -0,0 +1,209 @@
import { Readable, Writable } from 'node:stream';
declare const actions: readonly ["up", "down", "left", "right", "space", "enter", "cancel"];
type Action = (typeof actions)[number];
interface ClackSettings {
/**
* Set custom global aliases for the default actions.
* This will not overwrite existing aliases, it will only add new ones!
*
* @param aliases - An object that maps aliases to actions
* @default { k: 'up', j: 'down', h: 'left', l: 'right', '\x03': 'cancel', 'escape': 'cancel' }
*/
aliases: Record<string, Action>;
}
declare function updateSettings(updates: ClackSettings): void;
/**
* The state of the prompt
*/
type ClackState = 'initial' | 'active' | 'cancel' | 'submit' | 'error';
/**
* Typed event emitter for clack
*/
interface ClackEvents {
initial: (value?: any) => void;
active: (value?: any) => void;
cancel: (value?: any) => void;
submit: (value?: any) => void;
error: (value?: any) => void;
cursor: (key?: Action) => void;
key: (key?: string) => void;
value: (value?: string) => void;
confirm: (value?: boolean) => void;
finalize: () => void;
}
interface PromptOptions<Self extends Prompt> {
render(this: Omit<Self, 'prompt'>): string | undefined;
placeholder?: string;
initialValue?: any;
validate?: ((value: any) => string | Error | undefined) | undefined;
input?: Readable;
output?: Writable;
debug?: boolean;
signal?: AbortSignal;
}
declare class Prompt {
protected input: Readable;
protected output: Writable;
private _abortSignal?;
private rl;
private opts;
private _render;
private _track;
private _prevFrame;
private _subscribers;
protected _cursor: number;
state: ClackState;
error: string;
value: any;
constructor(options: PromptOptions<Prompt>, trackValue?: boolean);
/**
* Unsubscribe all listeners
*/
protected unsubscribe(): void;
/**
* Set a subscriber with opts
* @param event - The event name
*/
private setSubscriber;
/**
* Subscribe to an event
* @param event - The event name
* @param cb - The callback
*/
on<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]): void;
/**
* Subscribe to an event once
* @param event - The event name
* @param cb - The callback
*/
once<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]): void;
/**
* Emit an event with data
* @param event - The event name
* @param data - The data to pass to the callback
*/
emit<T extends keyof ClackEvents>(event: T, ...data: Parameters<ClackEvents[T]>): void;
prompt(): Promise<string | symbol>;
private onKeypress;
protected close(): void;
private restoreCursor;
private render;
}
interface ConfirmOptions extends PromptOptions<ConfirmPrompt> {
active: string;
inactive: string;
initialValue?: boolean;
}
declare class ConfirmPrompt extends Prompt {
get cursor(): 0 | 1;
private get _value();
constructor(opts: ConfirmOptions);
}
interface GroupMultiSelectOptions<T extends {
value: any;
}> extends PromptOptions<GroupMultiSelectPrompt<T>> {
options: Record<string, T[]>;
initialValues?: T['value'][];
required?: boolean;
cursorAt?: T['value'];
}
declare class GroupMultiSelectPrompt<T extends {
value: any;
}> extends Prompt {
options: (T & {
group: string | boolean;
})[];
cursor: number;
getGroupItems(group: string): T[];
isGroupSelected(group: string): boolean;
private toggleValue;
constructor(opts: GroupMultiSelectOptions<T>);
}
interface MultiSelectOptions<T extends {
value: any;
}> extends PromptOptions<MultiSelectPrompt<T>> {
options: T[];
initialValues?: T['value'][];
required?: boolean;
cursorAt?: T['value'];
}
declare class MultiSelectPrompt<T extends {
value: any;
}> extends Prompt {
options: T[];
cursor: number;
private get _value();
private toggleAll;
private toggleValue;
constructor(opts: MultiSelectOptions<T>);
}
interface PasswordOptions extends PromptOptions<PasswordPrompt> {
mask?: string;
}
declare class PasswordPrompt extends Prompt {
valueWithCursor: string;
private _mask;
get cursor(): number;
get masked(): any;
constructor({ mask, ...opts }: PasswordOptions);
}
interface SelectOptions<T extends {
value: any;
}> extends PromptOptions<SelectPrompt<T>> {
options: T[];
initialValue?: T['value'];
}
declare class SelectPrompt<T extends {
value: any;
}> extends Prompt {
options: T[];
cursor: number;
private get _value();
private changeValue;
constructor(opts: SelectOptions<T>);
}
interface SelectKeyOptions<T extends {
value: any;
}> extends PromptOptions<SelectKeyPrompt<T>> {
options: T[];
}
declare class SelectKeyPrompt<T extends {
value: any;
}> extends Prompt {
options: T[];
cursor: number;
constructor(opts: SelectKeyOptions<T>);
}
interface TextOptions extends PromptOptions<TextPrompt> {
placeholder?: string;
defaultValue?: string;
}
declare class TextPrompt extends Prompt {
get valueWithCursor(): any;
get cursor(): number;
constructor(opts: TextOptions);
}
declare function isCancel(value: unknown): value is symbol;
declare function block({ input, output, overwrite, hideCursor, }?: {
input?: (NodeJS.ReadStream & {
fd: 0;
}) | undefined;
output?: (NodeJS.WriteStream & {
fd: 1;
}) | undefined;
overwrite?: boolean | undefined;
hideCursor?: boolean | undefined;
}): () => void;
export { type ClackSettings, ConfirmPrompt, GroupMultiSelectPrompt, MultiSelectPrompt, PasswordPrompt, Prompt, SelectKeyPrompt, SelectPrompt, type ClackState as State, TextPrompt, block, isCancel, updateSettings };

209
node_modules/@clack/core/dist/index.d.mts generated vendored Normal file
View File

@ -0,0 +1,209 @@
import { Readable, Writable } from 'node:stream';
declare const actions: readonly ["up", "down", "left", "right", "space", "enter", "cancel"];
type Action = (typeof actions)[number];
interface ClackSettings {
/**
* Set custom global aliases for the default actions.
* This will not overwrite existing aliases, it will only add new ones!
*
* @param aliases - An object that maps aliases to actions
* @default { k: 'up', j: 'down', h: 'left', l: 'right', '\x03': 'cancel', 'escape': 'cancel' }
*/
aliases: Record<string, Action>;
}
declare function updateSettings(updates: ClackSettings): void;
/**
* The state of the prompt
*/
type ClackState = 'initial' | 'active' | 'cancel' | 'submit' | 'error';
/**
* Typed event emitter for clack
*/
interface ClackEvents {
initial: (value?: any) => void;
active: (value?: any) => void;
cancel: (value?: any) => void;
submit: (value?: any) => void;
error: (value?: any) => void;
cursor: (key?: Action) => void;
key: (key?: string) => void;
value: (value?: string) => void;
confirm: (value?: boolean) => void;
finalize: () => void;
}
interface PromptOptions<Self extends Prompt> {
render(this: Omit<Self, 'prompt'>): string | undefined;
placeholder?: string;
initialValue?: any;
validate?: ((value: any) => string | Error | undefined) | undefined;
input?: Readable;
output?: Writable;
debug?: boolean;
signal?: AbortSignal;
}
declare class Prompt {
protected input: Readable;
protected output: Writable;
private _abortSignal?;
private rl;
private opts;
private _render;
private _track;
private _prevFrame;
private _subscribers;
protected _cursor: number;
state: ClackState;
error: string;
value: any;
constructor(options: PromptOptions<Prompt>, trackValue?: boolean);
/**
* Unsubscribe all listeners
*/
protected unsubscribe(): void;
/**
* Set a subscriber with opts
* @param event - The event name
*/
private setSubscriber;
/**
* Subscribe to an event
* @param event - The event name
* @param cb - The callback
*/
on<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]): void;
/**
* Subscribe to an event once
* @param event - The event name
* @param cb - The callback
*/
once<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]): void;
/**
* Emit an event with data
* @param event - The event name
* @param data - The data to pass to the callback
*/
emit<T extends keyof ClackEvents>(event: T, ...data: Parameters<ClackEvents[T]>): void;
prompt(): Promise<string | symbol>;
private onKeypress;
protected close(): void;
private restoreCursor;
private render;
}
interface ConfirmOptions extends PromptOptions<ConfirmPrompt> {
active: string;
inactive: string;
initialValue?: boolean;
}
declare class ConfirmPrompt extends Prompt {
get cursor(): 0 | 1;
private get _value();
constructor(opts: ConfirmOptions);
}
interface GroupMultiSelectOptions<T extends {
value: any;
}> extends PromptOptions<GroupMultiSelectPrompt<T>> {
options: Record<string, T[]>;
initialValues?: T['value'][];
required?: boolean;
cursorAt?: T['value'];
}
declare class GroupMultiSelectPrompt<T extends {
value: any;
}> extends Prompt {
options: (T & {
group: string | boolean;
})[];
cursor: number;
getGroupItems(group: string): T[];
isGroupSelected(group: string): boolean;
private toggleValue;
constructor(opts: GroupMultiSelectOptions<T>);
}
interface MultiSelectOptions<T extends {
value: any;
}> extends PromptOptions<MultiSelectPrompt<T>> {
options: T[];
initialValues?: T['value'][];
required?: boolean;
cursorAt?: T['value'];
}
declare class MultiSelectPrompt<T extends {
value: any;
}> extends Prompt {
options: T[];
cursor: number;
private get _value();
private toggleAll;
private toggleValue;
constructor(opts: MultiSelectOptions<T>);
}
interface PasswordOptions extends PromptOptions<PasswordPrompt> {
mask?: string;
}
declare class PasswordPrompt extends Prompt {
valueWithCursor: string;
private _mask;
get cursor(): number;
get masked(): any;
constructor({ mask, ...opts }: PasswordOptions);
}
interface SelectOptions<T extends {
value: any;
}> extends PromptOptions<SelectPrompt<T>> {
options: T[];
initialValue?: T['value'];
}
declare class SelectPrompt<T extends {
value: any;
}> extends Prompt {
options: T[];
cursor: number;
private get _value();
private changeValue;
constructor(opts: SelectOptions<T>);
}
interface SelectKeyOptions<T extends {
value: any;
}> extends PromptOptions<SelectKeyPrompt<T>> {
options: T[];
}
declare class SelectKeyPrompt<T extends {
value: any;
}> extends Prompt {
options: T[];
cursor: number;
constructor(opts: SelectKeyOptions<T>);
}
interface TextOptions extends PromptOptions<TextPrompt> {
placeholder?: string;
defaultValue?: string;
}
declare class TextPrompt extends Prompt {
get valueWithCursor(): any;
get cursor(): number;
constructor(opts: TextOptions);
}
declare function isCancel(value: unknown): value is symbol;
declare function block({ input, output, overwrite, hideCursor, }?: {
input?: (NodeJS.ReadStream & {
fd: 0;
}) | undefined;
output?: (NodeJS.WriteStream & {
fd: 1;
}) | undefined;
overwrite?: boolean | undefined;
hideCursor?: boolean | undefined;
}): () => void;
export { type ClackSettings, ConfirmPrompt, GroupMultiSelectPrompt, MultiSelectPrompt, PasswordPrompt, Prompt, SelectKeyPrompt, SelectPrompt, type ClackState as State, TextPrompt, block, isCancel, updateSettings };

209
node_modules/@clack/core/dist/index.d.ts generated vendored Normal file
View File

@ -0,0 +1,209 @@
import { Readable, Writable } from 'node:stream';
declare const actions: readonly ["up", "down", "left", "right", "space", "enter", "cancel"];
type Action = (typeof actions)[number];
interface ClackSettings {
/**
* Set custom global aliases for the default actions.
* This will not overwrite existing aliases, it will only add new ones!
*
* @param aliases - An object that maps aliases to actions
* @default { k: 'up', j: 'down', h: 'left', l: 'right', '\x03': 'cancel', 'escape': 'cancel' }
*/
aliases: Record<string, Action>;
}
declare function updateSettings(updates: ClackSettings): void;
/**
* The state of the prompt
*/
type ClackState = 'initial' | 'active' | 'cancel' | 'submit' | 'error';
/**
* Typed event emitter for clack
*/
interface ClackEvents {
initial: (value?: any) => void;
active: (value?: any) => void;
cancel: (value?: any) => void;
submit: (value?: any) => void;
error: (value?: any) => void;
cursor: (key?: Action) => void;
key: (key?: string) => void;
value: (value?: string) => void;
confirm: (value?: boolean) => void;
finalize: () => void;
}
interface PromptOptions<Self extends Prompt> {
render(this: Omit<Self, 'prompt'>): string | undefined;
placeholder?: string;
initialValue?: any;
validate?: ((value: any) => string | Error | undefined) | undefined;
input?: Readable;
output?: Writable;
debug?: boolean;
signal?: AbortSignal;
}
declare class Prompt {
protected input: Readable;
protected output: Writable;
private _abortSignal?;
private rl;
private opts;
private _render;
private _track;
private _prevFrame;
private _subscribers;
protected _cursor: number;
state: ClackState;
error: string;
value: any;
constructor(options: PromptOptions<Prompt>, trackValue?: boolean);
/**
* Unsubscribe all listeners
*/
protected unsubscribe(): void;
/**
* Set a subscriber with opts
* @param event - The event name
*/
private setSubscriber;
/**
* Subscribe to an event
* @param event - The event name
* @param cb - The callback
*/
on<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]): void;
/**
* Subscribe to an event once
* @param event - The event name
* @param cb - The callback
*/
once<T extends keyof ClackEvents>(event: T, cb: ClackEvents[T]): void;
/**
* Emit an event with data
* @param event - The event name
* @param data - The data to pass to the callback
*/
emit<T extends keyof ClackEvents>(event: T, ...data: Parameters<ClackEvents[T]>): void;
prompt(): Promise<string | symbol>;
private onKeypress;
protected close(): void;
private restoreCursor;
private render;
}
interface ConfirmOptions extends PromptOptions<ConfirmPrompt> {
active: string;
inactive: string;
initialValue?: boolean;
}
declare class ConfirmPrompt extends Prompt {
get cursor(): 0 | 1;
private get _value();
constructor(opts: ConfirmOptions);
}
interface GroupMultiSelectOptions<T extends {
value: any;
}> extends PromptOptions<GroupMultiSelectPrompt<T>> {
options: Record<string, T[]>;
initialValues?: T['value'][];
required?: boolean;
cursorAt?: T['value'];
}
declare class GroupMultiSelectPrompt<T extends {
value: any;
}> extends Prompt {
options: (T & {
group: string | boolean;
})[];
cursor: number;
getGroupItems(group: string): T[];
isGroupSelected(group: string): boolean;
private toggleValue;
constructor(opts: GroupMultiSelectOptions<T>);
}
interface MultiSelectOptions<T extends {
value: any;
}> extends PromptOptions<MultiSelectPrompt<T>> {
options: T[];
initialValues?: T['value'][];
required?: boolean;
cursorAt?: T['value'];
}
declare class MultiSelectPrompt<T extends {
value: any;
}> extends Prompt {
options: T[];
cursor: number;
private get _value();
private toggleAll;
private toggleValue;
constructor(opts: MultiSelectOptions<T>);
}
interface PasswordOptions extends PromptOptions<PasswordPrompt> {
mask?: string;
}
declare class PasswordPrompt extends Prompt {
valueWithCursor: string;
private _mask;
get cursor(): number;
get masked(): any;
constructor({ mask, ...opts }: PasswordOptions);
}
interface SelectOptions<T extends {
value: any;
}> extends PromptOptions<SelectPrompt<T>> {
options: T[];
initialValue?: T['value'];
}
declare class SelectPrompt<T extends {
value: any;
}> extends Prompt {
options: T[];
cursor: number;
private get _value();
private changeValue;
constructor(opts: SelectOptions<T>);
}
interface SelectKeyOptions<T extends {
value: any;
}> extends PromptOptions<SelectKeyPrompt<T>> {
options: T[];
}
declare class SelectKeyPrompt<T extends {
value: any;
}> extends Prompt {
options: T[];
cursor: number;
constructor(opts: SelectKeyOptions<T>);
}
interface TextOptions extends PromptOptions<TextPrompt> {
placeholder?: string;
defaultValue?: string;
}
declare class TextPrompt extends Prompt {
get valueWithCursor(): any;
get cursor(): number;
constructor(opts: TextOptions);
}
declare function isCancel(value: unknown): value is symbol;
declare function block({ input, output, overwrite, hideCursor, }?: {
input?: (NodeJS.ReadStream & {
fd: 0;
}) | undefined;
output?: (NodeJS.WriteStream & {
fd: 1;
}) | undefined;
overwrite?: boolean | undefined;
hideCursor?: boolean | undefined;
}): () => void;
export { type ClackSettings, ConfirmPrompt, GroupMultiSelectPrompt, MultiSelectPrompt, PasswordPrompt, Prompt, SelectKeyPrompt, SelectPrompt, type ClackState as State, TextPrompt, block, isCancel, updateSettings };

Some files were not shown because too many files have changed in this diff Show More