Browse Source

Clean up code

Formatted code with correct spacing, removed some comments, and fixed
the random L on the ISS marker
pull/1/head
Abheek Dhawan 4 years ago
parent
commit
8a81879f46
  1. 9
      bot/awesomescibo.mjs

9
bot/awesomescibo.mjs

@ -6,10 +6,6 @@ const client = new Discord.Client({ partials: ['MESSAGE', 'CHANNEL', 'REACTION']
import fetch from 'node-fetch';
import * as fs from 'fs';
/*const Discord = require('discord.js');
const client = new Discord.Client({ partials: ['MESSAGE', 'CHANNEL', 'REACTION'] });
const fetch = require('node-fetch');
const fs = require('fs');*/
var hits = 0;
if (fs.existsSync('numhits.txt')) {
@ -19,7 +15,8 @@ if (fs.existsSync('numhits.txt')) {
console.log(err);
}
});
} else {
fs.writeFile('numhits.txt', hits, (error) => { if (error) { console.log(error); } });
}
@ -231,7 +228,7 @@ client.on('message', async message => {
// console.log(data.people[i]);
// astros += `${data.people[i]}\n`;
//}
message.channel.send(new Discord.MessageEmbed().setTitle("The current location of the ISS!").setImage(`https://api.mapbox.com/styles/v1/mapbox/light-v10/static/pin-s-l+000(${data.iss_position.longitude},${data.iss_position.latitude})/-87.0186,20,1/1000x1000?access_token=pk.eyJ1IjoiYWRhd2Vzb21lZ3V5IiwiYSI6ImNrbGpuaWdrYzJ0bGYydXBja2xsNmd2YTcifQ.Ude0UFOf9lFcQ-3BANWY5A`).setURL('https://spotthestation.nasa.gov/tracking_map.cfm')/*.addFields(
message.channel.send(new Discord.MessageEmbed().setTitle("The current location of the ISS!").setImage(`https://api.mapbox.com/styles/v1/mapbox/light-v10/static/pin-s+000(${data.iss_position.longitude},${data.iss_position.latitude})/-87.0186,20,1/1000x1000?access_token=pk.eyJ1IjoiYWRhd2Vzb21lZ3V5IiwiYSI6ImNrbGpuaWdrYzJ0bGYydXBja2xsNmd2YTcifQ.Ude0UFOf9lFcQ-3BANWY5A`).setURL('https://spotthestation.nasa.gov/tracking_map.cfm')/*.addFields(
{ name: 'Current inhabitants', value: `${astros}` }
)*/);
});

Loading…
Cancel
Save