boş veri veriyor

client.on('messageCreate', (message) => {
console.log(message.content);
});
client.on('messageCreate', (message) => {
console.log(message.content);
});
yaptığım zaman veya mesaj log yaptığım zaman boş değer atıyor bunun sebebi nedir?
35 Replies
asdc
asdcOP2w ago
intentslerde açık evet
const { Collection, ActionRowBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder } = require('discord.js');
const mongoose = require('mongoose');
const config = require("./config.json");
const { Client, GatewayIntentBits } = require('discord.js');

const client = new Client({
intents: 32767
});
client.config = require("./config")
client.slash_commands = new Collection();
client.events = new Collection();
const { Collection, ActionRowBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder } = require('discord.js');
const mongoose = require('mongoose');
const config = require("./config.json");
const { Client, GatewayIntentBits } = require('discord.js');

const client = new Client({
intents: 32767
});
client.config = require("./config")
client.slash_commands = new Collection();
client.events = new Collection();
inflames
inflames2w ago
message yi loglar mısın direk
asdc
asdcOP2w ago
<ref *1> Message {
channelId: '1358116456369356803',
guildId: '1358063944065089679',
id: '1359646447343108228',
createdTimestamp: 1744235374056,
type: 0,
system: false,
content: '',
author: User {
id: '819202682186104842',
bot: false,
system: false,
flags: UserFlagsBitField { bitfield: 4194304 },
username: 'mahrumiyet',
globalName: null,
discriminator: '0',
avatar: '84bb7395546c96d962a1e0287b464a5e',
banner: undefined,
accentColor: undefined,
avatarDecoration: null,
avatarDecorationData: null
},
pinned: false,
tts: false,
nonce: '1359646456482365440',
embeds: [],
components: [],
attachments: Collection(0) [Map] {},
stickers: Collection(0) [Map] {},
position: null,
roleSubscriptionData: null,
resolved: null,
editedTimestamp: null,
reactions: ReactionManager { message: [Circular *1] },
mentions: MessageMentions {
everyone: false,
users: Collection(0) [Map] {},
roles: Collection(0) [Map] {},
_members: null,
_channels: null,
_parsedUsers: null,
crosspostedChannels: Collection(0) [Map] {},
repliedUser: null
},
webhookId: null,
groupActivityApplication: null,
applicationId: null,
activity: null,
flags: MessageFlagsBitField { bitfield: 0 },
reference: null,
interactionMetadata: null,
interaction: null,
poll: null,
messageSnapshots: Collection(0) [Map] {},
call: null
}
<ref *1> Message {
channelId: '1358116456369356803',
guildId: '1358063944065089679',
id: '1359646447343108228',
createdTimestamp: 1744235374056,
type: 0,
system: false,
content: '',
author: User {
id: '819202682186104842',
bot: false,
system: false,
flags: UserFlagsBitField { bitfield: 4194304 },
username: 'mahrumiyet',
globalName: null,
discriminator: '0',
avatar: '84bb7395546c96d962a1e0287b464a5e',
banner: undefined,
accentColor: undefined,
avatarDecoration: null,
avatarDecorationData: null
},
pinned: false,
tts: false,
nonce: '1359646456482365440',
embeds: [],
components: [],
attachments: Collection(0) [Map] {},
stickers: Collection(0) [Map] {},
position: null,
roleSubscriptionData: null,
resolved: null,
editedTimestamp: null,
reactions: ReactionManager { message: [Circular *1] },
mentions: MessageMentions {
everyone: false,
users: Collection(0) [Map] {},
roles: Collection(0) [Map] {},
_members: null,
_channels: null,
_parsedUsers: null,
crosspostedChannels: Collection(0) [Map] {},
repliedUser: null
},
webhookId: null,
groupActivityApplication: null,
applicationId: null,
activity: null,
flags: MessageFlagsBitField { bitfield: 0 },
reference: null,
interactionMetadata: null,
interaction: null,
poll: null,
messageSnapshots: Collection(0) [Map] {},
call: null
}
inflames
inflames2w ago
message content intentinin açık olduğuna emin misin developer portaldan açılan
asdc
asdcOP2w ago
No description
asdc
asdcOP2w ago
Açık hepsi
skyhan
skyhan2w ago
sen 32767 ile nasıl message create eventi alıyon o eventi direkt alamaman lazim senin 33280 olmasi lazim messageCreate eventi ve message content'i alabilmen icin
asdc
asdcOP2w ago
33280 yaptığım zaman hiç bir event çalışmıyor direkt bot inaktif oluyor
skyhan
skyhan2w ago
sayiyla yapacagina GatewayIntentBits kullansana
asdc
asdcOP2w ago
kullandığım zamanda çalışmıyor
skyhan
skyhan2w ago
o çalışmıyorsa sende bir problem var demek ki çalışmıyor biraz düşün amk
asdc
asdcOP2w ago
2 saat kafa yordum chatgptye bile sordum 😄
skyhan
skyhan2w ago
bence boş bir şekilde bir şey yapmışsın bilmeden ondan dolayı çalışmıyor botu gözden geçirmen gerek sorun intentlerde değil çünkü elli ki çünkü GatewayIntentBits ile orayı doldurduğunda message create gelmesi lazım botun aktif olmaması da cabası saçmalık
asdc
asdcOP2w ago
GatewayIntentBits yaptığım zaman Invalid bitfield flag or number: undefined. diyor mesela
skyhan
skyhan2w ago
nasıl yapıyon ss at
asdc
asdcOP2w ago
No description
skyhan
skyhan2w ago
bunların hepsine ihtiyacın var mı
asdc
asdcOP2w ago
genel olarak hepsini yazdım kullanıyorum cünkü özel mesaj felan
skyhan
skyhan2w ago
üstü çizili olanları sil ServerUpdates diye bir şey yok ayrıca moderation diye de bir şey yok GuildModeration olacak o
skyhan
skyhan2w ago
discord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
skyhan
skyhan2w ago
kontrol et buradan
asdc
asdcOP2w ago
yaptım eywallah teşekkür ederim
skyhan
skyhan2w ago
calısıyor mu simdi messageCreate
asdc
asdcOP2w ago
evet
skyhan
skyhan2w ago
👍
asdc
asdcOP2w ago
logladığım zaman çalışıyor messageyi content veriyor
skyhan
skyhan2w ago
oky o zaman
inflames
inflames7d ago
const client = new Client({ intents: Object.values(GatewayIntentBits).filter(x => typeof x === "string"), partials: Object.values(Partials).filter(x => typeof x === "string")});
const client = new Client({ intents: Object.values(GatewayIntentBits).filter(x => typeof x === "string"), partials: Object.values(Partials).filter(x => typeof x === "string")});
hepsini açacaksan şöyle bişi de kullanabilirsin yazım yanlışı yapmadıysam çalışır
skyhan
skyhan7d ago
hepsinin açılmasına gerek yok boşa event gelir
inflames
inflames7d ago
bence de evet ama hepsini açmak istiyo gibi
skyhan
skyhan7d ago
öyle istiyor olsa bile buna yönlendirmek yerine doğru olanı söylersen yardımcı olmuş olursun ayrıcda tüm partialların açmakta aynı şekilde kodlarda değişiklik yapmayı gerektirebilir ve partiallara çoğu zaman ihtiyacın olmuyor
inflames
inflames7d ago
console.log(Object.values(GatewayIntentBits).filter(x => typeof x === "string"))
console.log(Object.values(GatewayIntentBits).filter(x => typeof x === "string"))
ya da burdan bakıp sadece ihtiyacın olanları da açabilirsin, kod çalışmazsa burdan intent eksik mi diye bakarsın kafana göre
skyhan
skyhan7d ago
ona da gerek yok
skyhan
skyhan7d ago
Discord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
skyhan
skyhan7d ago
buradan bakabiliyon kolayca neyse zaten adamın sorunu cozuldu buraya yazmana gerek yok

Did you find this page helpful?