feat(economy): update content creation documentation and improve editor validation

This commit is contained in:
2025-10-05 03:36:11 -05:00
parent 71d9f09102
commit 7967231865
7 changed files with 543 additions and 144 deletions

View File

@@ -37,7 +37,7 @@ const btns = (disabled = false) => ([
const isValidUrl = isValidUrlOrVariable;
const validateContent = (content: string | undefined | null): string => {
if (!content || typeof content !== 'string') return "Sin contenido";
if (!content) return "Sin contenido";
const cleaned = content.trim();
if (!cleaned) return "Sin contenido";
if (cleaned.length > 4000) return cleaned.slice(0, 3997) + "...";

View File

@@ -30,7 +30,7 @@ export const command: CommandMessage = {
const guildId = message.guild!.id;
const state: OfferState = { enabled: true, price: {}, perUserLimit: null, stock: null, metadata: {} };
const editorMsg = await message.channel.send({
const editorMsg = await (message.channel as any).send({
content: `🛒 Editor de Oferta (crear)`,
components: [
{ type: 1, components: [

View File

@@ -456,6 +456,7 @@ async function processConfigVariables(config: any, user: any, guild: any, userSt
if (Array.isArray(config)) {
const processedArray = [];
for (const item of config) {
// @ts-ignore
processedArray.push(await processConfigVariables(item, user, guild, userStats, inviteObject));
}
return processedArray;

View File

@@ -28,10 +28,7 @@ bot.on(Events.ClientReady, () => {
process.on('unhandledRejection', (reason: unknown) => {
// Interceptar rechazos relacionados con el mismo bug
if (reason &&
typeof reason === 'object' &&
reason !== null &&
'message' in reason &&
typeof (reason as any).message === 'string' &&
typeof reason === 'object' && 'message' in reason && typeof (reason as any).message === 'string' &&
(reason as any).message.includes("Cannot read properties of undefined (reading 'id')")) {
logger.warn('🔧 Discord.js promise rejection interceptada: GuildMemberManager error');