Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { prefix, config } = require('../config.json');
- const Discord = require("discord.js");
- // Links Embeds
- const links1 = new Discord.MessageEmbed()
- .setColor('#9F49D1')
- .setTitle('Here are all of our useful links.')
- .addFields(
- {name: 'Related Subreddits', value: 'These are subreddits that have been found to be incredibly useful to the Finance community.\n- [r/PersonalFiannce](https://www.reddit.com/r/personalfinance/)\n- [r/CreditCards (no affiliation with us)](https://www.reddit.com/r/CreditCards)\n- [r/Frugal](https://www.reddit.com/r/frugal)\n- [r/StudentLoans](https://www.reddit.com/r/StudentLoans)\n- [r/Tax](https://www.reddit.com/r/tax)'},
- {name: 'Free Credit Monitoring', value: '- [CreditKarma](https://www.creditkarma.com/)\n- [CreditSesame](http://www.creditsesame.com/)\n- [Quizzle](https://www.quizzle.com/)'},
- {name: 'Other Resources', value: '- [Credit Card Wiki at r/PersonalFinance](https://www.reddit.com/r/personalfinance/wiki/creditcards)\nYou can view more resources by using \`$links 4\`.'}
- );
- const links2 = new Discord.MessageEmbed()
- .setColor('#BFD149')
- .setTitle('Related Subreddits')
- .setDescription('These are subreddits that have been found to be incredibly useful to the Finance community.\n- [r/PersonalFiannce](https://www.reddit.com/r/personalfinance/)\n- [r/CreditCards (no affiliation with us)](https://www.reddit.com/r/CreditCards)\n- [r/Frugal](https://www.reddit.com/r/frugal)\n- [r/StudentLoans](https://www.reddit.com/r/StudentLoans)\n- [r/Tax](https://www.reddit.com/r/tax)');
- const links3 = new Discord.MessageEmbed()
- .setColor('#D19F49')
- .setTitle('Free Credit Monitoring')
- .setDescription('- [CreditKarma](https://www.creditkarma.com/): Uses TransUnion and Equifax\n- [CreditSesame](http://www.creditsesame.com/): May use TransUnion or Experian depending on service.\n- [Quizzle](https://www.quizzle.com/): Uses Equifax.');
- const links4 = new Discord.MessageEmbed()
- .setColor('#1a1a1a')
- .setTitle('Other Resources')
- .setDescription('These are resources that don\'t fit into any other category.\n\n- [Credit Card Wiki at r/PersonalFinance](https://www.reddit.com/r/personalfinance/wiki/creditcards)\n- [Complete List of Free FICO Scores](http://www.doctorofcredit.com/credit-scores/fico-score/free-fico-score/)\n- [Free Credit Reports Info from FTC](http://www.consumer.ftc.gov/articles/0155-free-credit-reports)\n- [Card Offers Just for You](https://www.creditcards.com/cardmatch/)\n- [Compare Cash Reward Credit Cards](http://www.magnifymoney.com/compare/cash-back-credit-cards)\n- [List of credit card company phone numbers](http://ficoforums.myfico.com/t5/Credit-Card-Applications/Backdoor-Numbers/m-p/408066)\n- [Credt Card Tuneup](http://creditcardtuneup.com/) or [CreditIntro](http://www.creditintro.com/recommend/) to help you find the right card.\n- [Capital One Upgrade Link](https://verified.capitalone.com/sic-ui/#/esignin?Product=Card&Action=ProductUpgrade): Check PC eligibility for your existing card.\n- [Credit Card Insider](https://www.creditcardinsider.com/learn/): Learn the basics of Credit Cards.');
- // Links actual code
- module.exports = {
- name: 'links',
- description: 'Spits out an embed with the a few quick links. You can also get an embed for each link separately with this command.',
- aliases: ['useful', 'useful-links', 'link'],
- usage: `${prefix}links [number]`,
- inHelp: 'yes',
- execute(message, args) {
- const links = []; // Keeps all of the links inside an array.
- links.push(links1); // Pushes the alLinks embed. Each one below it pushes it's own embed. Each line is a separate rule and that is how the array knows 1 from 2 from 3, etc.
- links.push(links2);
- links.push(links3);
- links.push(links4);
- if (args[0] === 'all') { // Displays all of the links when $links all is run.
- let text = '';
- for (let i = 0; i < links.length; i++) {
- message.channel.send(links[i]);
- }
- message.channel.send(text);
- }
- else {
- if(!message.member.hasPermission("SEND_MESSAGES")){ // Allows any user that can send messages, use this command.
- message.channel.send('You can\'t use that');
- return;
- }
- const nb = parseInt(args[1])
- if (nb < 1 || nb > links.length || isNaN(nb)) { // Gives an error if a correct rule number isn't specified.
- message.channel.send ("Please enter the embed you would like to display. If you want all of them please run \`$links all\`.");
- message.delete();
- return;
- };
- message.channel.send(links[nb-1]); // Pings the user and deletes the message and asks them to follow the rules.
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement