Discord botu çalışmıyor

emre_52

Hectopat
Katılım
13 Ocak 2022
Mesajlar
202
Çözümler
4
Daha fazla  
Cinsiyet
Erkek
Discord botu yaptım ama çalışmıyor ve her şey eksiksiz, yardımcı eder misiniz acaba? VS Code ile yaptım ping yazınca pong yazmıyor diğer komutlar da aynı şekilde.

Kod:
sürüm:Node.js v18.12.1
Const Discord = require('discord.js')
Const Client = New Discord.Client();
Client. On('ready', () => {
 console.log('logged in as ${Client. User. Tag}!');
});
Client. On('message', msg => {
 İf (msg. Content === 'ping') {
 Msg. Reply('pong');
 }
});
Client. Login('token');
 
bu....



Bir fikriniz var mı?
Kod:
const {Client} = require('discord.js');
Client.On('ready', () => {
console.log('logged in as ${Client.User.Tag}!');
});
Client.On('message', msg => {
if (msg.Content === 'ping') {
Msg.Reply('pong');
}
});
Client.Login('token');
Son olarak şunu dener misin?
 
deniyorum

node bot.js yazdığımda böyle bir hata geldı terminalde


C:\Users\eo910_000\Desktop\bot\bot.js:2
Client.On('ready', () => {
^

TypeError: Client.On is not a function
at Object.<anonymous> (C:\Users\eo910_000\Desktop\bot\bot.js:2:8)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
 
On küçük yazın.
 

On küçük yazın.
busefer böyle

C:\Users\eo910_000\Desktop\bot\bot.js:2
Client.On('ready', () => {
^

TypeError: Client.On is not a function
at Object.<anonymous> (C:\Users\eo910_000\Desktop\bot\bot.js:2:8)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47


Hmmm?

 
Son düzenleme:
Bu siteyi kullanmak için çerezler gereklidir. Siteyi kullanmaya devam etmek için çerezleri kabul etmelisiniz. Daha Fazlasını Öğren.…