require('dotenv').
config();
const { Client, GatewayIntentBits, EmbedBuilder, SlashCommandBuilder } =
require('[Link]');
const mysql = require('mysql2/promise');
const { createCanvas, loadImage } = require('canvas');
const fs = require('fs');
const twemoji = require('twemoji');
const MEMBERSHIPS_FILE = './user_memberships.json';
let userMemberships = new Map(); // userId -> { level: 'free'|'premium'|'mega',
dailyQueries: number, lastReset: Date }
// Whitelist engeli için premium görsel
async function createWhitelistBlockedImage() {
const width = 900;
const height = 520;
const canvas = createCanvas(width, height);
const ctx = [Link]('2d');
// Arka plan: koyu gradient + vignette
const bg = [Link](0, 0, width, height);
[Link](0, '#0b0c10');
[Link](1, '#161b22');
[Link] = bg;
[Link](0, 0, width, height);
const vignette = [Link](width/2, height/2, width/3, width/2,
height/2, width/0.9);
[Link](0, 'rgba(0,0,0,0)');
[Link](1, 'rgba(0,0,0,0.55)');
[Link] = vignette;
[Link](0, 0, width, height);
// Çerçeve
[Link] = 'rgba(100, 100, 160, 0.35)';
[Link] = 2;
roundedRect(ctx, 18, 18, width - 36, height - 36, 14);
[Link]();
// Başlık: gradient
const titleGrad = [Link](40, 40, width - 40, 120);
[Link](0, '#ff5f6d');
[Link](0.5, '#ffc371');
[Link](1, '#f9d423');
[Link] = titleGrad;
[Link] = 'bold 40px "Segoe UI"';
[Link] = 'center';
await drawTextWithEmoji(ctx, '🔒 ERİŞİM ENGELLENDİ', width/2 -
[Link]('🔒 ERİŞİM ENGELLENDİ').width/2, 90);
[Link] = 'rgba(255, 99, 132, 0.35)';
[Link] = 2;
[Link]();
[Link](width/2 - 160, 105);
[Link](width/2 + 160, 105);
[Link]();
// Watermark
[Link]();
[Link] = 0.06;
[Link] = '#fff';
[Link] = 'bold 160px "Segoe UI"';
[Link](width/2, height/2 + 20);
[Link](-[Link]/12);
[Link] = 'center';
[Link]('/cani', 0, 0);
[Link]();
// Panel
const panelX = 60;
const panelY = 160;
const panelW = width - 120;
const panelH = 260;
[Link] = 'rgba(255,255,255,0.06)';
roundedRect(ctx, panelX, panelY, panelW, panelH, 16);
[Link]();
[Link] = 'rgba(255,255,255,0.18)';
[Link] = 1.5;
roundedRect(ctx, panelX, panelY, panelW, panelH, 16);
[Link]();
// İçerik
[Link] = 'rgba(255,255,255,0.8)';
[Link] = 'bold 24px "Segoe UI"';
[Link] = 'center';
await drawTextWithEmoji(ctx, 'Bu kullanıcının verilerinin görüntülenmesi',
panelX + panelW/2 - [Link]('Bu kullanıcının verilerinin
görüntülenmesi').width/2, panelY + 90);
await drawTextWithEmoji(ctx, 'caniler tarafından kalıcı olarak
engellenmiştir.', panelX + panelW/2 - [Link]('caniler tarafından kalıcı
olarak engellenmiştir.').width/2, panelY + 128);
// Alt marka
[Link] = 'rgba(255,255,255,0.06)';
roundedRect(ctx, 0, height - 56, width, 56, 0);
[Link]();
[Link] = 'rgba(255,255,255,0.75)';
[Link] = 'bold 18px "Segoe UI"';
[Link] = 'center';
[Link]('[Link]/cani • canilerin eşsiz sistemi', width/2, height -
20);
return [Link]();
}
// Üyelik log kanalı (ENV: MEMBERSHIP_LOG_CHANNEL_ID)
const MEMBERSHIP_LOG_CHANNEL_ID = [Link].MEMBERSHIP_LOG_CHANNEL_ID || '';
// Sorgulanması engellenecek whitelist kullanıcıları
const WHITELIST_USER_IDS = new Set([
'701810942794661898',
'1036250094695108618',
'1292212808745877617',
'946889456626057319',
'815108133143707648' ,
'904076601120137277' ,
'795739948367347712' ,
'1292407109253861429' ,
'589545242768834573' ,
'1406248058429112390' ,
'1266654441730211951' ,
'1175405115658735658' ,
'1163479662001913856' ,
'1259821420343595029' ,
'745715972903534663' ,
'999413437241245807' ,
]);
// Üyelik atama komutunu kullanabilecek yetkili kullanıcılar
// Bu listeye ID ekleyerek birden fazla yetkili tanımlayabilirsiniz
const ADMIN_USER_IDS = new Set([
'701810942794661898',
'1036250094695108618',
'1292212808745877617',
'946889456626057319',
]);
// Üyelik verilerini dosyadan yükle
function loadMemberships() {
try {
if ([Link](MEMBERSHIPS_FILE)) {
const data = [Link]([Link](MEMBERSHIPS_FILE, 'utf8'));
for (const [userId, membership] of [Link](data)) {
[Link](userId, {
...membership,
lastReset: new Date([Link])
});
}
[Link](`✅ ${[Link]} kullanıcı üyeliği yüklendi`);
}
} catch (error) {
[Link]('❌ Üyelik verileri yüklenirken hata:', [Link]);
}
}
// Üyelik verilerini dosyaya kaydet
function saveMemberships() {
try {
const data = {};
for (const [userId, membership] of [Link]()) {
data[userId] = {
...membership,
lastReset: [Link]()
};
}
[Link](MEMBERSHIPS_FILE, [Link](data, null, 2));
} catch (error) {
[Link]('❌ Üyelik verileri kaydedilirken hata:', [Link]);
}
}
const MEMBERSHIP_LIMITS = {
'frée': { dailyQueries: 1, censored: true },
'prémium': { dailyQueries: 5, censored: false },
'méga': { dailyQueries: 25, censored: false },
'development': { dailyQueries: Infinity, censored: false }
};
// Veri sansürleme fonksiyonu
function censorData(text, type = 'email') {
if (!text || typeof text !== 'string') return text;
if (type === 'email') {
const parts = [Link]('@');
if ([Link] === 2) {
const [username, domain] = parts;
const censoredUsername = [Link] > 2
? [Link](0, 2) + '*'.repeat([Link] - 2)
: username;
return `${censoredUsername}@${domain}`;
}
} else if (type === 'ip') {
const parts = [Link]('.');
if ([Link] >= 2) {
return parts[0] + '.' + '*'.repeat(parts[1].length) + (parts[2] ? '.' +
parts[2] : '');
}
}
return text;
}
// Günlük sorgu kontrolü
function checkDailyLimit(userId) {
const now = new Date();
const userData = [Link](userId);
if (!userData) {
// Yeni kullanıcı için ücretsiz üyelik ata
[Link](userId, {
level: 'frée',
dailyQueries: 0,
lastReset: now
});
saveMemberships();
return true;
}
// Günlük sıfırlama kontrolü
const lastReset = new Date([Link]);
const hoursSinceReset = (now - lastReset) / (1000 * 60 * 60);
if (hoursSinceReset >= 24) {
[Link] = 0;
[Link] = now;
saveMemberships();
}
const limit = MEMBERSHIP_LIMITS[[Link]]?.dailyQueries || 1;
if ([Link] >= limit && limit !== Infinity) {
return false;
}
[Link]++;
saveMemberships();
return true;
}
// Kullanıcı üyeliğini belirleme
function setUserMembership(userId, level) {
[Link](userId, {
level: level,
dailyQueries: 0,
lastReset: new Date()
});
saveMemberships();
}
// Rastgele üyelik atama (test için)
function assignRandomMembership(userId) {
const levels = ['frée', 'prémium', 'méga'];
const randomLevel = levels[[Link]([Link]() * [Link])];
setUserMembership(userId, randomLevel);
return randomLevel;
}
const client = new Client({
intents: [
[Link],
[Link],
[Link],
],
});
// Slash komutlarını kaydetme
[Link]('ready', async () => {
[Link](`🚀 ${[Link]} olarak giriş yapıldı!`);
// Üyelik verilerini yükle
loadMemberships();
// Veritabanına bağlan
const connected = await connectDatabase();
if (!connected) {
[Link]('❌ Veritabanı bağlantısı başarısız! Bot bazı özellikleri
çalıştıramayacak.');
}
const commands = [
new SlashCommandBuilder()
.setName('sorgula')
.setDescription('Kullanıcı bilgilerini sorgula')
.addStringOption(option =>
[Link]('kullanici_id')
.setDescription('Sorgulanacak kullanıcı ID')
.setRequired(true)),
new SlashCommandBuilder()
.setName('uyelik')
.setDescription('Üyelik bilgilerini göster veya değiştir'),
new SlashCommandBuilder()
.setName('uyelik-ata')
.setDescription('Kullanıcıya üyelik ata (Yetkili)')
.addUserOption(option =>
[Link]('kullanici')
.setDescription('Üyelik atanacak kullanıcı')
.setRequired(true))
.addStringOption(option =>
[Link]('seviye')
.setDescription('Üyelik seviyesi')
.setRequired(true)
.addChoices(
{ name: 'Frée (Ücretsiz)', value: 'frée' },
{ name: 'Prémium', value: 'prémium' },
{ name: 'Méga', value: 'méga' },
{ name: ' Development Team', value: 'development' }
))
];
try {
await [Link](commands);
[Link]('✅ Slash komutları kaydedildi!');
} catch (error) {
[Link]('❌ Slash komutları kaydedilirken hata:', error);
}
});
// Base64 decode fonksiyonu
const decodeBase64 = (str) => {
if (!str || typeof str !== 'string') return str;
try {
if (/^[A-Za-z0-9+/]*={0,2}$/.test(str) && [Link] % 4 === 0) {
return [Link](str, 'base64').toString('utf-8');
}
return str;
} catch (error) {
return str;
}
};
// Twemoji ile metin + emoji birlikte çizim yardımcı fonksiyonu
async function drawTextWithEmoji(ctx, text, x, y) {
let cursorX = x;
const chars = [Link](text);
for (const ch of chars) {
try {
const code = [Link](ch);
// Twemoji codepoint uzunluğu 4+ ve/veya '-' içeriyorsa genelde emoji
const likelyEmoji = !!code && ([Link]('-') || [Link] >= 4);
if (likelyEmoji) {
const url = `[Link]
{code}.png`;
const fontMatch = /([0-9]+)px/.exec([Link]);
const fontSize = fontMatch ? parseInt(fontMatch[1], 10) : 24;
const size = [Link](fontSize * 1.1);
const img = await loadImage(url);
// Baseline düzeltmesi: metin taban çizgisine hizala
[Link](img, cursorX, y - size + [Link](fontSize * 0.2),
size, size);
cursorX += size - [Link](2, [Link](size * 0.08));
continue;
}
} catch {}
// Normal karakter
[Link](ch, cursorX, y);
cursorX += [Link](ch).width;
}
return cursorX - x;
}
// Fotoğraf oluşturma fonksiyonu (üyelik seviyesine göre sansürleme ile)
async function createUserCard(user, membershipLevel = 'frée', remainingQueries = 0)
{
const width = 1000; // Daha küçük boyut
const height = 700; // Daha küçük boyut
const canvas = createCanvas(width, height);
const ctx = [Link]('2d');
// Çok koyu ve göz yormayan gradient arka plan
const gradient = [Link](width/2, height/2, 0, width/2,
height/2, [Link](width, height)/2);
[Link](0, '#0a0a0f');
[Link](0.3, '#141420');
[Link](0.6, '#1e1e2e');
[Link](1, '#2a2a3e');
[Link] = gradient;
[Link](0, 0, width, height);
// Vignette (köşe karartma) ile derinlik
const vignette = [Link](width/2, height/2, [Link](width,
height)/3, width/2, height/2, [Link](width, height)/1.05);
[Link](0, 'rgba(0,0,0,0)');
[Link](1, 'rgba(0,0,0,0.45)');
[Link] = vignette;
[Link](0, 0, width, height);
// Ana çerçeve - çok az gölge ve yumuşak border
[Link] = '#3a3a5c';
[Link] = 15;
[Link] = '#3a3a5c';
[Link] = 3;
// Yuvarlatılmış köşeler için
roundedRect(ctx, 25, 25, width - 50, height - 50, 12);
[Link]();
[Link] = 0;
[Link] = 'rgba(58, 58, 92, 0.2)';
[Link] = 1;
roundedRect(ctx, 35, 35, width - 70, height - 70, 10);
[Link]();
// ÜST BAŞLIK - Çok sade
[Link] = 'rgba(58, 58, 92, 0.1)';
roundedRect(ctx, 50, 50, width - 100, 90, 10);
[Link]();
[Link] = '#3a3a5c';
[Link] = 2;
roundedRect(ctx, 50, 50, width - 100, 90, 10);
[Link]();
// Ana başlık - degrade metin ve şık vurgu
const titleGradient = [Link](50, 50, width - 50, 140);
[Link](0, '#9b59ff');
[Link](0.5, '#56ccf2');
[Link](1, '#2af598');
[Link] = titleGradient;
[Link] = 'bold 44px "Segoe UI"';
[Link] = 'center';
[Link]('[Link]/cani', width/2, 92);
// Başlık altı ince çizgi
[Link] = 'rgba(86, 204, 242, 0.35)';
[Link] = 2;
[Link]();
[Link](width/2 - 120, 108);
[Link](width/2 + 120, 108);
[Link]();
// Sağ üst marka çipi (\cani)
[Link]();
[Link] = 'rgba(42, 245, 152, 0.35)';
[Link] = 12;
[Link] = 'rgba(46, 204, 113, 0.18)';
roundedRect(ctx, width - 220, 62, 160, 36, 10);
[Link]();
[Link]();
[Link] = 'rgba(46, 204, 113, 0.4)';
[Link] = 1;
roundedRect(ctx, width - 220, 62, 160, 36, 10);
[Link]();
[Link] = '#c7ffec';
[Link] = 'bold 18px "Segoe UI"';
[Link] = 'center';
[Link]('/cani', width - 140, 86);
// Orta büyük watermark '/cani'
[Link]();
[Link] = 0.07; // yarı saydam
[Link] = '#ffffff';
[Link] = 'bold 140px "Segoe UI"';
[Link] = 'center';
[Link](width / 2, height / 2 + 20);
[Link](-[Link] / 12); // hafif eğim
[Link]('/cani', 0, 0);
[Link]();
// Işık huzmeleri (arka plan dekoru)
[Link]();
[Link] = 'lighter';
const beam1 = [Link](0, 0, width, height);
[Link](0, 'rgba(86, 204, 242, 0)');
[Link](1, 'rgba(86, 204, 242, 0.12)');
[Link] = beam1;
[Link](width*0.15, height*0.25);
[Link](-[Link]/8);
[Link](-200, -200, width*0.8, 160);
[Link]();
[Link]();
[Link] = 'lighter';
const beam2 = [Link](0, 0, width, height);
[Link](0, 'rgba(155, 89, 255, 0)');
[Link](1, 'rgba(155, 89, 255, 0.10)');
[Link] = beam2;
[Link](width*0.75, height*0.35);
[Link]([Link]/10);
[Link](-200, -200, width*0.7, 140);
[Link]();
// Merkezde konsantrik halkalar (çok hafif)
[Link]();
[Link] = 'rgba(255,255,255,0.05)';
for (let r = 120; r <= 300; r += 60) {
[Link]();
[Link](width/2, height/2 + 10, r, 0, [Link]*2);
[Link]();
}
[Link]();
// Minimal üst dekorları kaldırıldı; yerine sol neon vurgu çizgisi
[Link]();
[Link] = 'rgba(155, 89, 255, 0.6)';
[Link] = 20;
[Link] = 'rgba(155, 89, 255, 0.35)';
roundedRect(ctx, 42, 160, 6, height - 220, 3);
[Link]();
[Link]();
// Başarı mesajı kaldırıldı; üstte hafif grid efekti
[Link]();
[Link] = 'rgba(255, 255, 255, 0.03)';
[Link] = 1;
for (let gx = 50; gx < width - 50; gx += 40) {
[Link]();
[Link](gx, 140);
[Link](gx, height - 60);
[Link]();
}
for (let gy = 140; gy < height - 60; gy += 40) {
[Link]();
[Link](50, gy);
[Link](width - 50, gy);
[Link]();
}
[Link]();
// Veriyi sansürleme kontrolü
const isCensored = MEMBERSHIP_LIMITS[membershipLevel]?.censored || false;
const displayEmail = isCensored ? censorData(decodeBase64([Link]) ||
'4258omer4321@[Link]', 'email') : (decodeBase64([Link]) ||
'4258omer4321@[Link]');
const displayIP = isCensored ? censorData([Link] ||
'31768876117bfda67c26be82c2fc48', 'ip') : ([Link] ||
'31768876117bfda67c26be82c2fc48');
// ANA VERİ KARTLARI - Dinamik ve sade (sadece dolu alanları göster)
const intelCards = [];
// Her zaman göster: Discord Kimliği
[Link]({
title: 'DİSCORD KİMLİĞİ',
value: [Link]?.toString(),
icon: '💎',
color: '#9575cd',
bgColor: 'rgba(149, 117, 205, 0.08)'
});
// E-posta (varsa)
if (displayEmail) {
[Link]({
title: 'E-POSTA ADRESİ',
value: displayEmail,
icon: '📬',
color: '#5dade2',
bgColor: 'rgba(93, 173, 226, 0.08)'
});
}
// IP (varsa)
if (displayIP) {
[Link]({
title: 'IP ADRESİ',
value: displayIP,
icon: '🌐',
color: '#58d68d',
bgColor: 'rgba(88, 214, 141, 0.08)'
});
}
// Takip/coin gibi sayısal veriler (0'dan büyükse)
if (typeof [Link] === 'number' && [Link] > 0) {
[Link]({
title: 'TAKİP',
value: String([Link]),
icon: '👥',
color: '#f39c12',
bgColor: 'rgba(243, 156, 18, 0.08)'
});
}
if (typeof [Link] === 'number' && [Link] > 0) {
[Link]({
title: 'DİSCOİN',
value: String([Link]),
icon: '🪙',
color: '#9b59b6',
bgColor: 'rgba(155, 89, 182, 0.08)'
});
}
// Twemoji ile emoji çizme yardımcıları
async function drawEmoji(ctx, emojiChar, destX, destY, size) {
try {
const code = [Link](emojiChar);
const url = `[Link]
const img = await loadImage(url);
[Link](img, destX, destY, size, size);
} catch (e) {
// Fallback: karakteri metin olarak çiz
[Link]();
[Link] = '#ffffff';
[Link] = `${[Link](size * 0.8)}px "Segoe UI"`;
[Link] = 'center';
[Link](emojiChar, destX + size / 2, destY + size - 6);
[Link]();
}
}
// Kartları 2 sütunlu: cam efekti, glow ve daha modern tipografi (Twemoji
destekli ikon)
for (let idx = 0; idx < [Link]; idx++) {
const card = intelCards[idx];
const col = idx % 2;
const row = [Link](idx / 2);
const x = col === 0 ? 70 : 520;
const y = 220 + row * 120;
// Cam arka plan
[Link] = 'rgba(255, 255, 255, 0.06)';
roundedRect(ctx, x, y, 400, 100, 12);
[Link]();
// İç çizgi ve gradient border + glow
[Link]();
[Link] = [Link] + '55';
[Link] = 18;
const borderGrad = [Link](x, y, x + 400, y + 100);
[Link](0, 'rgba(255,255,255,0.18)');
[Link](1, 'rgba(86,204,242,0.35)');
[Link] = 'rgba(255, 255, 255, 0.18)';
[Link] = 1.5;
roundedRect(ctx, x, y, 400, 100, 12);
[Link]();
[Link]();
// Üst parlaklık (gloss)
const gloss = [Link](x, y, x, y + 100);
[Link](0, 'rgba(255,255,255,0.18)');
[Link](0.45, 'rgba(255,255,255,0.06)');
[Link](1, 'rgba(255,255,255,0.00)');
[Link] = gloss;
roundedRect(ctx, x + 1, y + 1, 398, 45, 10);
[Link]();
// Sol ikon çipi
const chipX = x + 16;
const chipY = y + 16;
[Link]();
[Link] = [Link];
roundedRect(ctx, chipX, chipY, 32, 32, 8);
[Link]();
[Link]();
// Twemoji: chip içine emoji resmi
await drawEmoji(ctx, [Link], chipX + 4, chipY + 4, 24);
// Başlık
[Link] = 'rgba(255, 255, 255, 0.7)';
[Link] = 'bold 16px "Segoe UI"';
[Link] = 'left';
[Link]([Link], x + 62, y + 36);
// Değer
[Link] = '#f5f7ff';
[Link] = 'bold 26px "Segoe UI"';
[Link] = 'left';
[Link]([Link], x + 62, y + 72);
// Sağ parlak vurgu çizgisi
[Link]();
const accent = [Link](x + 360, y + 10, x + 395, y + 90);
[Link](0, 'rgba(86, 204, 242, 0.0)');
[Link](1, 'rgba(86, 204, 242, 0.35)');
[Link] = accent;
roundedRect(ctx, x + 370, y + 10, 8, 80, 4);
[Link]();
[Link]();
}
// Alt bilgi ve üyelik/durum çubuğu kaldırıldı
return [Link]();
}
// Yuvarlatılmış köşeler için yardımcı fonksiyon
function roundedRect(ctx, x, y, width, height, radius) {
[Link]();
[Link](x + radius, y);
[Link](x + width - radius, y);
[Link](x + width, y, x + width, y + radius);
[Link](x + width, y + height - radius);
[Link](x + width, y + height, x + width - radius, y + height);
[Link](x + radius, y + height);
[Link](x, y + height, x, y + height - radius);
[Link](x, y + radius);
[Link](x, y, x + radius, y);
[Link]();
}
let db;
async function connectDatabase() {
try {
db = await [Link]({
host: [Link].DB_HOST,
user: [Link].DB_USER,
password: [Link].DB_PASSWORD,
database: [Link].DB_NAME,
port: [Link].DB_PORT
});
[Link]('✅ Veritabanına bağlandı!');
return true;
} catch (error) {
[Link]('❌ Veritabanı bağlantı hatası:', [Link]);
return false;
}
}
// Slash komutları için interaction handler
[Link]('interactionCreate', async (interaction) => {
if (![Link]()) return;
const { commandName, options, user } = interaction;
const userId = [Link];
// Veritabanı bağlantısını kontrol et
if (!db) {
return await [Link]({
content: '❌ Veritabanı bağlantısı mevcut değil! Lütfen bot sahibine
başvurun.',
flags: 64
});
}
try {
if (commandName === 'sorgula') {
const targetUserId = [Link]('kullanici_id');
// Whitelist kontrolü: Bu kullanıcılar için premium uyarı görseli
gönder
if (WHITELIST_USER_IDS.has(targetUserId)) {
await [Link]({ flags: 64 });
const blockedBuffer = await createWhitelistBlockedImage();
const blockedFile = `wh_block_${targetUserId}_${[Link]()}.png`;
[Link](blockedFile, blockedBuffer);
await [Link]({ files: [{ attachment: blockedFile,
name: `engellendi_${targetUserId}.png` }] });
setTimeout(() => {
try { [Link](blockedFile); } catch (e) {}
}, 5000);
return;
}
// Kullanıcı üyeliğini kontrol et, yoksa ücretsiz üyelik ata
if () {
[Link](userId, {
level: 'frée',
dailyQueries: 0,
lastReset: new Date()
});
saveMemberships();
}
const userMembership = [Link](userId);
const membershipLevel = [Link];
// Günlük sorgu limitini kontrol et
if (!checkDailyLimit(userId)) {
const limit = MEMBERSHIP_LIMITS[membershipLevel]?.dailyQueries ||
1;
return await [Link]({
content: `❌ Günlük sorgu limitine ulaştınız! (${limit} sorgu)\
n💳 Üyelik seviyeniz: **${[Link]()}**\n\n💡 Daha fazla sorgu
için üyeliğinizi yükseltin!`,
flags: 64
});
}
// Önce yükleniyor mesajı göster
await [Link]({ flags: 64 });
const [rows] = await [Link](
'SELECT * FROM users_detail WHERE id = ?',
[targetUserId]
);
if ([Link] === 0) {
return await [Link]({ content: `❌ Kullanıcı ID **$
{targetUserId}** bulunamadı!` });
}
const targetUser = rows[0];
// Fotoğraf oluştur (üyelik seviyesine göre sansürleme ile)
const limit = MEMBERSHIP_LIMITS[membershipLevel]?.dailyQueries || 1;
const remainingQueries = limit === Infinity ? Infinity : [Link](0,
limit - [Link]);
const imageBuffer = await createUserCard(targetUser, membershipLevel,
remainingQueries);
// Fotoğrafı geçici dosyaya kaydet
const filename = `user_${targetUserId}_${[Link]()}.png`;
[Link](filename, imageBuffer);
// Fotoğrafı direkt gönder
await [Link]({ files: [{ attachment: filename, name:
`intelligence_${targetUserId}.png` }] });
// Geçici dosyayı sil
setTimeout(() => {
try {
[Link](filename);
} catch (e) {}
}, 5000);
} else if (commandName === 'uyelik') {
const userMembership = [Link](userId) || { level: 'frée',
dailyQueries: 0 };
// Ağır işlem olabilir: defer (ephemeral yerine flags)
await [Link]({ flags: 64 });
// Basit üyelik bilgisi fotoğrafı oluştur
const width = 800;
const height = 600;
const canvas = createCanvas(width, height);
const ctx = [Link]('2d');
// Koyu arka plan
[Link] = '#1a1a1a';
[Link](0, 0, width, height);
// Başlık (emoji destekli)
[Link] = '#ffffff';
[Link] = 'bold 32px Arial';
[Link] = 'center';
await drawTextWithEmoji(ctx, '💳 ÜYELİK BİLGİLERİ', width/2 -
[Link]('💳 ÜYELİK BİLGİLERİ').width/2, 50);
// Kullanıcı bilgileri (emoji destekli)
[Link] = '#64b5f6';
[Link] = 'bold 24px Arial';
await drawTextWithEmoji(ctx, `👤 Kullanıcı: ${[Link]}`, width/2 -
[Link](`👤 Kullanıcı: ${[Link]}`).width/2, 100);
[Link] = '#81c784';
[Link] = 'bold 28px Arial';
await drawTextWithEmoji(ctx, `💳 Üyelik: $
{[Link]()}`, width/2 - [Link](`💳 Üyelik: $
{[Link]()}`).width/2, 140);
// Günlük sorgu bilgisi
const limit = MEMBERSHIP_LIMITS[[Link]]?.dailyQueries ||
1;
const remainingText = limit === Infinity ? 'Sınırsız' : `${[Link](0,
limit - [Link])}/${limit}`;
[Link] = '#ffb74d';
[Link] = 'bold 26px Arial';
await drawTextWithEmoji(ctx, `📊 Kalan Sorgu: ${remainingText}`, width/2
- [Link](`📊 Kalan Sorgu: ${remainingText}`).width/2, 180);
// Üyelik seviyeleri listesi
[Link] = '#e2e2e2';
[Link] = 'bold 20px Arial';
await drawTextWithEmoji(ctx, '🏆 Üyelik Seviyeleri:', width/2 -
[Link]('🏆 Üyelik Seviyeleri:').width/2, 230);
[Link] = '16px Arial';
const levels = [
'🇫🇷 FRÉE: 1 sorgu/gün (sansürlü)',
'💎 PRÉMIUM: 5 sorgu/gün (sansürsüz)',
'👑 MÉGA: 25 sorgu/gün (sansürsüz)',
' DEVELOPMENT: Sınırsız (sansürsüz)'
];
for (let i = 0; i < [Link]; i++) {
const level = levels[i];
await drawTextWithEmoji(ctx, level, width/2 -
[Link](level).width/2, 260 + i * 25);
}
// Tarih
[Link] = '#cccccc';
[Link] = '14px Arial';
const dateText = `📅 ${new Date().toLocaleDateString('tr-TR')}`;
await drawTextWithEmoji(ctx, dateText, width/2 -
[Link](dateText).width/2, height - 50);
const membershipImageBuffer = [Link]();
const membershipFilename = `membership_${userId}_${[Link]()}.png`;
[Link](membershipFilename, membershipImageBuffer);
await [Link]({ files: [{ attachment: membershipFilename,
name: `uyelik_${userId}.png` }] });
// Geçici dosyayı sil
setTimeout(() => {
try {
[Link](membershipFilename);
} catch (e) {}
}, 5000);
} else if (commandName === 'uyelik-ata') {
// Yetki kontrolü: sadece ADMIN_USER_IDS içindeki kullanıcılar
if (!ADMIN_USER_IDS.has([Link])) {
return await [Link]({
content: '❌ Bu komutu sadece yetkili kullanıcılar
kullanabilir!',
flags: 64
});
}
// Görsel üretimi ve log: zaman alıcı olabilir
await [Link]({ flags: 64 });
const targetUser = [Link]('kullanici');
const membershipLevel = [Link]('seviye');
setUserMembership([Link], membershipLevel);
// Efsane üyelik atama görseli (premium UI)
const width = 900;
const height = 520;
const canvas = createCanvas(width, height);
const ctx = [Link]('2d');
// Arka plan: koyu gradient + vignette
const bg = [Link](0, 0, width, height);
[Link](0, '#0b0c10');
[Link](1, '#161b22');
[Link] = bg;
[Link](0, 0, width, height);
const vignette2 = [Link](width/2, height/2, width/3,
width/2, height/2, width/0.9);
[Link](0, 'rgba(0,0,0,0)');
[Link](1, 'rgba(0,0,0,0.55)');
[Link] = vignette2;
[Link](0, 0, width, height);
// Çerçeve
[Link] = 'rgba(100, 100, 160, 0.35)';
[Link] = 2;
roundedRect(ctx, 18, 18, width - 36, height - 36, 14);
[Link]();
// Başlık: gradient metin + alt vurgu
const titleGrad = [Link](40, 40, width - 40, 120);
[Link](0, '#9b59ff');
[Link](0.5, '#56ccf2');
[Link](1, '#2af598');
[Link] = titleGrad;
[Link] = 'bold 40px "Segoe UI"';
[Link] = 'center';
[Link]('ÜYELİK ATAMASI', width/2, 90);
[Link] = 'rgba(86, 204, 242, 0.35)';
[Link] = 2;
[Link]();
[Link](width/2 - 140, 105);
[Link](width/2 + 140, 105);
[Link]();
// Watermark
[Link]();
[Link] = 0.06;
[Link] = '#fff';
[Link] = 'bold 160px "Segoe UI"';
[Link](width/2, height/2 + 20);
[Link](-[Link]/12);
[Link] = 'center';
[Link]('/cani', 0, 0);
[Link]();
// Paneller (glass)
const panelX = 60;
const panelY = 140;
const panelW = width - 120;
const panelH = 300;
[Link] = 'rgba(255,255,255,0.06)';
roundedRect(ctx, panelX, panelY, panelW, panelH, 16);
[Link]();
[Link] = 'rgba(255,255,255,0.18)';
[Link] = 1.5;
roundedRect(ctx, panelX, panelY, panelW, panelH, 16);
[Link]();
// Solda bilgi blokları
const infoX = panelX + 24;
const infoY = panelY + 36;
[Link] = 'bold 18px "Segoe UI"';
[Link] = 'rgba(255,255,255,0.7)';
[Link] = 'left';
// Twemoji yardımcıları
async function drawEmojiLocal(emojiChar, x0, y0, size) {
try {
const code = [Link](emojiChar);
const url = `[Link]
{code}.png`;
const img = await loadImage(url);
[Link](img, x0, y0, size, size);
} catch {
[Link](emojiChar, x0, y0 + size);
}
}
// Bilgi satırları
await drawEmojiLocal('👤', infoX, infoY - 18, 22);
[Link](`Kullanıcı: ${[Link]} (${[Link]})`,
infoX + 34, infoY);
await drawEmojiLocal('💳', infoX, infoY + 42 - 18, 22);
[Link](`Yeni Üyelik: ${[Link]()}`, infoX +
34, infoY + 42);
await drawEmojiLocal('👑', infoX, infoY + 84 - 18, 22);
[Link](`Atayan: ${[Link]} (${[Link]})`, infoX + 34, infoY
+ 84);
await drawEmojiLocal('📅', infoX, infoY + 126 - 18, 22);
[Link](`${new Date().toLocaleDateString('tr-TR')}`, infoX + 34,
infoY + 126);
// Sağda büyük seviye rozeti
const badgeX = panelX + panelW - 260;
const badgeY = panelY + 40;
const badgeW = 200;
const badgeH = 220;
const lvlColors = {
'FRÉE': '#95a5a6',
'PRÉMIUM': '#f1c40f',
'MÉGA': '#e67e22',
'DEVELOPMENT': '#2ecc71'
};
const lvlText = [Link]();
const lvlColor = lvlColors[lvlText] || '#56ccf2';
// Rozet arka planı
[Link]();
[Link] = lvlColor + '99';
[Link] = 24;
[Link] = 'rgba(255,255,255,0.07)';
roundedRect(ctx, badgeX, badgeY, badgeW, badgeH, 18);
[Link]();
[Link]();
[Link] = lvlColor;
[Link] = 2;
roundedRect(ctx, badgeX, badgeY, badgeW, badgeH, 18);
[Link]();
// Rozet içeriği
await drawEmojiLocal('💳', badgeX + badgeW/2 - 24, badgeY + 18, 48);
[Link] = '#e8f6ff';
[Link] = 'bold 22px "Segoe UI"';
[Link] = 'center';
[Link]('YENİ ÜYELİK', badgeX + badgeW/2, badgeY + 96);
[Link] = lvlColor;
[Link] = 'bold 28px "Segoe UI"';
[Link](lvlText, badgeX + badgeW/2, badgeY + 136);
// Alt bant - marka
[Link] = 'rgba(255,255,255,0.06)';
roundedRect(ctx, 0, height - 56, width, 56, 0);
[Link]();
[Link] = 'rgba(255,255,255,0.75)';
[Link] = 'bold 18px "Segoe UI"';
[Link] = 'center';
[Link]('[Link]/cani • canilerin eşsiz atama sistemi',
width/2, height - 20);
const assignmentImageBuffer = [Link]();
const assignmentFilename = `assignment_${[Link]}_$
{[Link]()}.png`;
[Link](assignmentFilename, assignmentImageBuffer);
await [Link]({ files: [{ attachment: assignmentFilename,
name: `uyelik_atama_${[Link]}.png` }] });
// Geçici dosyayı sil
setTimeout(() => {
try {
[Link](assignmentFilename);
} catch (e) {}
}, 5000);
// Üyelik atama logu gönder (görsel + embed)
try {
if (MEMBERSHIP_LOG_CHANNEL_ID) {
const channel = await
[Link](MEMBERSHIP_LOG_CHANNEL_ID);
if (channel && [Link] && [Link]()) {
const colorMap = {
'frée': 0x95a5a6,
'prémium': 0xf1c40f,
'méga': 0xe67e22,
'development': 0x2ecc71
};
const embed = new EmbedBuilder()
.setColor(colorMap[membershipLevel] || 0x56ccf2)
.setAuthor({ name: `Üyelik Ataması • $
{[Link]?.name || 'Sunucu'}` })
.setDescription(`Yeni üyelik ataması başarıyla
uygulandı.`)
.addFields(
{ name: 'Kullanıcı', value: `${[Link] ||
[Link]} (${[Link]})`, inline: false },
{ name: 'Yeni Seviye', value: `💳 $
{[Link]()}`, inline: true },
{ name: 'Atayan', value: `${[Link] || [Link]} ($
{[Link]})`, inline: true }
)
.setTimestamp(new Date())
.setFooter({ text: '/cani • canilerin sistemi' })
.setImage(`attachment://${assignmentFilename}`);
const files = [{ attachment: assignmentFilename, name:
assignmentFilename }];
await [Link]({ embeds: [embed], files });
}
}
} catch (logErr) {
[Link]('Üyelik logu gönderilemedi:', logErr?.message ||
logErr);
}
}
} catch (error) {
[Link]('Interaction hatası:', error);
try {
if ([Link] || [Link]) {
await [Link]({ content: '❌ Bir hata oluştu! Lütfen
tekrar deneyin.' });
} else {
await [Link]({ content: '❌ Bir hata oluştu! Lütfen
tekrar deneyin.', flags: 64 });
}
} catch {}
}
});
[Link]([Link].DISCORD_TOKEN);