First commit for dscrdbt

This commit is contained in:
2025-04-15 16:15:56 -06:00
commit 11a100eacf
13 changed files with 482 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
const { SlashCommandBuilder, ActionRowBuilder, ModalBuilder, TextInputBuilder, TextInputStyle } = require('discord.js');
const fs = require('fs');
const path = require('path');
// Configuration
const ALLOWED_CHANNEL_ID = '1354951205180150004';
module.exports = {
data: new SlashCommandBuilder()
.setName('aipost')
.setDescription('Generate an Instagram post from a news article'),
async execute(interaction) {
// Check if the command is used in the allowed channel
if (interaction.channelId !== ALLOWED_CHANNEL_ID) {
return await interaction.reply({
content: 'This command can only be used in the designated channel.',
ephemeral: true,
});
}
// Modal creation
const modal = new ModalBuilder()
.setCustomId('aipostModal')
.setTitle('News Link');
// Text input component
const newsLinkInput = new TextInputBuilder()
.setCustomId('newsLinkInput')
.setLabel('Please provide the news article URL')
.setStyle(TextInputStyle.Short)
.setPlaceholder('https://example.com/news-article')
.setRequired(true);
// Add text input to the modal
const firstActionRow = new ActionRowBuilder().addComponents(newsLinkInput);
modal.addComponents(firstActionRow);
// Make the modal visible to the user
await interaction.showModal(modal);
},
// Handle the modal submission
async modalSubmit(interaction) {
if (interaction.customId === 'aipostModal') {
// Acknowledge the interaction
await interaction.deferReply();
// Placeholder for AI post generation
await interaction.editReply({
content: 'Here is your generated Instagram post:\n\n' +
'📸 *[Generated Image Placeholder]*\n\n' +
'📝 **Generated Caption:**\n' +
'Exciting news in tech! 🚀\n' +
'Stay updated with the latest trends!\n\n' +
'#tech #innovation #news #trending #instagram',
});
}
},
};

13
commands/utility/ping.js Normal file
View File

@@ -0,0 +1,13 @@
const { SlashCommandBuilder, MessageFlags } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction) {
await interaction.reply({
content: 'Secret Pong!',
flags: MessageFlags.Ephemeral
});
},
};

View File

@@ -0,0 +1,11 @@
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('server')
.setDescription('Provides information about the server.'),
async execute(interaction) {
await interaction.reply(`This server is ${interaction.guild.name} and has
${interaction.guild.memberCount} members.`);
},
};

11
commands/utility/user.js Normal file
View File

@@ -0,0 +1,11 @@
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('user')
.setDescription('Provides information about the user.'),
async execute(interaction) {
await interaction.reply(`This command was run by ${interaction.user.username},
who joined on ${interaction.member.joinedAt}.`);
},
};