Compare commits
No commits in common. "0068cde2347f9887803c4787efdaf1e2cd10c2a0" and "75b9d712afb0c778a4872f6357a333bfd488dddb" have entirely different histories.
0068cde234
...
75b9d712af
2 changed files with 1 additions and 53 deletions
|
@ -185,52 +185,6 @@ module.exports = class Splatnet extends Command {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subCmd === 'salmonrun') {
|
|
||||||
if (client.cache.has('SPLATNET_SR') && Date.now() > client.cache.get('SPLATNET_SR').expiry) {
|
|
||||||
client.cache.delete('SPLATNET_SR');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!client.cache.has('SPLATNET_SR')) {
|
|
||||||
fetch('https://splatoon3.ink/data/schedules.json', { headers: { 'User-Agent': client.config.userAgent} })
|
|
||||||
.then(res => res.json())
|
|
||||||
.then(tlJson => {
|
|
||||||
fetch('https://splatoon3.ink/data/coop.json', { headers: { 'User-Agent': client.config.userAgent} })
|
|
||||||
.then(rewardRes => rewardRes.json())
|
|
||||||
.then(async rewardJson => {
|
|
||||||
const embeds = [];
|
|
||||||
const json = {
|
|
||||||
tl: tlJson.data.coopGroupingSchedule,
|
|
||||||
rw: rewardJson.data.coopResult.monthlyGear
|
|
||||||
};
|
|
||||||
|
|
||||||
embeds.push(new client.EmbedBuilder()
|
|
||||||
.setTitle('Current Salmon Run')
|
|
||||||
.setColor(interaction.guild.members.me.displayColor)
|
|
||||||
.setThumbnail(json.rw.image.url)
|
|
||||||
.setImage(json.tl.regularSchedules.nodes[0].setting.coopStage.image.url)
|
|
||||||
.addFields(
|
|
||||||
{
|
|
||||||
name: 'Stage',
|
|
||||||
value: json.tl.regularSchedules.nodes[0].setting.coopStage.name,
|
|
||||||
inline: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Monthly Gear',
|
|
||||||
value: json.rw.name,
|
|
||||||
inline: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Weapons',
|
|
||||||
value: json.tl.regularSchedules.nodes[0].setting.weapons[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (subCmd === 'gear') {
|
if (subCmd === 'gear') {
|
||||||
if (client.cache.has('SPLATNET_GEAR') && Date.now() > client.cache.get('SPLATNET_GEAR').expiry) {
|
if (client.cache.has('SPLATNET_GEAR') && Date.now() > client.cache.get('SPLATNET_GEAR').expiry) {
|
||||||
client.cache.delete('SPLATNET_GEAR');
|
client.cache.delete('SPLATNET_GEAR');
|
||||||
|
|
|
@ -2,17 +2,11 @@
|
||||||
|
|
||||||
const { REST, Routes } = require('discord.js');
|
const { REST, Routes } = require('discord.js');
|
||||||
const { clientId, token } = require('../botconfig.json');
|
const { clientId, token } = require('../botconfig.json');
|
||||||
|
const guildId = '413591792185769984';
|
||||||
const read = require('fs-readdir-recursive');
|
const read = require('fs-readdir-recursive');
|
||||||
const commands = [];
|
const commands = [];
|
||||||
const commandFiles = read('./commands').filter(file => file.endsWith('.js'));
|
const commandFiles = read('./commands').filter(file => file.endsWith('.js'));
|
||||||
|
|
||||||
if (process.argv.length === 2) {
|
|
||||||
console.log('No guild ID provided, deployment failed.');
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
const guildId = process.argv[2];
|
|
||||||
|
|
||||||
for (const file of commandFiles) {
|
for (const file of commandFiles) {
|
||||||
const command = new (require(__dirname + '/commands/' + file))(file.substr(file.indexOf('/') + 1).slice(0, -3), file.substr(0, file.indexOf('/')));
|
const command = new (require(__dirname + '/commands/' + file))(file.substr(file.indexOf('/') + 1).slice(0, -3), file.substr(0, file.indexOf('/')));
|
||||||
commands.push({
|
commands.push({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue