aboutsummaryrefslogtreecommitdiff
path: root/commands/Fun/jobs.js
blob: 5498f5be8b09e42022b75201fbfb558c13beb3a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/** **************************************
 *
 *   Jobs: Plugin for Galaxy that modifies balances of users.
 *   Copyright (C) 2018 TheEdge, jtsshieh, Alee
 *
 *   Licensed under the Open Software License version 3.0
 *
 * *************************************/
const cooldown = new Set();

exports.run = (bot, msg) => {
  if (cooldown.has(msg.author.id)) return msg.reply('You have worked too recently');

  const jobs = [
    "started a BitCoin farm",
    "crashed an airplane",
    "became a doctor and illegally sold organs",
    "stole Blake Australia's fame and made a lot of money",
    "became a bus driver",
    "started working for Universe Dev Group",
    "programmed a Discord bot",
    "made a crowdfunding campaign",
    "became a news anchor",
    "flooded Amsterdam",
    "became YouTube famous.",
  ]

  if (bot.dbl.hasVoted(msg.author.id)) {
    var creditsEarned = Math.floor(Math.random() * 650);
    bot.plugins.economy.add(msg.author.id, creditsEarned);
    msg.channel.send('You ' + jobs[Math.floor(Math.random() * jobs.length)] + '\n\nYou earned ' + creditsEarned.toString() + ' atoms.');
  }
  else {
    var creditsEarned = Math.floor(Math.random() * 250);
    bot.plugins.economy.add(msg.author.id, creditsEarned);
    msg.channel.send('You ' + jobs[Math.floor(Math.random() * jobs.length)] + '\n\nYou earned ' + creditsEarned.toString() + ' atoms.');
  }
  cooldown.add(msg.author.id);
  setTimeout(() => {
    cooldown.delete(msg.author.id);
  }, 3600000);
};

exports.conf = {
  aliases: [],
  guildOnly: true,
};

exports.help = {
  name: 'jobs',
  description: 'Work to add atoms to your account.',
};