const {ApplicationCommandType, ApplicationCommandOptionType,ChannelType, REST, Routes, Client, ChannelSelectMenuInteraction,ButtonBuilder,ActionRowBuilder,ButtonStyle,Events, ButtonInteraction, InteractionType, InteractionResponse, createChannel, CategoryChannel, PermissionOverwrites, PermissionsBitField, ModalSubmitFields, time,GatewayIntentBits,EmbedBuilder} = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds,GatewayIntentBits.GuildVoiceStates,GatewayIntentBits.GuildMembers] });
const commands =[
{
name:'dc',
description:'Doğruluk mu? Cesaret mi?'
}
]
const rest = new REST({ version: '10' }).setToken('Token');
(async () => {
try {
console.log('Started refreshing application (/) commands.');
await rest.put(Routes.applicationCommands('1086371456042160228'), { body: commands });
console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
})();
client.on('interactionCreate',async interaction =>{
if (!interaction.isChatInputCommand()) return;
if(interaction.commandName==='dc'){
const servermembers =interaction.guild.members.cache.map(member => member.id )
console.log(servermembers)
let sorankisi= interaction.guild.members.cache.random().user
let cevaplayankisi = interaction.guild.members.cache.random().user
interaction.reply('Soran kişi:'+sorankisi.username+' '+'Cevaplayan kişi:'+cevaplayankisi.username)
interaction.channel.send(sorankisi.username+':'+'Doğruluk mu? Cesaret mi?')
}
})
client.login('Token')