Skip to content

Commit

Permalink
Prettier Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kathund committed Nov 22, 2023
1 parent 4307117 commit 0c7bef4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
4 changes: 1 addition & 3 deletions src/api/discordAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ const { generateID, cleanMessage } = require('../functions/helper.js');
const config = require('../../config.json');
const nodeCache = require('node-cache');
const fetch = (...args) =>
import('node-fetch')
.then(({ default: fetch }) => fetch(...args))
.catch((error) => errorMessage(error));
import('node-fetch').then(({ default: fetch }) => fetch(...args)).catch((error) => errorMessage(error));

const discordCache = new nodeCache({ stdTTL: config.other.cacheTimeout });

Expand Down
4 changes: 1 addition & 3 deletions src/api/mojangAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ const { generateID, cleanMessage } = require('../functions/helper.js');
const config = require('../../config.json');
const nodeCache = require('node-cache');
const fetch = (...args) =>
import('node-fetch')
.then(({ default: fetch }) => fetch(...args))
.catch((error) => errorMessage(error));
import('node-fetch').then(({ default: fetch }) => fetch(...args)).catch((error) => errorMessage(error));

const mojangCache = new nodeCache({ stdTTL: config.other.cacheTimeout });

Expand Down
4 changes: 1 addition & 3 deletions src/api/pixelicAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ const config = require('../../config.json');
const nodeCache = require('node-cache');
const { getGuild } = require('./wynnCraftAPI.js');
const fetch = (...args) =>
import('node-fetch')
.then(({ default: fetch }) => fetch(...args))
.catch((error) => errorMessage(error));
import('node-fetch').then(({ default: fetch }) => fetch(...args)).catch((error) => errorMessage(error));

const pixelicCache = new nodeCache({ stdTTL: config.other.cacheTimeout });

Expand Down
4 changes: 1 addition & 3 deletions src/api/wynnCraftAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ const { getUUID } = require('./mojangAPI.js');
const config = require('../../config.json');
const nodeCache = require('node-cache');
const fetch = (...args) =>
import('node-fetch')
.then(({ default: fetch }) => fetch(...args))
.catch((error) => errorMessage(error));
import('node-fetch').then(({ default: fetch }) => fetch(...args)).catch((error) => errorMessage(error));

const wynncraftPlayerCache = new nodeCache({ stdTTL: config.other.cacheTimeout });
const wynncraftGuildCache = new nodeCache({ stdTTL: config.other.cacheTimeout });
Expand Down
8 changes: 2 additions & 6 deletions src/commands/dev/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,7 @@ module.exports = {
const rawPath = pathSegments.slice(4).join('/');
const url = `http://${validHosts[0]}/raw/${rawPath}`;
const fetch = (...args) =>
import('node-fetch')
.then(({ default: fetch }) => fetch(...args))
.catch((error) => errorMessage(error));
import('node-fetch').then(({ default: fetch }) => fetch(...args)).catch((error) => errorMessage(error));
const response = await fetch(url);
const data = await response.text();
const channel = interaction.options.getChannel('channel') ?? interaction.channel;
Expand All @@ -367,9 +365,7 @@ module.exports = {
const message = await channel.messages.fetch(messageId);
if (newEmbed.startsWith('https://')) {
const fetch = (...args) =>
import('node-fetch')
.then(({ default: fetch }) => fetch(...args))
.catch((error) => errorMessage(error));
import('node-fetch').then(({ default: fetch }) => fetch(...args)).catch((error) => errorMessage(error));
const url = `http://starb.in/raw/${newEmbed.split('.')[1].split('/')[1]}`;
const response = await fetch(url);
const data = await response.text();
Expand Down

0 comments on commit 0c7bef4

Please sign in to comment.