Daha fazla
- Sistem Özellikleri
- Excalibur g770 İ7 9750H GTX 1050 16 gb ram 500 gb 970 evo plus 1tb toshiba hdwl110
- Cinsiyet
- Erkek
- Meslek
- Öğrenci
Discord JS V14 ile bir doğruluk mu cesaret mi oyunu yaptım ancak bu bot sadece beni ve botun kendisini üye olarak görüyor.
Sunucudaki üyelerin listesini aldığım zaman böyle çıkıyor.
JavaScript:
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')
Sunucudaki üyelerin listesini aldığım zaman böyle çıkıyor.
Son düzenleyen: Moderatör: