"Kayıt botu" bot koda tepki vermiyor

shanoglu60

Kilopat
Katılım
7 Mart 2014
Mesajlar
902
Makaleler
2
Çözümler
1
Yer
Tarsus
Daha fazla  
Cinsiyet
Erkek
Meslek
Seo
JavaScript:
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, Modal, TextInputBuilder, OAuth2Scopes, Partials, resolveColor, Client, Collection, GatewayIntentBits,SelectMenuBuilder,ActivityType } = require("discord.js");
const client = global.client = new Client({fetchAllMembers: true,intents:[GatewayIntentBits.Guilds,GatewayIntentBits.GuildMembers,GatewayIntentBits.GuildBans,GatewayIntentBits.GuildEmojisAndStickers,GatewayIntentBits.GuildIntegrations,GatewayIntentBits.GuildWebhooks,GatewayIntentBits.GuildInvites,GatewayIntentBits.GuildVoiceStates,GatewayIntentBits.GuildPresences,GatewayIntentBits.GuildMessages,GatewayIntentBits.GuildMessageReactions,GatewayIntentBits.GuildMessageTyping,GatewayIntentBits.MessageContent],scopes:[OAuth2Scopes.Bot, OAuth2Scopes.ApplicationsCommands],partials: [Partials.Message, Partials.Channel, Partials.Reaction, Partials.User,Partials.GuildMember, Partials.ThreadMember, Partials.GuildScheduledEvent],ws: {version: "10"}});
 

client.on('messageCreate', message => {
  if (message.content.startsWith('!kayıt')) {
    // Sadece belirtilen yönetici ID'li kullanıcı tarafından çalıştırılabilir
    if (message.author.id !== '1054456513084788777') return;

    // İlk iki değişkeni al
    const args = message.content.split(' ').slice(1);
    const user = message.mentions.users.first();
    const name = args[1];
    const age = args[2];

    // Eksik değişkenler varsa hata mesajı gönder
    if (!user || !name || !age) return message.reply('Ltf geçerli bir kullanıcı etiketi, isim ve yaş girin!');

    // "kayıtsız" rolünü al
    const role = message.guild.roles.cache.find(r => r.name === 'kayıtsız');
    user.roles.add(role);

    // 1054629511234342933 ve 1054448470737571940 numaralı rolleri ata
    user.roles.add('1054629511234342933');
    user.roles.add('1054448470737571940');

    // Kullanıcı adını yöneticinin girdiği isim ve yaş ile değiştir
    const newName = `${name} | ${age}`;
    user.setNickname(newName);
  }
});

Sizce hata nerede?
 

Geri
Yukarı