#AUTOMOD

1 messages · Page 1 of 1 (latest)

opaque veldt
#

Yo

#

Can I send my code @main cedar

main cedar
#

Use a bin

opaque veldt
#
const guild = client.guilds.cache.get("805180562888327238");
client.on('messageCreate', async (message) => {
  const badWords = ['nig', 'bitch', 'cock', 'dick', 'pentai', 'sex', 'fag', 'b!tch', 's3x', 'f@g', 'horny', 'hentai'];
  const badWordsRegex = new RegExp(`^${badWords.join('|')}`, 'gim');
  try {
    if (badWordsRegex.test(message.content)) {
      await message.delete();
      await message.channel.send(`![No_1](https://cdn.discordapp.com/emojis/945798083734831135.webp?size=128 "No_1") <@${message.author.id}> , **No profanity!**`);
      const modembed = new Discord.MessageEmbed()
    .setAuthor(member.user.tag, member.user.displayAvatarURL({ dynamic: true }))
    .setColor("#FF0000")
    .setTitle(`You have been warned in ${member.guild.name}.`)
    .addFields(
        { name: 'Reason', value: 'Profanity' },
    )
   .setTimestamp()
    .setFooter({ text: `${member.guild.name}`, iconURL: member.guild.iconURL() });
      await message.author.send({ embeds: [modembed] });
    }
  }
  catch (e) {
    if (e.code !== 10008) {
      message.channel.send(`Something went wrong.`);
    }
  }
})```


it responds SOMETHING IS WRONG
main cedar
#

Log the error so you have something more specific to go off of

opaque veldt
opaque veldt
#

or smth

main cedar
#

not at all

vapid bloomBOT
#

<:_:874569322742308864> Message#member
Represents the author of the message as a guild member. Only available if the message comes from a guild where the author is still a member

opaque veldt
main cedar
#

That is not a GuildMember instance

opaque veldt
opaque veldt
main cedar
#

what are you confused about

opaque veldt
# main cedar what are you confused about
const Discord = require('discord.js');


const prefix = `.`

const channel = client.guild.channels.cache.find(ch => ch.id == "945362909654044832");
module.exports = {
  name: 'ping',
   description: 'Ping Command',
  run: async(client, message, args) => {
    channel.send(`![godly_barchart](https://cdn.discordapp.com/emojis/945807016234979358.webp?size=128 "godly_barchart") Pinging...`)
    const pingembed = new Discord.MessageEmbed()
    .setDescription(` Latency is ${Date.now() - message.createdTimestamp}ms. \n > API Latency is ${Math.round(client.ws.ping)}ms.`)
   message.channel.send({ embeds: [pingembed] })
  }
}```


it says  have to define so many things
main cedar
#

Sounds like you copy pasted code that you don't understand

opaque veldt
opaque veldt
main cedar
#

Then you should know that variables must be defined, the most bare basics of JS

opaque veldt
main cedar
#

You should not ever make multiple clients unless you have multiple bots