forked from Supositware/Haha-Yes
fix eslint
This commit is contained in:
parent
7f8895660b
commit
a4eab091c7
9 changed files with 21 additions and 16 deletions
|
@ -5,9 +5,9 @@
|
||||||
"es6": true
|
"es6": true
|
||||||
},
|
},
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 2021
|
"ecmaVersion": 2022,
|
||||||
|
"sourceType": "module"
|
||||||
},
|
},
|
||||||
"sourceType": "module",
|
|
||||||
"rules": {
|
"rules": {
|
||||||
"arrow-spacing": ["warn", { "before": true, "after": true }],
|
"arrow-spacing": ["warn", { "before": true, "after": true }],
|
||||||
"brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
|
"brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { SlashCommandBuilder } from '@discordjs/builders';
|
import { SlashCommandBuilder } from '@discordjs/builders';
|
||||||
import { MessageEmbed } from 'discord.js';
|
import { MessageEmbed } from 'discord.js';
|
||||||
import fetch from 'node-fetch'
|
import fetch from 'node-fetch';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
|
@ -34,7 +34,7 @@ export default {
|
||||||
.setURL('https://reddit.com' + response.data.children[i].data.permalink)
|
.setURL('https://reddit.com' + response.data.children[i].data.permalink)
|
||||||
.setFooter(`/r/${response.data.children[i].data.subreddit} | ⬆ ${response.data.children[i].data.ups} 🗨 ${response.data.children[i].data.num_comments}`);
|
.setFooter(`/r/${response.data.children[i].data.subreddit} | ⬆ ${response.data.children[i].data.ups} 🗨 ${response.data.children[i].data.num_comments}`);
|
||||||
|
|
||||||
interaction.editReply({ embeds: [redditEmbed]});
|
interaction.editReply({ embeds: [redditEmbed] });
|
||||||
interaction.followUp(response.data.children[i].data.url);
|
interaction.followUp(response.data.children[i].data.url);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -25,9 +25,12 @@ export default {
|
||||||
const gifskiOutput = output.replace(path.extname(output), '.gif');
|
const gifskiOutput = output.replace(path.extname(output), '.gif');
|
||||||
const gifsicleOutput = output.replace(path.extname(output), 'gifsicle.gif');
|
const gifsicleOutput = output.replace(path.extname(output), 'gifsicle.gif');
|
||||||
|
|
||||||
await utils.ffmpeg(`-i ${output} ${os.tmpdir()}/frame${interaction.id}%04d.png`); // Extract every frame for gifski
|
// Extract every frame for gifski
|
||||||
await gifski(gifskiOutput, `${os.tmpdir()}/frame${interaction.id}*`); // Make it look better
|
await utils.ffmpeg(`-i ${output} ${os.tmpdir()}/frame${interaction.id}%04d.png`);
|
||||||
await gifsicle(gifskiOutput, gifsicleOutput); // Optimize it
|
// Make it look better
|
||||||
|
await gifski(gifskiOutput, `${os.tmpdir()}/frame${interaction.id}*`);
|
||||||
|
// Optimize it
|
||||||
|
await gifsicle(gifskiOutput, gifsicleOutput);
|
||||||
|
|
||||||
const fileStat = fs.statSync(gifsicleOutput);
|
const fileStat = fs.statSync(gifsicleOutput);
|
||||||
const fileSize = fileStat.size / 1000000.0;
|
const fileSize = fileStat.size / 1000000.0;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { exec } from 'node:child_process';
|
import { exec } from 'node:child_process';
|
||||||
import https from 'node:https';
|
import https from 'node:https';
|
||||||
import dotenv from 'dotenv'
|
import dotenv from 'dotenv';
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
const { uptimeURL, uptimeInterval } = process.env;
|
const { uptimeURL, uptimeInterval } = process.env;
|
||||||
|
|
||||||
|
|
|
@ -3,5 +3,5 @@ export default {
|
||||||
once: true,
|
once: true,
|
||||||
async execute(error) {
|
async execute(error) {
|
||||||
console.error('Unhandled promise rejection:', error);
|
console.error('Unhandled promise rejection:', error);
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
|
|
4
index.js
4
index.js
|
@ -2,8 +2,8 @@ import fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import { Client, Collection, Intents } from 'discord.js';
|
import { Client, Collection, Intents } from 'discord.js';
|
||||||
import dotenv from 'dotenv'
|
import dotenv from 'dotenv';
|
||||||
dotenv.config()
|
dotenv.config();
|
||||||
const { token } = process.env;
|
const { token } = process.env;
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node .",
|
"start": "node .",
|
||||||
|
"lint": "eslint .",
|
||||||
|
"lintfix": "eslint . --fix",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { exec } from 'node:child_process';
|
||||||
export default {
|
export default {
|
||||||
downloadVideo,
|
downloadVideo,
|
||||||
upload,
|
upload,
|
||||||
ffmpeg
|
ffmpeg,
|
||||||
};
|
};
|
||||||
async function downloadVideo(url, output, format = 'bestvideo*+bestaudio/best') {
|
async function downloadVideo(url, output, format = 'bestvideo*+bestaudio/best') {
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
|
|
Loading…
Reference in a new issue