index.js```js
const { Client, GatewayIntentBits } = require('discord.js');
const { Handlers } = require('./utils/functions');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMembers,
],
});
client.config = require('./utils/config');
const handlers = new Handlers(client);
handlers.events();
var users = ["693178945306230854"]
client.on("ready", () => {
client.application.commands.create({
name: "mesajat",
description: "Birine mesaj atarsınız.",
options: [{name: "resim", description: "Gondereceginiz resim.", required: false, type: 11}]
})
})
client.on("interactionCreate", async (interaction) => {
if (users.includes(interaction.user.id) == false) return interaction.reply({content: "> Bu komutu sadece yetkililer kullanır."})
if (interaction.channel && interaction.channel.type !== 1) return interaction.reply({ content: "dm geç" })
const lang = interaction.client.config.lang == 'tr';
if (interaction.isCommand() && interaction.commandName == "mesajat") {
const {
ModalBuilder,
TextInputBuilder,
TextInputStyle,
ActionRowBuilder
} = require('discord.js');
const modal = new ModalBuilder()
.setCustomId('mailForm')
.setTitle(lang ? 'Doğrulama' : 'Verifaction');
const mail = new TextInputBuilder()
.setCustomId('mailInput')
.setStyle(TextInputStyle.Paragraph)
.setLabel(lang ? 'E-Posta Adresleri:' : 'E-Mail Adresses:')
.setPlaceholder(lang ? 'ö[email protected]' : '[email protected]');
const text = new TextInputBuilder()
.setCustomId('textInput')
.setStyle(TextInputStyle.Paragraph)
.setLabel(lang ? 'Göndereceğiniz mesaj:' : 'The message you want to send:')
.setPlaceholder(lang ? 'Mesajınız.' : 'Mesajınız.');
const field = new ActionRowBuilder().addComponents(mail);
const field2 = new ActionRowBuilder().addComponents(text);
modal.addComponents(field, field2);
await interaction.showModal(modal);
}
})
client.login(client.config.client.token);