Add comprehensive documentation and improvement suggestions for Amayo bot
- Created README.md for static site documentation, detailing features, structure, local usage, and Heroku deployment. - Added RESUMEN_CAMBIOS.md summarizing critical bug fixes, command updates, and documentation enhancements. - Introduced SUGERENCIAS_Y_MEJORAS.md with a thorough analysis of the project, new feature suggestions, and technical improvements.
This commit is contained in:
@@ -1,42 +1,48 @@
|
||||
import type { CommandMessage } from '../../../core/types/commands';
|
||||
import type Amayo from '../../../core/client';
|
||||
import { getStreakInfo, updateStreak } from '../../../game/streaks/service';
|
||||
import type { TextBasedChannel } from 'discord.js';
|
||||
import { fetchItemBasics, formatItemLabel } from './_helpers';
|
||||
import type { CommandMessage } from "../../../core/types/commands";
|
||||
import type Amayo from "../../../core/client";
|
||||
import { getStreakInfo, updateStreak } from "../../../game/streaks/service";
|
||||
import type { TextBasedChannel } from "discord.js";
|
||||
import { fetchItemBasics, formatItemLabel, sendDisplayReply } from "./_helpers";
|
||||
|
||||
export const command: CommandMessage = {
|
||||
name: 'racha',
|
||||
type: 'message',
|
||||
aliases: ['streak', 'daily'],
|
||||
name: "racha",
|
||||
type: "message",
|
||||
aliases: ["streak", "daily"],
|
||||
cooldown: 10,
|
||||
description: 'Ver tu racha diaria y reclamar recompensa',
|
||||
usage: 'racha',
|
||||
description: "Ver tu racha diaria y reclamar recompensa",
|
||||
usage: "racha",
|
||||
run: async (message, args, client: Amayo) => {
|
||||
try {
|
||||
const userId = message.author.id;
|
||||
const guildId = message.guild!.id;
|
||||
|
||||
// Actualizar racha
|
||||
const { streak, newDay, rewards, daysIncreased } = await updateStreak(userId, guildId);
|
||||
const { streak, newDay, rewards, daysIncreased } = await updateStreak(
|
||||
userId,
|
||||
guildId
|
||||
);
|
||||
|
||||
// Construir componentes
|
||||
const components: any[] = [
|
||||
{
|
||||
type: 10,
|
||||
content: `# 🔥 Racha Diaria de ${message.author.username}`
|
||||
content: `# 🔥 Racha Diaria de ${message.author.username}`,
|
||||
},
|
||||
{ type: 14, divider: true },
|
||||
{
|
||||
type: 9,
|
||||
components: [{
|
||||
type: 10,
|
||||
content: `**📊 ESTADÍSTICAS**\n` +
|
||||
`🔥 Racha Actual: **${streak.currentStreak}** días\n` +
|
||||
`⭐ Mejor Racha: **${streak.longestStreak}** días\n` +
|
||||
`📅 Días Activos: **${streak.totalDaysActive}** días`
|
||||
}]
|
||||
components: [
|
||||
{
|
||||
type: 10,
|
||||
content:
|
||||
`**📊 ESTADÍSTICAS**\n` +
|
||||
`🔥 Racha Actual: **${streak.currentStreak}** días\n` +
|
||||
`⭐ Mejor Racha: **${streak.longestStreak}** días\n` +
|
||||
`📅 Días Activos: **${streak.totalDaysActive}** días`,
|
||||
},
|
||||
],
|
||||
},
|
||||
{ type: 14, spacing: 1 }
|
||||
{ type: 14, spacing: 1 },
|
||||
];
|
||||
|
||||
// Mensaje de estado
|
||||
@@ -44,29 +50,41 @@ export const command: CommandMessage = {
|
||||
if (daysIncreased) {
|
||||
components.push({
|
||||
type: 9,
|
||||
components: [{
|
||||
type: 10,
|
||||
content: `**✅ ¡RACHA INCREMENTADA!**\nHas mantenido tu racha por **${streak.currentStreak}** días seguidos.`
|
||||
}]
|
||||
components: [
|
||||
{
|
||||
type: 10,
|
||||
content: `**✅ ¡RACHA INCREMENTADA!**\nHas mantenido tu racha por **${streak.currentStreak}** días seguidos.`,
|
||||
},
|
||||
],
|
||||
});
|
||||
} else {
|
||||
components.push({
|
||||
type: 9,
|
||||
components: [{
|
||||
type: 10,
|
||||
content: `**⚠️ RACHA REINICIADA**\nPasó más de un día sin actividad. Tu racha se ha reiniciado.`
|
||||
}]
|
||||
components: [
|
||||
{
|
||||
type: 10,
|
||||
content: `**⚠️ RACHA REINICIADA**\nPasó más de un día sin actividad. Tu racha se ha reiniciado.`,
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
// Mostrar recompensas
|
||||
if (rewards) {
|
||||
let rewardsText = '**🎁 RECOMPENSA DEL DÍA**\n';
|
||||
if (rewards.coins) rewardsText += `💰 **${rewards.coins.toLocaleString()}** monedas\n`;
|
||||
let rewardsText = "**🎁 RECOMPENSA DEL DÍA**\n";
|
||||
if (rewards.coins)
|
||||
rewardsText += `💰 **${rewards.coins.toLocaleString()}** monedas\n`;
|
||||
if (rewards.items && rewards.items.length) {
|
||||
const basics = await fetchItemBasics(guildId, rewards.items.map((item) => item.key));
|
||||
rewards.items.forEach(item => {
|
||||
const info = basics.get(item.key) ?? { key: item.key, name: null, icon: null };
|
||||
const basics = await fetchItemBasics(
|
||||
guildId,
|
||||
rewards.items.map((item) => item.key)
|
||||
);
|
||||
rewards.items.forEach((item) => {
|
||||
const info = basics.get(item.key) ?? {
|
||||
key: item.key,
|
||||
name: null,
|
||||
icon: null,
|
||||
};
|
||||
const label = formatItemLabel(info, { bold: true });
|
||||
rewardsText += `${label} ×${item.quantity}\n`;
|
||||
});
|
||||
@@ -75,53 +93,54 @@ export const command: CommandMessage = {
|
||||
components.push({ type: 14, spacing: 1 });
|
||||
components.push({
|
||||
type: 9,
|
||||
components: [{
|
||||
type: 10,
|
||||
content: rewardsText
|
||||
}]
|
||||
components: [
|
||||
{
|
||||
type: 10,
|
||||
content: rewardsText,
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
} else {
|
||||
components.push({
|
||||
type: 9,
|
||||
components: [{
|
||||
type: 10,
|
||||
content: `**ℹ️ YA RECLAMASTE HOY**\nYa has reclamado tu recompensa diaria. Vuelve mañana para continuar tu racha.`
|
||||
}]
|
||||
components: [
|
||||
{
|
||||
type: 10,
|
||||
content: `**ℹ️ YA RECLAMASTE HOY**\nYa has reclamado tu recompensa diaria. Vuelve mañana para continuar tu racha.`,
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
// Próximos hitos
|
||||
const milestones = [3, 7, 14, 30, 60, 90, 180, 365];
|
||||
const nextMilestone = milestones.find(m => m > streak.currentStreak);
|
||||
const nextMilestone = milestones.find((m) => m > streak.currentStreak);
|
||||
|
||||
if (nextMilestone) {
|
||||
const remaining = nextMilestone - streak.currentStreak;
|
||||
components.push({ type: 14, spacing: 1 });
|
||||
components.push({
|
||||
type: 9,
|
||||
components: [{
|
||||
type: 10,
|
||||
content: `**🎯 PRÓXIMO HITO**\nFaltan **${remaining}** días para alcanzar el día **${nextMilestone}**`
|
||||
}]
|
||||
components: [
|
||||
{
|
||||
type: 10,
|
||||
content: `**🎯 PRÓXIMO HITO**\nFaltan **${remaining}** días para alcanzar el día **${nextMilestone}**`,
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
const display = {
|
||||
type: 17,
|
||||
accent_color: daysIncreased ? 0x00FF00 : 0xFFA500,
|
||||
components
|
||||
accent_color: daysIncreased ? 0x00ff00 : 0xffa500,
|
||||
components,
|
||||
};
|
||||
|
||||
const channel = message.channel as TextBasedChannel & { send: Function };
|
||||
await (channel.send as any)({
|
||||
display,
|
||||
flags: 32768,
|
||||
reply: { messageReference: message.id }
|
||||
});
|
||||
await sendDisplayReply(message, display);
|
||||
} catch (error) {
|
||||
console.error('Error en comando racha:', error);
|
||||
await message.reply('❌ Error al obtener tu racha diaria.');
|
||||
console.error("Error en comando racha:", error);
|
||||
await message.reply("❌ Error al obtener tu racha diaria.");
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<title>Amayo Bot | Guía Completa para Usuarios de Discord</title>
|
||||
<meta name="description" content="Guía completa de Amayo Bot: comandos, minijuegos, economía, misiones, logros, creación de contenido y más">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script>
|
||||
<script>
|
||||
tailwind.config = {
|
||||
theme: {
|
||||
extend: {
|
||||
@@ -14,6 +14,7 @@
|
||||
'gradient': 'gradient 8s linear infinite',
|
||||
'float': 'float 6s ease-in-out infinite',
|
||||
'glow': 'glow 3s ease-in-out infinite',
|
||||
'slide-in': 'slideIn 0.5s ease-out',
|
||||
},
|
||||
keyframes: {
|
||||
gradient: {
|
||||
@@ -28,6 +29,10 @@
|
||||
'0%, 100%': { opacity: '0.4' },
|
||||
'50%': { opacity: '0.8' },
|
||||
},
|
||||
slideIn: {
|
||||
'0%': { transform: 'translateY(20px)', opacity: '0' },
|
||||
'100%': { transform: 'translateY(0)', opacity: '1' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -44,6 +49,7 @@
|
||||
<div class="absolute bottom-0 left-1/3 w-96 h-96 bg-pink-500/15 rounded-full mix-blend-screen filter blur-3xl animate-float" style="animation-delay: 4s;"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="relative z-10">
|
||||
<!-- Hero Ultra Moderno -->
|
||||
<header class="relative overflow-hidden ">
|
||||
|
||||
Reference in New Issue
Block a user