Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- const client = new Discord.Client();
- const auth = require('./auth.json');
- const fs = require('fs');
- const prefix = "/";
- client.rep = require('./data.json');
- client.on('ready', () => {
- console.log(`Logged in as ${client.user.tag}!`);
- client.user.setActivity('Sea of Thieves');
- });
- client.on('message', message => {
- if (message.content.startsWith(prefix + "rep")) {
- editedmessage = message.content.slice (4);
- client.rep [message.author.id] = {
- message: editedmessage
- }
- fs.appendFile("./data.json", JSON.stringify(client.rep, null, 4), err => {
- if(err) throw err;
- message.channel.send ("Your reputation has been updated");
- });
- }
- else if (message.content.startsWith(prefix + "update Sea Dogs")) {
- seadogsinput = message.content.slice (16);
- client.rep [message.author.id] = {
- message: editedmessage,
- seadogs: seadogsinput
- }
- fs.appendFile("./data.json", JSON.stringify(client.rep, null, 4), err => {
- if(err) throw err;
- message.channel.send ("Your Sea Dogs reputation has been updated");
- });
- }
- else if (message.content.startsWith(prefix + "update Hunter's Call")) {
- hunterscallinput = message.content.slice (21);
- client.rep [message.author.id] = {
- message: editedmessage,
- seadogs: seadogsinput,
- hunterscall: hunterscallinput
- }
- fs.appendFile("./data.json", JSON.stringify(client.rep, null, 4), err => {
- if(err) throw err;
- message.channel.send ("Your Hunter's Call reputation has been updated");
- });
- }
- else if (message.content.startsWith(prefix + "update Gold Hoarders")) {
- goldhoardersinput = message.content.slice (21);
- client.rep [message.author.id] = {
- message: editedmessage,
- seadogs: seadogsinput,
- hunterscall: hunterscallinput,
- goldhoarders: goldhoardersinput
- }
- fs.appendFile("./data.json", JSON.stringify(client.rep, null, 4), err => {
- if(err) throw err;
- message.channel.send ("Your Gold Hoarders reputation has been updated");
- });
- }
- else if (message.content.startsWith(prefix + "update Order of Souls")) {
- orderofsoulsinput = message.content.slice (22);
- client.rep [message.author.id] = {
- message: editedmessage,
- seadogs: seadogsinput,
- hunterscall: hunterscallinput,
- goldhoarders: goldhoardersinput,
- orderofsouls: orderofsoulsinput
- }
- fs.appendFile("./data.json", JSON.stringify(client.rep, null, 4), err => {
- if(err) throw err;
- message.channel.send ("Your Order of Souls reputation has been updated");
- });
- }
- else if (message.content.startsWith(prefix + "update Merchant Alliance")) {
- merchantallianceinput = message.content.slice (25);
- client.rep [message.author.id] = {
- message: editedmessage,
- seadogs: seadogsinput,
- hunterscall: hunterscallinput,
- goldhoarders: goldhoardersinput,
- orderofsouls: orderofsoulsinput,
- merchantalliance: merchantallianceinput
- }
- fs.appendFile("./data.json", JSON.stringify(client.rep, null, 4), err => {
- if(err) throw err;
- message.channel.send ("Your Merchant Alliance reputation has been updated");
- });
- }
- else if (message.content.startsWith(prefix + "update Athena's Fortune")) {
- athenainput = message.content.slice (24);
- client.rep [message.author.id] = {
- message: editedmessage,
- seadogs: seadogsinput,
- hunterscall: hunterscallinput,
- goldhoarders: goldhoardersinput,
- orderofsouls: orderofsoulsinput,
- merchantalliance: merchantallianceinput,
- athena: athenainput
- }
- fs.appendFile("./data.json", JSON.stringify(client.rep, null, 4), err => {
- if(err) throw err;
- message.channel.send ("Your Athena's Fortune reputation has been updated");
- });
- }
- if (message.content.startsWith (prefix + "showrep")) {
- let _message = client.rep[message.author.id].message;
- let _seadogslevel = client.rep[message.author.id].seadogs;
- let _hunterscalllevel = client.rep[message.author.id].hunterscall;
- let _goldhoarderslevel = client.rep[message.author.id].goldhoarders;
- let _orderofsoulslevel = client.rep[message.author.id].orderofsouls;
- let _merchantalliancelevel = client.rep[message.author.id].merchantalliance;
- let _athenalevel = client.rep[message.author.id].athena;
- var embed = new Discord.RichEmbed()
- .setTitle(message.author.username + ", your Sea of Thieves reputation")
- .setDescription('some description')
- .setThumbnail(message.author.displayAvatarURL)
- .addField('Gamer Tag', _message)
- .addField('Sea Dogs', _seadogslevel, true)
- .addField('Hunter\'s Call', _hunterscalllevel, true)
- .addField('Gold Hoarders', _goldhoarderslevel, true)
- .addField('Order of Souls', _orderofsoulslevel, true)
- .addField('Merchant Alliance', _merchantalliancelevel, true)
- .addField('Athena\'s Fortune', _athenalevel, true)
- .setColor('#0x5fafaf')
- message.channel.send (embed);
- }
- });
- client.login(auth.token);
Advertisement
Add Comment
Please, Sign In to add comment