- wdqwdqqaw
- Katılım
- 17 Kas 2023
- Mesajlar
- 2
- Tepkime puanı
- 0
- Şehir
- Çorum
V12 botumdaki tanımlı cüzdan kodu bu , bot çık gir yapınca kullanıcıların bakiyelerinin sıfırlanmamasını istiyorum nasıl yaparım
} else if (command === 'cüzdan') {
const user = getUser(message.author.id);
const userBalances = {};
if (user.money === 0) {
const zeroBalanceImageUrl = '
const embedZeroBalance = new Discord.MessageEmbed()
.setColor('#b0e0e6')
.setTitle('Cüzdan')
.setDescription('Paranız yok!')
.setImage(zeroBalanceImageUrl);
message.channel.send(embedZeroBalance);
return;
}
const canvas = createCanvas(400, 200);
const ctx = canvas.getContext('2d');
ctx.fillStyle = '#eee685';
ctx.fillRect(0, 0, 400, 200);
ctx.fillStyle = 'BLACK';
ctx.font = 'bold 20px Arial';
ctx.fillText('Cüzdan', 20, 30);
ctx.font = '16px Arial';
ctx.fillText(`MW Bakiyesi: ${user.money.toLocaleString()} MW`, 20, 70);
if (user.properties && user.properties.length > 0) {
const propertiesList = user.properties.map((property, index) => `${index + 1}. ${property.name}: ${property.value.toLocaleString()} MW`).join('\n');
ctx.font = '11px Arial';
ctx.fillText('Mülkler:', 20, 110);
ctx.fillText(propertiesList, 20, 120);
}
const customImageUrl = '
async function drawCustomImage() {
const customImage = await loadImage(customImageUrl);
ctx.drawImage(customImage, 200, 0, 200, 200);
const attachment = new MessageAttachment(canvas.toBuffer(), 'cuzdan.png');
message.channel.send(attachment);
}
drawCustomImage();
} else if (command === 'cüzdan') {
const user = getUser(message.author.id);
const userBalances = {};
if (user.money === 0) {
const zeroBalanceImageUrl = '
Bu bağlantıyı görmek için
Giriş yap veya kayıt ol.
const embedZeroBalance = new Discord.MessageEmbed()
.setColor('#b0e0e6')
.setTitle('Cüzdan')
.setDescription('Paranız yok!')
.setImage(zeroBalanceImageUrl);
message.channel.send(embedZeroBalance);
return;
}
const canvas = createCanvas(400, 200);
const ctx = canvas.getContext('2d');
ctx.fillStyle = '#eee685';
ctx.fillRect(0, 0, 400, 200);
ctx.fillStyle = 'BLACK';
ctx.font = 'bold 20px Arial';
ctx.fillText('Cüzdan', 20, 30);
ctx.font = '16px Arial';
ctx.fillText(`MW Bakiyesi: ${user.money.toLocaleString()} MW`, 20, 70);
if (user.properties && user.properties.length > 0) {
const propertiesList = user.properties.map((property, index) => `${index + 1}. ${property.name}: ${property.value.toLocaleString()} MW`).join('\n');
ctx.font = '11px Arial';
ctx.fillText('Mülkler:', 20, 110);
ctx.fillText(propertiesList, 20, 120);
}
const customImageUrl = '
Bu bağlantıyı görmek için
Giriş yap veya kayıt ol.
// Kullanmak istediğiniz özel resmin URL'siasync function drawCustomImage() {
const customImage = await loadImage(customImageUrl);
ctx.drawImage(customImage, 200, 0, 200, 200);
const attachment = new MessageAttachment(canvas.toBuffer(), 'cuzdan.png');
message.channel.send(attachment);
}
drawCustomImage();