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
47 lines
1.6 KiB
JavaScript
47 lines
1.6 KiB
JavaScript
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
|
|
const { getServerMode, getEmbedColor } = require('../utils/modeHelper');
|
|
|
|
const HUG_GIFS = [
|
|
'https://media.giphy.com/media/l2QDM9Jnim1YVILXa/giphy.gif',
|
|
'https://media.giphy.com/media/od5H3PmEG5EVq/giphy.gif',
|
|
'https://media.giphy.com/media/ZQN9jsRWp1M76/giphy.gif',
|
|
'https://media.giphy.com/media/lrr9rHuoJOE0w/giphy.gif',
|
|
'https://media.giphy.com/media/3M4NpbLCTxBqU/giphy.gif',
|
|
];
|
|
|
|
const HUG_MESSAGES = [
|
|
'{user} gives {target} a warm hug!',
|
|
'{user} wraps {target} in a cozy embrace!',
|
|
'{user} hugs {target} tightly!',
|
|
'{user} sends virtual hugs to {target}!',
|
|
'{user} gives {target} the biggest hug ever!',
|
|
];
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName('hug')
|
|
.setDescription('Give someone a virtual hug')
|
|
.addUserOption(option =>
|
|
option.setName('user')
|
|
.setDescription('The user to hug')
|
|
.setRequired(true)
|
|
),
|
|
|
|
async execute(interaction, supabase, client) {
|
|
const targetUser = interaction.options.getUser('user');
|
|
const mode = await getServerMode(supabase, interaction.guildId);
|
|
|
|
const gif = HUG_GIFS[Math.floor(Math.random() * HUG_GIFS.length)];
|
|
const message = HUG_MESSAGES[Math.floor(Math.random() * HUG_MESSAGES.length)]
|
|
.replace('{user}', interaction.user.toString())
|
|
.replace('{target}', targetUser.toString());
|
|
|
|
const embed = new EmbedBuilder()
|
|
.setColor(0xFFB6C1)
|
|
.setDescription(`🤗 ${message}`)
|
|
.setImage(gif)
|
|
.setTimestamp();
|
|
|
|
await interaction.reply({ embeds: [embed] });
|
|
},
|
|
};
|