#yeah ik but on the return part it dosent
1 messages · Page 1 of 1 (latest)
I think you meant to check if it wasnt the owner then return
that might be your issue
then fix it
oh no i meant to check if its the owner then it returns
try {
if (bannedWords.some(word => message.content.toLowerCase().includes(word))) {
if (message.author.id === message.guild.ownerID) {
return; // this means that if it IS the owner return early
}
await message.delete();
const swearEmbed = new Discord.MessageEmbed()
.setColor('#42b6f5')
.setTitle('Hey!')
.setDescription("You can't say that in this discord server! 🇽")
message.author.send({ embeds: [swearEmbed] });
console.log('@'+ message.author.tag,'tried saying,',message.content)
message.channel.permissionOverwrites.edit(message.author, {
SEND_MESSAGES: false
})
await new Promise(resolve => setTimeout(resolve,5000 )) //wait until unmute
message.channel.permissionOverwrites.edit(message.author, {
SEND_MESSAGES: true
})
}
the return part dosent return
thats the thing
i was testing it on my server which im the owner on and it dosent return
so if its the owner of the bot you want to skip this
it continues the code on the bottom
yea
console log the message auth and the guild owner id
new to discord.js what is message auth
message auth == message author
for debuggin resons
lets see whats the underlying issue
so before if (message.author.id === message.guild.ownerID) { console.log message.author.id and message.guild.ownerID
it errored
and it said guild is not defined
ReferenceError: guild is not defined
prepend guild.ownerID with message
guild doesnt exist because it only exists on the message class
whats prepend
add before something
k
its a normal english word btw
uh
logged this
btw it muted me (did what is supposed to do if ur not the owner which i am)
Guild (extends AnonymousGuild)
Represents a guild (or a server) on Discord. (more...)
are you the owner of the guild you are running the command on
yes
and i want it to return if ur the owner of the guild
so basically if u swore it would ignore you
and if ur not the owner it would warn you
to not swear
i just realized i did that on the wrong account🤦
ah lol