Çözüldü Node index.js yazınca bot tepki vermiyor

Bu konu çözüldü olarak işaretlenmiştir. Çözülmediğini düşünüyorsanız konuyu rapor edebilirsiniz.

pinkuçi

Hectopat
Katılım
28 Ocak 2022
Mesajlar
76
Daha fazla  
Cinsiyet
Kadın
Arkadaşlar ben botumu aktif etmeye çalışıyorum ama aktif olmuyor görseldeki gibi hata veriyor. Bunlarda package. JSON dosyamdakiler.

Kod:
{
 "name": "pinkuci",
 "version": "0.0.1",
 "description": "",
 "main": "index.js",
 "scripts": {
 "test": "node index.js"
 },
 "author": "",
 "license": "ISC",
 "dependencies": {
 "discord.js": "^12.5.1"
 }
}
 

Dosya Ekleri

  • hata.PNG
    hata.PNG
    5,5 KB · Görüntüleme: 71
Son düzenleyen: Moderatör:
Çözüm
Kod:
const Discord = require('discord.js');
const client = new Discord.Client();

const prefix = '.';
const sahip = '579699401770139648';

client.on('ready', () => {
console.log(`Bot ${client.user.tag} çalışıyor !`);
});

client.on('message', msg => {
if (msg.content === 'selam') {
msg.reply('selam');
}
});

client.on('message', msg => {
if (msg.content === 'merhaba') {
msg.reply('selam')
}
});

client.login('token ');

Hocam client.login yerine botunuzun tokenini yazdınız mı, onun dışında hata göremedim burada.
Arkadaşlar ben botumu aktif etmeye çalışıyorum ama aktif olmuyor görseldeki gibi hata veriyor. Bunlarda package. JSON dosyamdakiler.

Kod:
{
 "name": "pinkuci",
 "version": "0.0.1",
 "description": "",
 "main": "index.js",
 "scripts": {
 "test": "node index.js"
 },
 "author": "",
 "license": "ISC",
 "dependencies": {
 "discord.js": "^12.5.1"
 }
}

Hocam index.js dosyanızın içini atar mısınız?
 
Hocam index.js dosyanızın içini atar mısınız?
Kod:
const Discord = require('discord.js');
const client = new Discord.Client();


const prefix = '.';
const sahip = '579699401770139648';

client.on('ready', () => {
console.log(`Bot ${client.user.tag} çalışıyor !`);
});

client.on('message', msg => {
if (msg.content === 'selam') {
msg.reply('selam');
}
});

client.on('message', msg => {
if (msg.content === 'merhaba') {
msg.reply('selam')
}
});

client.login('token ');
 
Kod:
const Discord = require('discord.js');
const client = new Discord.Client();

const prefix = '.';
const sahip = '579699401770139648';

client.on('ready', () => {
console.log(`Bot ${client.user.tag} çalışıyor !`);
});

client.on('message', msg => {
if (msg.content === 'selam') {
msg.reply('selam');
}
});

client.on('message', msg => {
if (msg.content === 'merhaba') {
msg.reply('selam')
}
});

client.login('token ');

Hocam client.login yerine botunuzun tokenini yazdınız mı, onun dışında hata göremedim burada.
 
Son düzenleyen: Moderatör:
Çözüm

Technopat Haberler

Geri
Yukarı