discord report command

client.on('message', message => {
    if (message.content.startsWith(prefix + 'report')) {
        if (message.author.bot) return;
        message.channel.send(`${message.author}` + ' Our Admin(s) Have Receied Your Report')
        const channel = client.channels.cache.get('YOUR CHANEL ID HERE')
        const ReportMessage = message.content.slice(7).trim();
        const ReportEmbed = new Discord.MessageEmbed()
            .setColor('#b700ff')
            .setTitle(ReportMessage)
        channel.send(`||${message.author}||` + "**'s Report : - **")
        channel.send(ReportEmbed)
    }
});

4
5
Bippy 8155 points

                                    Invite your bot: https://discord.com/oauth2/authorize?client_id=BOT_ID_HERE&scope=bot

4 (5 Votes)
0
5
1
Phoenix Logan 186120 points

                                    client.on('message', message => {
  let args = message.content.substring(PREFIX.length).split(' ');
  switch(args[0]){
      case 'report':
          message.delete({timeout: 3000});
          let target = message.mentions.members.first() || message.guild.members.cache.get(args[0]);
          if(!target) return message.channel.send('من فضلك مشنن العضو أولا!').then(m => m.delete({timeout: 15000}));

          let reason = args.slice(2).join(" ");
          if(!reason) return message.channel.send(`من فضلك حدد هدف الإبلاغ **${message.author.username}**`).then(m => m.delete({timeout: 15000}));

          let reportChannel = message.guild.channels.cache.find(x => x.name === "report");

          const embed = new Discord.MessageEmbed()
.setTitle("ابلاغ جديد")
.addField("العضو", `${target.user.username}`)
.addField("السبب", `${reason}`)
.addField("اسم المبلغ", `${message.author.username}`)
.addField("ايدي المبلغ", `${message.author.id}`)
.setFooter("ابلاغ جديد")

          message.channel.send('تم إيصال إبلاغك بنجاح شكرا لك على الإبلاغ').then(m => m.delete({timeout: 15000}));
          reportChannel.send(embed);
      break;
    };
});

5 (1 Votes)
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source