52 Replies
the problem not from the code i guess but please reply quickly
if any one came mention please
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View
اوك
okay
const { Events } = require('discord.js');
module.exports = {
name: Events.MessageCreate,
async execute(message) {
if (message.author.bot) return;
const TARGET_CHANNEL_IDS = ['1397239374697201757', '1399312419909795943']; // الرومات اللي تبيها
const LINE_IMAGE_URL = 'https://i.postimg.cc/PJRPKVkF/image.jpg';
if (TARGET_CHANNEL_IDS.includes(message.channel.id)) {
try {
await message.react('🤍');
await message.channel.send({ files: [LINE_IMAGE_URL] });
} catch (error) {
console.error('خطأ في ردة الفعل أو إرسال الصورة:', error);
}
}
},
};
@rmHawk765©®™
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View
i didnt understand
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View
ok in athkar.js ?
bc there is 15+ files
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View
ok
1min

@rmHawk765©®™
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View
oh , ok
message
is very likely to not be an actual Message

show your index.js or wherever your event handler is present
const { Events } = require('discord.js');
module.exports = {
name: Events.MessageCreate,
async execute(message) {
// ✅ طباعة معلومات المرسل قبل أي شرط
console.log('From', message.author);
// ✅ تأكد إن message.author موجود ثم تحقق من إذا كان بوت
if (!message.author || message.author.bot) return;
const TARGET_CHANNEL_IDS = ['1397239374697201757', '1399312419909795943'];
const LINE_IMAGE_URL = 'https://i.postimg.cc/PJRPKVkF/image.jpg';
if (TARGET_CHANNEL_IDS.includes(message.channel.id)) {
try {
await message.react('🤍');
await message.channel.send({ files: [LINE_IMAGE_URL] });
} catch (error) {
console.error('❌ Error Sending The Photo:', error);
}
}
},
};
thats athkar.js
that's not what I asked
ok
ok
how do i share from that?
i just put it and do copy and send?
yes
no wait
press on “save” at the bottom right
what
i press
okay now you should be able to paste the link
i take out the token?
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View
dn
.
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View
lines 56 and 58: at the end you have
(client, …args)
but the event files use async execute(message)
<< this one for your message create events
so now client
in your index.js is called message
in your event files
so to fix it you should add client
as first parameter everywhere in your event files
async execute(client, message)
as example for your message create event filesthat will solve the problem<
yeah that should solve the problem
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View
the event files only yes?
yes
but when for instance your event file is using
name: Events.MessageUpdate
then you would get async execute(client, oldMessage, newMessage)
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View

yeah so it works
you logged the client user
but the commands not working look at the console

thats not an error
that is
console.log(message.author)
which you added yourselfi know
but why the commands not working
idk
the question was “how to get rid of this error?”
is it from the host?
no it was a javascript error
how ill solve it
I don’t see any error in your console now
so there’s nothing to solve for me now
Unknown User•4w ago
Message Not Public
Sign In & Join Server To View
What info u need
@rmHawk765©®™ @b3ssel
.
If you aren't getting any errors, try to place
console.log
checkpoints throughout your code to find out where execution stops.
- Once you do, log relevant values and if-conditions
- More sophisticated debugging methods are breakpoints and runtime inspections: learn more