DudeThatsErin

format.js

Nov 23rd, 2020 (edited)
1,390
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const { prefix, config } = require('F:/LIVE_BOTS/codinghelp-bot/config.json');
  2. const Discord = require("discord.js");
  3.  
  4. module.exports = {
  5.     name: 'format',
  6.     description: 'Asks people to format their code with backticks or by sharing their code on places like pastebin.com',
  7.     aliases: ['highlight'],
  8.     usage: '++format @username or user ID',
  9.     inHelp: 'yes',
  10.     execute(message, args) {
  11.         const user = message.mentions.users.first() || message.guild.members.cache.get(args[0]);
  12.         if(!user) {
  13.           message.channel.send('You need to specificy a user via mention or the ID.');
  14.           message.delete();
  15.           return;
  16.         }
  17.         else { let usr = message.mentions.members.first();
  18.             const formatEmbed = new Discord.MessageEmbed()
  19.             .setColor('RED')
  20.             .setTitle(`Did you format your code?`)
  21.             .setURL('https://codinghelp.site/wiki/faq/share-code/')
  22.             .setThumbnail('https://imgur.com/U6cwQxj.png')
  23.             .setDescription(`Please format your code using backticks. If you do\'t understand, we have an example below. Future code you share will be deleted until you format it.`)
  24.            .addFields(
  25.                { name: 'How do I format my code?', value: 'Great question! You will want to use the backtick key next to your keyboard. It looks like this `\\``. It is next to your number 1 key on your keyboard.\nIf you have a single line of code, you will want to use a single backtick around your code like so: `\\`<img src="image source here" alt="alt text here" />\\``\n If you have multiple lines of code (2 or more) you will want to use 3 backticks around your code like so:\n```\\```\n<html>\nextra code here...\nanother line here...\n</html>\n\\``````' },
  26.            )
  27.          
  28.                message.channel.send(`Hey, ${usr}!`, formatEmbed);
  29.         }
  30.         message.channel.bulkDelete(1);
  31.  
  32.     },
  33.    
  34. };
RAW Paste Data