const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
],
});
const prefix = '!'; // Komut ön-eki
client.once('ready', () => {
console.log(`Bot ${client.user.tag} olarak giriş yaptı!`);
});
client.on('messageCreate', (message) => {
if (message.author.bot) return; // Botun kendi mesajlarını işleme alma
if (!message.content.startsWith(prefix)) return; // Ön-ekle başlamayan mesajları işleme alma
const args = message.content.slice(prefix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();
if (command === 'token2oauth') {
// token2oauth komutunu işle
const token = args[0]; // Tokeni komuttan al
// Tokeni OAuth2 bağlantısına çevir
const oauthLink = `https://discord.com/oauth2/authorize?client_id=${client.user.id}&scope=bot&permissions=YOUR_PERMISSIONS&token=${token}`;
message.reply(`İşte OAuth2 bağlantısı: ${oauthLink}`);
}
});
client.login('YOUR_BOT_TOKEN');