Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { prefix, config } = require('F:/LIVE_BOTS/codinghelp-bot/config.json');
- const Discord = require("discord.js");
- module.exports = {
- name: 'format',
- description: 'Asks people to format their code with backticks or by sharing their code on places like pastebin.com',
- aliases: ['highlight'],
- usage: '++format @username or user ID',
- inHelp: 'yes',
- execute(message, args) {
- const user = message.mentions.users.first() || message.guild.members.cache.get(args[0]);
- if(!user) {
- message.channel.send('You need to specificy a user via mention or the ID.');
- message.delete();
- return;
- }
- else { let usr = message.mentions.members.first();
- const formatEmbed = new Discord.MessageEmbed()
- .setColor('RED')
- .setTitle(`Did you format your code?`)
- .setURL('https://codinghelp.site/wiki/faq/share-code/')
- .setThumbnail('https://imgur.com/U6cwQxj.png')
- .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.`)
- .addFields(
- { 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\\``````' },
- )
- message.channel.send(`Hey, ${usr}!`, formatEmbed);
- }
- message.channel.bulkDelete(1);
- },
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement