Introduces a new server mode configuration system (Federation/Standalone) with associated command changes, dynamic status rotation for the bot, and adds new commands and features. Replit-Commit-Author: Agent Replit-Commit-Session-Id: aed2e46d-25bb-4b73-81a1-bb9e8437c261 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: b08e6ba5-7498-4b9f-b1c9-7dc11b362ddd Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3bdfff67-975a-46ad-9845-fbb6b4a4c4b5/aed2e46d-25bb-4b73-81a1-bb9e8437c261/R9PkDi8 Replit-Helium-Checkpoint-Created: true
61 lines
2.2 KiB
JavaScript
61 lines
2.2 KiB
JavaScript
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
|
|
const { getServerMode, getEmbedColor } = require('../utils/modeHelper');
|
|
|
|
const RESPONSES = [
|
|
{ text: 'It is certain.', positive: true },
|
|
{ text: 'It is decidedly so.', positive: true },
|
|
{ text: 'Without a doubt.', positive: true },
|
|
{ text: 'Yes, definitely.', positive: true },
|
|
{ text: 'You may rely on it.', positive: true },
|
|
{ text: 'As I see it, yes.', positive: true },
|
|
{ text: 'Most likely.', positive: true },
|
|
{ text: 'Outlook good.', positive: true },
|
|
{ text: 'Yes.', positive: true },
|
|
{ text: 'Signs point to yes.', positive: true },
|
|
{ text: 'Reply hazy, try again.', positive: null },
|
|
{ text: 'Ask again later.', positive: null },
|
|
{ text: 'Better not tell you now.', positive: null },
|
|
{ text: 'Cannot predict now.', positive: null },
|
|
{ text: 'Concentrate and ask again.', positive: null },
|
|
{ text: "Don't count on it.", positive: false },
|
|
{ text: 'My reply is no.', positive: false },
|
|
{ text: 'My sources say no.', positive: false },
|
|
{ text: 'Outlook not so good.', positive: false },
|
|
{ text: 'Very doubtful.', positive: false },
|
|
];
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName('8ball')
|
|
.setDescription('Ask the magic 8-ball a question')
|
|
.addStringOption(option =>
|
|
option.setName('question')
|
|
.setDescription('Your question for the 8-ball')
|
|
.setRequired(true)
|
|
.setMaxLength(256)
|
|
),
|
|
|
|
async execute(interaction, supabase, client) {
|
|
const question = interaction.options.getString('question');
|
|
const response = RESPONSES[Math.floor(Math.random() * RESPONSES.length)];
|
|
|
|
const mode = await getServerMode(supabase, interaction.guildId);
|
|
|
|
let color;
|
|
if (response.positive === true) color = 0x22C55E;
|
|
else if (response.positive === false) color = 0xEF4444;
|
|
else color = 0xF59E0B;
|
|
|
|
const embed = new EmbedBuilder()
|
|
.setColor(color)
|
|
.setTitle('🎱 Magic 8-Ball')
|
|
.addFields(
|
|
{ name: '❓ Question', value: question },
|
|
{ name: '🔮 Answer', value: response.text }
|
|
)
|
|
.setFooter({ text: `Asked by ${interaction.user.username}` })
|
|
.setTimestamp();
|
|
|
|
await interaction.reply({ embeds: [embed] });
|
|
},
|
|
};
|