Port to ESM modules (haha funny), removed cache request, many other changes that I forgot about

This commit is contained in:
Essem 2021-08-19 09:19:14 -05:00
parent 2fe45d842b
commit ae2ebe0337
No known key found for this signature in database
GPG Key ID: 7D497397CC3A2A8C
157 changed files with 1661 additions and 897 deletions

View File

@ -15,7 +15,7 @@
] ]
} }
}, },
"plugins": ["@babel"], "plugins": ["@babel", "unicorn"],
"rules": { "rules": {
"no-console": "off", "no-console": "off",
"indent": [ "indent": [
@ -29,6 +29,7 @@
"error", "error",
"unix" "unix"
], ],
"unicorn/prefer-module": "error",
"quotes": [ "quotes": [
"warn", "warn",
"double" "double"

View File

@ -1,9 +1,12 @@
require("dotenv").config(); import { config } from "dotenv";
const os = require("os"); config();
const { Worker } = require("worker_threads"); import { cpus } from "os";
const path = require("path"); import { Worker } from "worker_threads";
const http = require("http"); import { join } from "path";
const WebSocket = require("ws"); import { createServer } from "http";
import ws from "ws";
import { fileURLToPath } from "url";
import { dirname } from "path";
const start = process.hrtime(); const start = process.hrtime();
const log = (msg, jobNum) => { const log = (msg, jobNum) => {
@ -24,9 +27,9 @@ const jobs = new JobCache();
const queue = []; const queue = [];
// Array of UUIDs // Array of UUIDs
const { v4: uuidv4 } = require("uuid"); import { v4 as uuidv4 } from "uuid";
const MAX_JOBS = process.env.JOBS !== "" && process.env.JOBS !== undefined ? parseInt(process.env.JOBS) : os.cpus().length * 4; // Completely arbitrary, should usually be some multiple of your amount of cores const MAX_JOBS = process.env.JOBS !== "" && process.env.JOBS !== undefined ? parseInt(process.env.JOBS) : cpus().length * 4; // Completely arbitrary, should usually be some multiple of your amount of cores
const PASS = process.env.PASS !== "" && process.env.PASS !== undefined ? process.env.PASS : undefined; const PASS = process.env.PASS !== "" && process.env.PASS !== undefined ? process.env.PASS : undefined;
let jobAmount = 0; let jobAmount = 0;
@ -52,7 +55,7 @@ const acceptJob = (uuid, sock) => {
}); });
}; };
const wss = new WebSocket.Server({ clientTracking: true, noServer: true }); const wss = new ws.Server({ clientTracking: true, noServer: true });
wss.on("connection", (ws, request) => { wss.on("connection", (ws, request) => {
log(`WS client ${request.socket.remoteAddress}:${request.socket.remotePort} has connected`); log(`WS client ${request.socket.remoteAddress}:${request.socket.remotePort} has connected`);
@ -102,7 +105,7 @@ wss.on("error", (err) => {
console.error("A WS error occurred: ", err); console.error("A WS error occurred: ", err);
}); });
const httpServer = http.createServer(); const httpServer = createServer();
httpServer.on("request", async (req, res) => { httpServer.on("request", async (req, res) => {
if (req.method !== "GET") { if (req.method !== "GET") {
@ -192,7 +195,7 @@ const runJob = (job, sock) => {
reject(new TypeError("Unknown image type")); reject(new TypeError("Unknown image type"));
} }
const worker = new Worker(path.join(__dirname, "../utils/image-runner.js"), { const worker = new Worker(join(dirname(fileURLToPath(import.meta.url)), "../utils/image-runner.js"), {
workerData: object workerData: object
}); });
const timeout = setTimeout(() => { const timeout = setTimeout(() => {

28
app.js
View File

@ -3,19 +3,24 @@ Although there's a (very) slim chance of it working, multiple aspects of the bot
The bot will continue to run past this message, but keep in mind that it could break at any time. Continue running at your own risk; alternatively, stop the bot using Ctrl+C and install WSL.` + "\x1b[0m"); The bot will continue to run past this message, but keep in mind that it could break at any time. Continue running at your own risk; alternatively, stop the bot using Ctrl+C and install WSL.` + "\x1b[0m");
// load config from .env file // load config from .env file
require("dotenv").config(); import { config } from "dotenv";
config();
// main sharding manager // main sharding manager
const { Fleet } = require("eris-fleet"); import { Fleet } from "eris-fleet";
const { isMaster } = require("cluster"); import { isMaster } from "cluster";
// some utils // some utils
const path = require("path"); import { join, dirname } from "path";
const winston = require("winston"); import { fileURLToPath } from "url";
import { readFileSync } from "fs";
import winston from "winston";
// dbl posting // dbl posting
const TopGG = require("@top-gg/sdk"); import { Api } from "@top-gg/sdk";
const dbl = process.env.NODE_ENV === "production" && process.env.DBL !== "" ? new TopGG.Api(process.env.DBL) : null; const dbl = process.env.NODE_ENV === "production" && process.env.DBL !== "" ? new Api(process.env.DBL) : null;
if (isMaster) { if (isMaster) {
const esmBotVersion = JSON.parse(readFileSync(new URL("./package.json", import.meta.url))).version;
const erisFleetVersion = JSON.parse(readFileSync(new URL("./node_modules/eris-fleet/package.json", import.meta.url))).version; // a bit of a hacky way to get the eris-fleet version
console.log(` console.log(`
,*\`$ z\`"v ,*\`$ z\`"v
F zBw\`% A ,W "W F zBw\`% A ,W "W
@ -37,13 +42,12 @@ k <BBBw BBBBEBBBBBBBBBBBBBBBBBQ4BM #
*+, " F'"'*^~~~^"^\` V+*^ *+, " F'"'*^~~~^"^\` V+*^
\`""" \`"""
esmBot ${require("./package.json").version}, powered by eris-fleet ${require("./node_modules/eris-fleet/package.json").version} esmBot ${esmBotVersion}, powered by eris-fleet ${erisFleetVersion}
`); `);
// a bit of a hacky way to get the eris-fleet version
} }
const Admiral = new Fleet({ const Admiral = new Fleet({
path: path.join(__dirname, "./shard.js"), path: join(dirname(fileURLToPath(import.meta.url)), "./shard.js"),
token: `Bot ${process.env.TOKEN}`, token: `Bot ${process.env.TOKEN}`,
startingStatus: { startingStatus: {
status: "idle", status: "idle",
@ -99,8 +103,8 @@ const Admiral = new Fleet({
} }
}, },
services: [ services: [
{ name: "prometheus", path: path.join(__dirname, "./utils/services/prometheus.js") }, { name: "prometheus", path: join(dirname(fileURLToPath(import.meta.url)), "./utils/services/prometheus.js") },
{ name: "image", path: path.join(__dirname, "./utils/services/image.js") } { name: "image", path: join(dirname(fileURLToPath(import.meta.url)), "./utils/services/image.js") }
] ]
}); });

View File

@ -32,4 +32,4 @@ class Command {
static requires = []; static requires = [];
} }
module.exports = Command; export default Command;

View File

@ -1,8 +1,9 @@
const Command = require("./command.js"); import Command from "./command.js";
const imageDetect = require("../utils/imagedetect.js"); import imageDetect from "../utils/imagedetect.js";
const collections = require("../utils/collections.js"); import { runningCommands } from "../utils/collections.js";
const { emotes } = require("../messages.json"); import { readFileSync } from "fs";
const { random } = require("../utils/misc.js"); const { emotes } = JSON.parse(readFileSync(new URL("../messages.json", import.meta.url)));
import { random } from "../utils/misc.js";
class ImageCommand extends Command { class ImageCommand extends Command {
/*this.embed = { /*this.embed = {
@ -39,11 +40,11 @@ class ImageCommand extends Command {
async run() { async run() {
// check if this command has already been run in this channel with the same arguments, and we are awaiting its result // check if this command has already been run in this channel with the same arguments, and we are awaiting its result
// if so, don't re-run it // if so, don't re-run it
if (collections.runningCommands.has(this.message.author.id) && (new Date(collections.runningCommands.get(this.message.author.id)) - new Date(this.message.createdAt)) < 5000) { if (runningCommands.has(this.message.author.id) && (new Date(runningCommands.get(this.message.author.id)) - new Date(this.message.createdAt)) < 5000) {
return "Please slow down a bit."; return "Please slow down a bit.";
} }
// before awaiting the command result, add this command to the set of running commands // before awaiting the command result, add this command to the set of running commands
collections.runningCommands.set(this.message.author.id, this.message.createdAt); runningCommands.set(this.message.author.id, this.message.createdAt);
const magickParams = { const magickParams = {
cmd: this.constructor.command cmd: this.constructor.command
@ -53,13 +54,13 @@ class ImageCommand extends Command {
try { try {
const image = await imageDetect(this.client, this.message, true); const image = await imageDetect(this.client, this.message, true);
if (image === undefined) { if (image === undefined) {
collections.runningCommands.delete(this.message.author.id); runningCommands.delete(this.message.author.id);
return this.constructor.noImage; return this.constructor.noImage;
} else if (image.type === "large") { } else if (image.type === "large") {
collections.runningCommands.delete(this.message.author.id); runningCommands.delete(this.message.author.id);
return "That image is too large (>= 25MB)! Try using a smaller image."; return "That image is too large (>= 25MB)! Try using a smaller image.";
} else if (image.type === "tenorlimit") { } else if (image.type === "tenorlimit") {
collections.runningCommands.delete(this.message.author.id); runningCommands.delete(this.message.author.id);
return "I've been rate-limited by Tenor. Please try uploading your GIF elsewhere."; return "I've been rate-limited by Tenor. Please try uploading your GIF elsewhere.";
} }
magickParams.path = image.path; magickParams.path = image.path;
@ -68,7 +69,7 @@ class ImageCommand extends Command {
magickParams.delay = image.delay ? image.delay : 0; magickParams.delay = image.delay ? image.delay : 0;
if (this.constructor.requiresGIF) magickParams.onlyGIF = true; if (this.constructor.requiresGIF) magickParams.onlyGIF = true;
} catch (e) { } catch (e) {
collections.runningCommands.delete(this.message.author.id); runningCommands.delete(this.message.author.id);
throw e; throw e;
} }
@ -76,7 +77,7 @@ class ImageCommand extends Command {
if (this.constructor.requiresText) { if (this.constructor.requiresText) {
if (this.args.length === 0 || !await this.criteria(this.args)) { if (this.args.length === 0 || !await this.criteria(this.args)) {
collections.runningCommands.delete(this.message.author.id); runningCommands.delete(this.message.author.id);
return this.constructor.noText; return this.constructor.noText;
} }
} }
@ -112,7 +113,7 @@ class ImageCommand extends Command {
throw e; throw e;
} finally { } finally {
if (status && await this.client.getMessage(status.channel.id, status.id).catch(() => undefined)) await status.delete(); if (status && await this.client.getMessage(status.channel.id, status.id).catch(() => undefined)) await status.delete();
collections.runningCommands.delete(this.message.author.id); runningCommands.delete(this.message.author.id);
} }
} }
@ -129,4 +130,4 @@ class ImageCommand extends Command {
static command = ""; static command = "";
} }
module.exports = ImageCommand; export default ImageCommand;

View File

@ -1,13 +1,13 @@
const Command = require("./command.js"); import Command from "./command.js";
const soundPlayer = require("../utils/soundplayer.js"); import { players } from "../utils/soundplayer.js";
class MusicCommand extends Command { class MusicCommand extends Command {
constructor(client, cluster, worker, ipc, message, args, content, specialArgs) { constructor(client, cluster, worker, ipc, message, args, content, specialArgs) {
super(client, cluster, worker, ipc, message, args, content, specialArgs); super(client, cluster, worker, ipc, message, args, content, specialArgs);
this.connection = soundPlayer.players.get(message.channel.guild.id); this.connection = players.get(message.channel.guild.id);
} }
static requires = ["sound"]; static requires = ["sound"];
} }
module.exports = MusicCommand; export default MusicCommand;

View File

@ -1,5 +1,5 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
const { random } = require("../../utils/misc.js"); import { random } from "../../utils/misc.js";
class EightBallCommand extends Command { class EightBallCommand extends Command {
static responses = [ static responses = [
@ -34,4 +34,4 @@ class EightBallCommand extends Command {
static arguments = ["{text}"]; static arguments = ["{text}"];
} }
module.exports = EightBallCommand; export default EightBallCommand;

View File

@ -1,5 +1,5 @@
const fetch = require("node-fetch"); import fetch from "node-fetch";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class AncientCommand extends Command { class AncientCommand extends Command {
async run() { async run() {
@ -30,4 +30,4 @@ class AncientCommand extends Command {
static aliases = ["old", "oldmeme", "badmeme"]; static aliases = ["old", "oldmeme", "badmeme"];
} }
module.exports = AncientCommand; export default AncientCommand;

View File

@ -1,5 +1,5 @@
const fetch = require("node-fetch"); import fetch from "node-fetch";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class BirdCommand extends Command { class BirdCommand extends Command {
async run() { async run() {
@ -20,4 +20,4 @@ class BirdCommand extends Command {
static aliases = ["birb", "birds", "birbs"]; static aliases = ["birb", "birds", "birbs"];
} }
module.exports = BirdCommand; export default BirdCommand;

View File

@ -1,5 +1,5 @@
const fetch = require("node-fetch"); import fetch from "node-fetch";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class CatCommand extends Command { class CatCommand extends Command {
async run() { async run() {
@ -31,4 +31,4 @@ class CatCommand extends Command {
static aliases = ["kitters", "kitties", "kitty", "cattos", "catto", "cats", "cta"]; static aliases = ["kitters", "kitties", "kitty", "cattos", "catto", "cats", "cta"];
} }
module.exports = CatCommand; export default CatCommand;

View File

@ -1,6 +1,6 @@
const cowsay = require("cowsay2"); import { say } from "cowsay2";
const cows = require("cowsay2/cows"); import cows from "cowsay2/cows/index.js";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class CowsayCommand extends Command { class CowsayCommand extends Command {
async run() { async run() {
@ -8,9 +8,9 @@ class CowsayCommand extends Command {
return "You need to provide some text for the cow to say!"; return "You need to provide some text for the cow to say!";
} else if (cows[this.args[0].toLowerCase()] != undefined) { } else if (cows[this.args[0].toLowerCase()] != undefined) {
const cow = cows[this.args.shift().toLowerCase()]; const cow = cows[this.args.shift().toLowerCase()];
return `\`\`\`\n${cowsay.say(this.args.join(" "), { cow })}\n\`\`\``; return `\`\`\`\n${say(this.args.join(" "), { cow })}\n\`\`\``;
} else { } else {
return `\`\`\`\n${cowsay.say(this.args.join(" "))}\n\`\`\``; return `\`\`\`\n${say(this.args.join(" "))}\n\`\`\``;
} }
} }
@ -19,4 +19,4 @@ class CowsayCommand extends Command {
static arguments = ["{cow}", "[text]"]; static arguments = ["{cow}", "[text]"];
} }
module.exports = CowsayCommand; export default CowsayCommand;

View File

@ -1,4 +1,4 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class DiceCommand extends Command { class DiceCommand extends Command {
async run() { async run() {
@ -14,4 +14,4 @@ class DiceCommand extends Command {
static arguments = ["{number}"]; static arguments = ["{number}"];
} }
module.exports = DiceCommand; export default DiceCommand;

View File

@ -1,5 +1,5 @@
const fetch = require("node-fetch"); import fetch from "node-fetch";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class DogCommand extends Command { class DogCommand extends Command {
async run() { async run() {
@ -20,4 +20,4 @@ class DogCommand extends Command {
static aliases = ["doggos", "doggo", "pupper", "puppers", "dogs", "puppy", "puppies", "pups", "pup"]; static aliases = ["doggos", "doggo", "pupper", "puppers", "dogs", "puppy", "puppies", "pups", "pup"];
} }
module.exports = DogCommand; export default DogCommand;

View File

@ -1,4 +1,4 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class FullwidthCommand extends Command { class FullwidthCommand extends Command {
async run() { async run() {
@ -11,4 +11,4 @@ class FullwidthCommand extends Command {
static arguments = ["[text]"]; static arguments = ["[text]"];
} }
module.exports = FullwidthCommand; export default FullwidthCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class HomebrewCommand extends ImageCommand { class HomebrewCommand extends ImageCommand {
params() { params() {
@ -17,4 +17,4 @@ class HomebrewCommand extends ImageCommand {
static command = "homebrew"; static command = "homebrew";
} }
module.exports = HomebrewCommand; export default HomebrewCommand;

View File

@ -1,5 +1,5 @@
const fetch = require("node-fetch"); import fetch from "node-fetch";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class MCCommand extends Command { class MCCommand extends Command {
async run() { async run() {
@ -17,4 +17,4 @@ class MCCommand extends Command {
static arguments = ["[text]"]; static arguments = ["[text]"];
} }
module.exports = MCCommand; export default MCCommand;

View File

@ -1,5 +1,5 @@
const wrap = require("../../utils/wrap.js"); import wrap from "../../utils/wrap.js";
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class RetroCommand extends ImageCommand { class RetroCommand extends ImageCommand {
params() { params() {
@ -29,4 +29,4 @@ class RetroCommand extends ImageCommand {
static command = "retro"; static command = "retro";
} }
module.exports = RetroCommand; export default RetroCommand;

View File

@ -1,12 +1,12 @@
const misc = require("../../utils/misc.js"); import { random } from "../../utils/misc.js";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class RPSCommand extends Command { class RPSCommand extends Command {
async run() { async run() {
if (this.args.length === 0 || (this.args[0] !== "rock" && this.args[0] !== "paper" && this.args[0] !== "scissors")) return "You need to choose whether you want to be rock, paper, or scissors!"; if (this.args.length === 0 || (this.args[0] !== "rock" && this.args[0] !== "paper" && this.args[0] !== "scissors")) return "You need to choose whether you want to be rock, paper, or scissors!";
let emoji; let emoji;
let winOrLose; let winOrLose;
const result = misc.random(["rock", "paper", "scissors"]); const result = random(["rock", "paper", "scissors"]);
switch (result) { switch (result) {
case "rock": case "rock":
emoji = "✊"; emoji = "✊";
@ -31,4 +31,4 @@ class RPSCommand extends Command {
static arguments = ["[rock/paper/scissors]"]; static arguments = ["[rock/paper/scissors]"];
} }
module.exports = RPSCommand; export default RPSCommand;

View File

@ -1,5 +1,5 @@
const wrap = require("../../utils/wrap.js"); import wrap from "../../utils/wrap.js";
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class SonicCommand extends ImageCommand { class SonicCommand extends ImageCommand {
params() { params() {
@ -18,4 +18,4 @@ class SonicCommand extends ImageCommand {
static command = "sonic"; static command = "sonic";
} }
module.exports = SonicCommand; export default SonicCommand;

View File

@ -1,5 +1,5 @@
const fetch = require("node-fetch"); import fetch from "node-fetch";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class WikihowCommand extends Command { class WikihowCommand extends Command {
async run() { async run() {
@ -25,4 +25,4 @@ class WikihowCommand extends Command {
static requires = ["mashape"]; static requires = ["mashape"];
} }
module.exports = WikihowCommand; export default WikihowCommand;

View File

@ -1,5 +1,5 @@
const fetch = require("node-fetch"); import fetch from "node-fetch";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class XKCDCommand extends Command { class XKCDCommand extends Command {
async run() { async run() {
@ -28,4 +28,4 @@ class XKCDCommand extends Command {
static arguments = ["{id}"]; static arguments = ["{id}"];
} }
module.exports = XKCDCommand; export default XKCDCommand;

View File

@ -1,4 +1,4 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class AvatarCommand extends Command { class AvatarCommand extends Command {
async run() { async run() {
@ -23,4 +23,4 @@ class AvatarCommand extends Command {
static arguments = ["{mention/id}"]; static arguments = ["{mention/id}"];
} }
module.exports = AvatarCommand; export default AvatarCommand;

View File

@ -1,4 +1,4 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class BroadcastCommand extends Command { class BroadcastCommand extends Command {
// yet another very hacky command // yet another very hacky command
@ -24,4 +24,4 @@ class BroadcastCommand extends Command {
static description = "Broadcasts a playing message until the command is run again or the bot restarts"; static description = "Broadcasts a playing message until the command is run again or the bot restarts";
} }
module.exports = BroadcastCommand; export default BroadcastCommand;

View File

@ -1,5 +1,5 @@
const db = require("../../utils/database.js"); import db from "../../utils/database.js";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class ChannelCommand extends Command { class ChannelCommand extends Command {
async run() { async run() {
@ -43,4 +43,4 @@ class ChannelCommand extends Command {
static arguments = ["[enable/disable]", "{id}"]; static arguments = ["[enable/disable]", "{id}"];
} }
module.exports = ChannelCommand; export default ChannelCommand;

View File

@ -1,6 +1,6 @@
const db = require("../../utils/database.js"); import db from "../../utils/database.js";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
const collections = require("../../utils/collections.js"); import * as collections from "../../utils/collections.js";
class CommandCommand extends Command { class CommandCommand extends Command {
async run() { async run() {
@ -35,4 +35,4 @@ class CommandCommand extends Command {
static arguments = ["[enable/disable]", "[command]"]; static arguments = ["[enable/disable]", "[command]"];
} }
module.exports = CommandCommand; export default CommandCommand;

View File

@ -1,6 +1,6 @@
const paginator = require("../../utils/pagination/pagination.js"); import paginator from "../../utils/pagination/pagination.js";
const database = require("../../utils/database.js"); import database from "../../utils/database.js";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class CountCommand extends Command { class CountCommand extends Command {
async run() { async run() {
@ -46,4 +46,4 @@ class CountCommand extends Command {
static arguments = ["{mention/id}"]; static arguments = ["{mention/id}"];
} }
module.exports = CountCommand; export default CountCommand;

View File

@ -1,5 +1,5 @@
const { clean } = require("../../utils/misc.js"); import { clean } from "../../utils/misc.js";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class DecodeCommand extends Command { class DecodeCommand extends Command {
async run() { async run() {
@ -13,4 +13,4 @@ class DecodeCommand extends Command {
static arguments = ["[text]"]; static arguments = ["[text]"];
} }
module.exports = DecodeCommand; export default DecodeCommand;

View File

@ -1,5 +1,5 @@
const fetch = require("node-fetch"); import fetch from "node-fetch";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class DonateCommand extends Command { class DonateCommand extends Command {
async run() { async run() {
@ -27,4 +27,4 @@ class DonateCommand extends Command {
static aliases = ["support", "patreon", "patrons"]; static aliases = ["support", "patreon", "patrons"];
} }
module.exports = DonateCommand; export default DonateCommand;

View File

@ -1,5 +1,5 @@
const emojiRegex = require("emoji-regex"); import emojiRegex from "emoji-regex";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class EmoteCommand extends Command { class EmoteCommand extends Command {
async run() { async run() {
@ -22,4 +22,4 @@ class EmoteCommand extends Command {
static arguments = ["[emote]"]; static arguments = ["[emote]"];
} }
module.exports = EmoteCommand; export default EmoteCommand;

View File

@ -1,4 +1,4 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class EncodeCommand extends Command { class EncodeCommand extends Command {
async run() { async run() {
@ -12,4 +12,4 @@ class EncodeCommand extends Command {
static arguments = ["[text]"]; static arguments = ["[text]"];
} }
module.exports = EncodeCommand; export default EncodeCommand;

View File

@ -1,5 +1,5 @@
const { clean } = require("../../utils/misc.js"); import { clean } from "../../utils/misc.js";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class EvalCommand extends Command { class EvalCommand extends Command {
async run() { async run() {
@ -28,4 +28,4 @@ class EvalCommand extends Command {
static arguments = ["[code]"]; static arguments = ["[code]"];
} }
module.exports = EvalCommand; export default EvalCommand;

View File

@ -1,5 +1,5 @@
const { clean } = require("../../utils/misc.js"); import { clean } from "../../utils/misc.js";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class EvalRawCommand extends Command { class EvalRawCommand extends Command {
async run() { async run() {
@ -26,4 +26,4 @@ class EvalRawCommand extends Command {
static arguments = ["[code]"]; static arguments = ["[code]"];
} }
module.exports = EvalRawCommand; export default EvalRawCommand;

View File

@ -1,7 +1,8 @@
const { clean } = require("../../utils/misc.js"); import { clean } from "../../utils/misc.js";
const util = require("util"); import * as util from "util";
const exec = util.promisify(require("child_process").exec); import { exec as baseExec } from "child_process";
const Command = require("../../classes/command.js"); const exec = util.promisify(baseExec);
import Command from "../../classes/command.js";
class ExecCommand extends Command { class ExecCommand extends Command {
async run() { async run() {
@ -31,4 +32,4 @@ class ExecCommand extends Command {
static arguments = ["[command]"]; static arguments = ["[command]"];
} }
module.exports = ExecCommand; export default ExecCommand;

View File

@ -1,10 +1,10 @@
const database = require("../../utils/database.js"); import database from "../../utils/database.js";
const collections = require("../../utils/collections.js"); import * as collections from "../../utils/collections.js";
const misc = require("../../utils/misc.js"); import { random } from "../../utils/misc.js";
const paginator = require("../../utils/pagination/pagination.js"); import paginator from "../../utils/pagination/pagination.js";
const help = require("../../utils/help.js"); import * as help from "../../utils/help.js";
const tips = ["You can change the bot's prefix using the prefix command.", "Image commands also work with images previously posted in that channel.", "You can use the tags commands to save things for later use.", "You can visit https://projectlounge.pw/esmBot/help.html for a web version of this command list.", "You can view a command's aliases by putting the command name after the help command (e.g. help image).", "Parameters wrapped in [] are required, while parameters wrapped in {} are optional.", "esmBot is hosted and paid for completely out-of-pocket by the main developer. If you want to support development, please consider donating! https://patreon.com/TheEssem"]; import Command from "../../classes/command.js";
const Command = require("../../classes/command.js"); const tips = ["You can change the bot's prefix using the prefix command.", "Image commands also work with images previously posted in that channel.", "You can use the tags commands to save things for later use.", "You can visit https://projectlounge.pw/esmBot/help.html for a web version of this command list.", "You can view a command's aliases by putting the command name after the help command (e.g. help image).", "Parameters wrapped in [] are required, while parameters wrapped in {} are optional.", "esmBot is hosted and paid for completely out-of-pocket by the main developer. If you want to support development, please consider donating! https://patreon.com/TheEssem", "You can run commands in DMs as well, just message the bot with your command - no prefix needed!"];
class HelpCommand extends Command { class HelpCommand extends Command {
async run() { async run() {
@ -89,7 +89,7 @@ class HelpCommand extends Command {
"value": this.message.channel.guild ? prefix : "N/A" "value": this.message.channel.guild ? prefix : "N/A"
}, { }, {
"name": "Tip", "name": "Tip",
"value": misc.random(tips) "value": random(tips)
}] }]
} }
}); });
@ -103,4 +103,4 @@ class HelpCommand extends Command {
static arguments = ["{command}"]; static arguments = ["{command}"];
} }
module.exports = HelpCommand; export default HelpCommand;

View File

@ -1,8 +1,9 @@
const paginator = require("../../utils/pagination/pagination.js"); import paginator from "../../utils/pagination/pagination.js";
const { searx } = require("../../servers.json"); import { readFileSync } from "fs";
const { random } = require("../../utils/misc.js"); const { searx } = JSON.parse(readFileSync(new URL("../../servers.json", import.meta.url)));
const fetch = require("node-fetch"); import { random } from "../../utils/misc.js";
const Command = require("../../classes/command.js"); import fetch from "node-fetch";
import Command from "../../classes/command.js";
class ImageSearchCommand extends Command { class ImageSearchCommand extends Command {
async run() { async run() {
@ -40,4 +41,4 @@ class ImageSearchCommand extends Command {
static arguments = ["[query]"]; static arguments = ["[query]"];
} }
module.exports = ImageSearchCommand; export default ImageSearchCommand;

View File

@ -1,4 +1,4 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class ImageReloadCommand extends Command { class ImageReloadCommand extends Command {
async run() { async run() {
@ -15,4 +15,4 @@ class ImageReloadCommand extends Command {
static aliases = ["magickconnect", "magick"]; static aliases = ["magickconnect", "magick"];
} }
module.exports = ImageReloadCommand; export default ImageReloadCommand;

View File

@ -1,4 +1,4 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class ImageStatsCommand extends Command { class ImageStatsCommand extends Command {
async run() { async run() {
@ -28,4 +28,4 @@ class ImageStatsCommand extends Command {
static aliases = ["imgstat", "imstats", "imgstats", "imstat"]; static aliases = ["imgstat", "imstats", "imgstats", "imstat"];
} }
module.exports = ImageStatsCommand; export default ImageStatsCommand;

View File

@ -1,5 +1,6 @@
const { version } = require("../../package.json"); import { readFileSync } from "fs";
const Command = require("../../classes/command.js"); const { version } = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url)));
import Command from "../../classes/command.js";
class InfoCommand extends Command { class InfoCommand extends Command {
async run() { async run() {
@ -46,4 +47,4 @@ class InfoCommand extends Command {
static aliases = ["botinfo", "credits"]; static aliases = ["botinfo", "credits"];
} }
module.exports = InfoCommand; export default InfoCommand;

View File

@ -1,4 +1,4 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class InviteCommand extends Command { class InviteCommand extends Command {
async run() { async run() {
@ -9,4 +9,4 @@ class InviteCommand extends Command {
static aliases = ["botinfo", "credits"]; static aliases = ["botinfo", "credits"];
} }
module.exports = InviteCommand; export default InviteCommand;

View File

@ -1,6 +1,6 @@
const urlCheck = require("../../utils/urlcheck.js"); import urlCheck from "../../utils/urlcheck.js";
const fetch = require("node-fetch"); import fetch from "node-fetch";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class LengthenCommand extends Command { class LengthenCommand extends Command {
async run() { async run() {
@ -19,4 +19,4 @@ class LengthenCommand extends Command {
static arguments = ["[url]"]; static arguments = ["[url]"];
} }
module.exports = LengthenCommand; export default LengthenCommand;

View File

@ -1,4 +1,4 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class PingCommand extends Command { class PingCommand extends Command {
async run() { async run() {
@ -12,4 +12,4 @@ class PingCommand extends Command {
static aliases = ["pong"]; static aliases = ["pong"];
} }
module.exports = PingCommand; export default PingCommand;

View File

@ -1,5 +1,5 @@
const database = require("../../utils/database.js"); import database from "../../utils/database.js";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class PrefixCommand extends Command { class PrefixCommand extends Command {
async run() { async run() {
@ -19,4 +19,4 @@ class PrefixCommand extends Command {
static arguments = ["{prefix}"]; static arguments = ["{prefix}"];
} }
module.exports = PrefixCommand; export default PrefixCommand;

View File

@ -1,12 +1,12 @@
const qrcode = require("qrcode"); import qrcode from "qrcode";
const stream = require("stream"); import { PassThrough } from "stream";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class QrCreateCommand extends Command { class QrCreateCommand extends Command {
async run() { async run() {
if (this.args.length === 0) return "You need to provide some text to generate a QR code!"; if (this.args.length === 0) return "You need to provide some text to generate a QR code!";
this.client.sendChannelTyping(this.message.channel.id); this.client.sendChannelTyping(this.message.channel.id);
const writable = new stream.PassThrough(); const writable = new PassThrough();
qrcode.toFileStream(writable, this.content, { margin: 1 }); qrcode.toFileStream(writable, this.content, { margin: 1 });
const file = await this.streamToBuf(writable); const file = await this.streamToBuf(writable);
return { return {
@ -34,4 +34,4 @@ class QrCreateCommand extends Command {
static arguments = ["[text]"]; static arguments = ["[text]"];
} }
module.exports = QrCreateCommand; export default QrCreateCommand;

View File

@ -1,12 +1,13 @@
const jsqr = require("jsqr"); import jsqr from "jsqr";
const fetch = require("node-fetch"); import fetch from "node-fetch";
const sharp = require("sharp"); import sharp from "sharp";
const { clean } = require("../../utils/misc.js"); import { clean } from "../../utils/misc.js";
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
import imageDetect from "../../utils/imagedetect.js";
class QrReadCommand extends Command { class QrReadCommand extends Command {
async run() { async run() {
const image = await require("../../utils/imagedetect.js")(this.client, this.message); const image = await imageDetect(this.client, this.message);
if (image === undefined) return "You need to provide an image with a QR code to read!"; if (image === undefined) return "You need to provide an image with a QR code to read!";
this.client.sendChannelTyping(this.message.channel.id); this.client.sendChannelTyping(this.message.channel.id);
const data = await (await fetch(image.path)).buffer(); const data = await (await fetch(image.path)).buffer();
@ -19,4 +20,4 @@ class QrReadCommand extends Command {
static description = "Reads a QR code"; static description = "Reads a QR code";
} }
module.exports = QrReadCommand; export default QrReadCommand;

View File

@ -1,5 +1,5 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
const imageDetect = require("../../utils/imagedetect.js"); import imageDetect from "../../utils/imagedetect.js";
class RawCommand extends Command { class RawCommand extends Command {
async run() { async run() {
@ -13,4 +13,4 @@ class RawCommand extends Command {
static aliases = ["gif", "getgif", "giflink", "imglink", "getimg", "rawgif", "rawimg"]; static aliases = ["gif", "getgif", "giflink", "imglink", "getimg", "rawgif", "rawimg"];
} }
module.exports = RawCommand; export default RawCommand;

View File

@ -1,4 +1,4 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class ReloadCommand extends Command { class ReloadCommand extends Command {
// quite possibly one of the hackiest commands in the bot // quite possibly one of the hackiest commands in the bot
@ -24,4 +24,4 @@ class ReloadCommand extends Command {
static arguments = ["[command]"]; static arguments = ["[command]"];
} }
module.exports = ReloadCommand; export default ReloadCommand;

View File

@ -1,6 +1,4 @@
const handler = require("../../utils/handler.js"); import Command from "../../classes/command.js";
const collections = require("../../utils/collections.js");
const Command = require("../../classes/command.js");
class RestartCommand extends Command { class RestartCommand extends Command {
async run() { async run() {
@ -8,9 +6,6 @@ class RestartCommand extends Command {
await this.client.createMessage(this.message.channel.id, Object.assign({ await this.client.createMessage(this.message.channel.id, Object.assign({
content: "esmBot is restarting." content: "esmBot is restarting."
}, this.reference)); }, this.reference));
for (const command of collections.commands) {
await handler.unload(command);
}
this.ipc.restartAllClusters(true); this.ipc.restartAllClusters(true);
//this.ipc.broadcast("restart"); //this.ipc.broadcast("restart");
} }
@ -19,4 +14,4 @@ class RestartCommand extends Command {
static aliases = ["reboot"]; static aliases = ["reboot"];
} }
module.exports = RestartCommand; export default RestartCommand;

View File

@ -1,4 +1,4 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class ServerInfoCommand extends Command { class ServerInfoCommand extends Command {
async run() { async run() {
@ -49,4 +49,4 @@ class ServerInfoCommand extends Command {
static aliases = ["server"]; static aliases = ["server"];
} }
module.exports = ServerInfoCommand; export default ServerInfoCommand;

View File

@ -1,4 +1,4 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class SnowflakeCommand extends Command { class SnowflakeCommand extends Command {
async run() { async run() {
@ -12,4 +12,4 @@ class SnowflakeCommand extends Command {
static arguments = ["[id]"]; static arguments = ["[id]"];
} }
module.exports = SnowflakeCommand; export default SnowflakeCommand;

View File

@ -1,4 +1,4 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class SoundReloadCommand extends Command { class SoundReloadCommand extends Command {
// another very hacky command // another very hacky command
@ -24,4 +24,4 @@ class SoundReloadCommand extends Command {
static aliases = ["lava", "lavalink", "lavaconnect", "soundconnect"]; static aliases = ["lava", "lavalink", "lavaconnect", "soundconnect"];
} }
module.exports = SoundReloadCommand; export default SoundReloadCommand;

View File

@ -1,6 +1,8 @@
const { version } = require("../../package.json"); import { readFileSync } from "fs";
const os = require("os"); const { version } = JSON.parse(readFileSync(new URL("../../package.json", import.meta.url)));
const Command = require("../../classes/command.js"); import os from "os";
import Command from "../../classes/command.js";
import { VERSION } from "eris";
class StatsCommand extends Command { class StatsCommand extends Command {
async run() { async run() {
@ -44,7 +46,7 @@ class StatsCommand extends Command {
}, },
{ {
"name": "Library", "name": "Library",
"value": `Eris ${require("eris").VERSION}`, "value": `Eris ${VERSION}`,
"inline": true "inline": true
}, },
{ {
@ -81,4 +83,4 @@ class StatsCommand extends Command {
static aliases = ["status", "stat"]; static aliases = ["status", "stat"];
} }
module.exports = StatsCommand; export default StatsCommand;

View File

@ -1,4 +1,4 @@
const Command = require("../../classes/command.js"); import Command from "../../classes/command.js";
class UserInfoCommand extends Command { class UserInfoCommand extends Command {
async run() { async run() {
@ -54,4 +54,4 @@ class UserInfoCommand extends Command {
static arguments = ["[mention/id]"]; static arguments = ["[mention/id]"];
} }
module.exports = UserInfoCommand; export default UserInfoCommand;

View File

@ -1,8 +1,9 @@
const fetch = require("node-fetch"); import fetch from "node-fetch";
const { searx } = require("../../servers.json"); import { readFileSync } from "fs";
const { random } = require("../../utils/misc.js"); const { searx } = JSON.parse(readFileSync(new URL("../../servers.json", import.meta.url)));
const paginator = require("../../utils/pagination/pagination.js"); import { random } from "../../utils/misc.js";
const Command = require("../../classes/command.js"); import paginator from "../../utils/pagination/pagination.js";
import Command from "../../classes/command.js";
class YouTubeCommand extends Command { class YouTubeCommand extends Command {
async run() { async run() {
@ -22,4 +23,4 @@ class YouTubeCommand extends Command {
static arguments = ["[query]"]; static arguments = ["[query]"];
} }
module.exports = YouTubeCommand; export default YouTubeCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class NineGagCommand extends ImageCommand { class NineGagCommand extends ImageCommand {
params = { params = {
@ -13,4 +13,4 @@ class NineGagCommand extends ImageCommand {
static command = "watermark"; static command = "watermark";
} }
module.exports = NineGagCommand; export default NineGagCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class BandicamCommand extends ImageCommand { class BandicamCommand extends ImageCommand {
params = { params = {
@ -14,4 +14,4 @@ class BandicamCommand extends ImageCommand {
static command = "watermark"; static command = "watermark";
} }
module.exports = BandicamCommand; export default BandicamCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class BlurCommand extends ImageCommand { class BlurCommand extends ImageCommand {
params = { params = {
@ -11,4 +11,4 @@ class BlurCommand extends ImageCommand {
static command = "blur"; static command = "blur";
} }
module.exports = BlurCommand; export default BlurCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class BlurpleCommand extends ImageCommand { class BlurpleCommand extends ImageCommand {
params() { params() {
@ -18,4 +18,4 @@ class BlurpleCommand extends ImageCommand {
static aliases = ["blurp"]; static aliases = ["blurp"];
} }
module.exports = BlurpleCommand; export default BlurpleCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
const allowedFonts = ["futura", "impact", "helvetica", "arial", "roboto", "noto"]; const allowedFonts = ["futura", "impact", "helvetica", "arial", "roboto", "noto"];
class CaptionCommand extends ImageCommand { class CaptionCommand extends ImageCommand {
@ -30,4 +30,4 @@ class CaptionCommand extends ImageCommand {
static command = "caption"; static command = "caption";
} }
module.exports = CaptionCommand; export default CaptionCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
const words = ["me irl", "dank", "follow my second account @esmBot_", "2016", "meme", "wholesome", "reddit", "instagram", "twitter", "facebook", "fortnite", "minecraft", "relatable", "gold", "funny", "template", "hilarious", "memes", "deep fried", "2020", "leafy", "pewdiepie"]; const words = ["me irl", "dank", "follow my second account @esmBot_", "2016", "meme", "wholesome", "reddit", "instagram", "twitter", "facebook", "fortnite", "minecraft", "relatable", "gold", "funny", "template", "hilarious", "memes", "deep fried", "2020", "leafy", "pewdiepie"];
class CaptionTwoCommand extends ImageCommand { class CaptionTwoCommand extends ImageCommand {
@ -23,4 +23,4 @@ class CaptionTwoCommand extends ImageCommand {
static command = "captionTwo"; static command = "captionTwo";
} }
module.exports = CaptionTwoCommand; export default CaptionTwoCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class CircleCommand extends ImageCommand { class CircleCommand extends ImageCommand {
static description = "Applies a radial blur effect on an image"; static description = "Applies a radial blur effect on an image";
@ -8,4 +8,4 @@ class CircleCommand extends ImageCommand {
static command = "circle"; static command = "circle";
} }
module.exports = CircleCommand; export default CircleCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class CropCommand extends ImageCommand { class CropCommand extends ImageCommand {
static description = "Crops an image to 1:1"; static description = "Crops an image to 1:1";
@ -7,4 +7,4 @@ class CropCommand extends ImageCommand {
static command = "crop"; static command = "crop";
} }
module.exports = CropCommand; export default CropCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class DeepfryCommand extends ImageCommand { class DeepfryCommand extends ImageCommand {
static description = "Deep-fries an image"; static description = "Deep-fries an image";
@ -8,4 +8,4 @@ class DeepfryCommand extends ImageCommand {
static command = "deepfry"; static command = "deepfry";
} }
module.exports = DeepfryCommand; export default DeepfryCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class DeviantArtCommand extends ImageCommand { class DeviantArtCommand extends ImageCommand {
params = { params = {
@ -14,4 +14,4 @@ class DeviantArtCommand extends ImageCommand {
static command = "watermark"; static command = "watermark";
} }
module.exports = DeviantArtCommand; export default DeviantArtCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class ExplodeCommand extends ImageCommand { class ExplodeCommand extends ImageCommand {
params = { params = {
@ -12,4 +12,4 @@ class ExplodeCommand extends ImageCommand {
static command = "explode"; static command = "explode";
} }
module.exports = ExplodeCommand; export default ExplodeCommand;

View File

@ -1,7 +1,7 @@
const fs = require("fs"); import fs from "fs";
const emojiRegex = require("emoji-regex"); import emojiRegex from "emoji-regex";
const emoji = require("node-emoji"); import emoji from "node-emoji";
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class FlagCommand extends ImageCommand { class FlagCommand extends ImageCommand {
flagPath = ""; flagPath = "";
@ -38,4 +38,4 @@ class FlagCommand extends ImageCommand {
static command = "flag"; static command = "flag";
} }
module.exports = FlagCommand; export default FlagCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class FlipCommand extends ImageCommand { class FlipCommand extends ImageCommand {
static description = "Flips an image"; static description = "Flips an image";
@ -7,4 +7,4 @@ class FlipCommand extends ImageCommand {
static command = "flip"; static command = "flip";
} }
module.exports = FlipCommand; export default FlipCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class FlopCommand extends ImageCommand { class FlopCommand extends ImageCommand {
params = { params = {
@ -12,4 +12,4 @@ class FlopCommand extends ImageCommand {
static command = "flip"; static command = "flip";
} }
module.exports = FlopCommand; export default FlopCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class FreezeCommand extends ImageCommand { class FreezeCommand extends ImageCommand {
params() { params() {
@ -18,4 +18,4 @@ class FreezeCommand extends ImageCommand {
static command = "freeze"; static command = "freeze";
} }
module.exports = FreezeCommand; export default FreezeCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class FunkyCommand extends ImageCommand { class FunkyCommand extends ImageCommand {
params = { params = {
@ -14,4 +14,4 @@ class FunkyCommand extends ImageCommand {
static command = "watermark"; static command = "watermark";
} }
module.exports = FunkyCommand; export default FunkyCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class GameXplainCommand extends ImageCommand { class GameXplainCommand extends ImageCommand {
static description = "Makes a GameXplain thumbnail from an image"; static description = "Makes a GameXplain thumbnail from an image";
@ -8,4 +8,4 @@ class GameXplainCommand extends ImageCommand {
static command = "gamexplain"; static command = "gamexplain";
} }
module.exports = GameXplainCommand; export default GameXplainCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class GlobeCommand extends ImageCommand { class GlobeCommand extends ImageCommand {
static description = "Spins an image"; static description = "Spins an image";
@ -8,4 +8,4 @@ class GlobeCommand extends ImageCommand {
static command = "globe"; static command = "globe";
} }
module.exports = GlobeCommand; export default GlobeCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class HaaHCommand extends ImageCommand { class HaaHCommand extends ImageCommand {
params = { params = {
@ -12,4 +12,4 @@ class HaaHCommand extends ImageCommand {
static command = "mirror"; static command = "mirror";
} }
module.exports = HaaHCommand; export default HaaHCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class HooHCommand extends ImageCommand { class HooHCommand extends ImageCommand {
params = { params = {
@ -12,4 +12,4 @@ class HooHCommand extends ImageCommand {
static command = "mirror"; static command = "mirror";
} }
module.exports = HooHCommand; export default HooHCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class HypercamCommand extends ImageCommand { class HypercamCommand extends ImageCommand {
params = { params = {
@ -14,4 +14,4 @@ class HypercamCommand extends ImageCommand {
static command = "watermark"; static command = "watermark";
} }
module.exports = HypercamCommand; export default HypercamCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class iFunnyCommand extends ImageCommand { class iFunnyCommand extends ImageCommand {
params = { params = {
@ -14,4 +14,4 @@ class iFunnyCommand extends ImageCommand {
static command = "watermark"; static command = "watermark";
} }
module.exports = iFunnyCommand; export default iFunnyCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class ImplodeCommand extends ImageCommand { class ImplodeCommand extends ImageCommand {
params = { params = {
@ -12,4 +12,4 @@ class ImplodeCommand extends ImageCommand {
static command = "explode"; static command = "explode";
} }
module.exports = ImplodeCommand; export default ImplodeCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class InvertCommand extends ImageCommand { class InvertCommand extends ImageCommand {
static description = "Inverts an image"; static description = "Inverts an image";
@ -8,4 +8,4 @@ class InvertCommand extends ImageCommand {
static command = "invert"; static command = "invert";
} }
module.exports = InvertCommand; export default InvertCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class JPEGCommand extends ImageCommand { class JPEGCommand extends ImageCommand {
static description = "Adds max JPEG compression to an image"; static description = "Adds max JPEG compression to an image";
@ -8,4 +8,4 @@ class JPEGCommand extends ImageCommand {
static command = "jpeg"; static command = "jpeg";
} }
module.exports = JPEGCommand; export default JPEGCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class KineMasterCommand extends ImageCommand { class KineMasterCommand extends ImageCommand {
params = { params = {
@ -14,4 +14,4 @@ class KineMasterCommand extends ImageCommand {
static command = "watermark"; static command = "watermark";
} }
module.exports = KineMasterCommand; export default KineMasterCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class LeakCommand extends ImageCommand { class LeakCommand extends ImageCommand {
static description = "Creates a fake Smash leak thumbnail"; static description = "Creates a fake Smash leak thumbnail";
@ -8,4 +8,4 @@ class LeakCommand extends ImageCommand {
static command = "leak"; static command = "leak";
} }
module.exports = LeakCommand; export default LeakCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class MagikCommand extends ImageCommand { class MagikCommand extends ImageCommand {
static description = "Adds a content aware scale effect to an image"; static description = "Adds a content aware scale effect to an image";
@ -8,4 +8,4 @@ class MagikCommand extends ImageCommand {
static command = "magik"; static command = "magik";
} }
module.exports = MagikCommand; export default MagikCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class MemeCommand extends ImageCommand { class MemeCommand extends ImageCommand {
params(url) { params(url) {
@ -19,4 +19,4 @@ class MemeCommand extends ImageCommand {
static command = "meme"; static command = "meme";
} }
module.exports = MemeCommand; export default MemeCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class MemeCenterCommand extends ImageCommand { class MemeCenterCommand extends ImageCommand {
params = { params = {
@ -14,4 +14,4 @@ class MemeCenterCommand extends ImageCommand {
static command = "watermark"; static command = "watermark";
} }
module.exports = MemeCenterCommand; export default MemeCenterCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class MotivateCommand extends ImageCommand { class MotivateCommand extends ImageCommand {
params(url) { params(url) {
@ -20,4 +20,4 @@ class MotivateCommand extends ImageCommand {
static command = "motivate"; static command = "motivate";
} }
module.exports = MotivateCommand; export default MotivateCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class PixelateCommand extends ImageCommand { class PixelateCommand extends ImageCommand {
static description = "Pixelates an image"; static description = "Pixelates an image";
@ -8,4 +8,4 @@ class PixelateCommand extends ImageCommand {
static command = "resize"; static command = "resize";
} }
module.exports = PixelateCommand; export default PixelateCommand;

View File

@ -1,5 +1,5 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
const { random } = require("../../utils/misc.js"); import { random } from "../../utils/misc.js";
const names = ["esmBot", "me_irl", "dankmemes", "hmmm", "gaming", "wholesome", "chonkers", "memes", "funny", "pcmasterrace", "bellybros"]; const names = ["esmBot", "me_irl", "dankmemes", "hmmm", "gaming", "wholesome", "chonkers", "memes", "funny", "pcmasterrace", "bellybros"];
class RedditCommand extends ImageCommand { class RedditCommand extends ImageCommand {
@ -16,4 +16,4 @@ class RedditCommand extends ImageCommand {
static command = "reddit"; static command = "reddit";
} }
module.exports = RedditCommand; export default RedditCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class ReverseCommand extends ImageCommand { class ReverseCommand extends ImageCommand {
params(url, delay) { params(url, delay) {
@ -15,4 +15,4 @@ class ReverseCommand extends ImageCommand {
static command = "reverse"; static command = "reverse";
} }
module.exports = ReverseCommand; export default ReverseCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class ScottCommand extends ImageCommand { class ScottCommand extends ImageCommand {
static description = "Makes Scott the Woz show off an image"; static description = "Makes Scott the Woz show off an image";
@ -8,4 +8,4 @@ class ScottCommand extends ImageCommand {
static command = "scott"; static command = "scott";
} }
module.exports = ScottCommand; export default ScottCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class SharpenCommand extends ImageCommand { class SharpenCommand extends ImageCommand {
params = { params = {
@ -12,4 +12,4 @@ class SharpenCommand extends ImageCommand {
static command = "blur"; static command = "blur";
} }
module.exports = SharpenCommand; export default SharpenCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class ShutterstockCommand extends ImageCommand { class ShutterstockCommand extends ImageCommand {
params = { params = {
@ -14,4 +14,4 @@ class ShutterstockCommand extends ImageCommand {
static command = "watermark"; static command = "watermark";
} }
module.exports = ShutterstockCommand; export default ShutterstockCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class SlowCommand extends ImageCommand { class SlowCommand extends ImageCommand {
params() { params() {
@ -18,4 +18,4 @@ class SlowCommand extends ImageCommand {
static command = "speed"; static command = "speed";
} }
module.exports = SlowCommand; export default SlowCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class SnapchatCommand extends ImageCommand { class SnapchatCommand extends ImageCommand {
params(url) { params(url) {
@ -25,4 +25,4 @@ class SnapchatCommand extends ImageCommand {
static command = "snapchat"; static command = "snapchat";
} }
module.exports = SnapchatCommand; export default SnapchatCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class SooSCommand extends ImageCommand { class SooSCommand extends ImageCommand {
params(url, delay) { params(url, delay) {
@ -16,4 +16,4 @@ class SooSCommand extends ImageCommand {
static command = "reverse"; static command = "reverse";
} }
module.exports = SooSCommand; export default SooSCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class SpeedCommand extends ImageCommand { class SpeedCommand extends ImageCommand {
params() { params() {
@ -17,4 +17,4 @@ class SpeedCommand extends ImageCommand {
static command = "speed"; static command = "speed";
} }
module.exports = SpeedCommand; export default SpeedCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class SpinCommand extends ImageCommand { class SpinCommand extends ImageCommand {
static description = "Spins an image"; static description = "Spins an image";
@ -8,4 +8,4 @@ class SpinCommand extends ImageCommand {
static command = "spin"; static command = "spin";
} }
module.exports = SpinCommand; export default SpinCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class StretchCommand extends ImageCommand { class StretchCommand extends ImageCommand {
params = { params = {
@ -12,4 +12,4 @@ class StretchCommand extends ImageCommand {
static command = "resize"; static command = "resize";
} }
module.exports = StretchCommand; export default StretchCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class SwirlCommand extends ImageCommand { class SwirlCommand extends ImageCommand {
static description = "Swirls an image"; static description = "Swirls an image";
@ -8,4 +8,4 @@ class SwirlCommand extends ImageCommand {
static command = "swirl"; static command = "swirl";
} }
module.exports = SwirlCommand; export default SwirlCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class TileCommand extends ImageCommand { class TileCommand extends ImageCommand {
static description = "Creates a tile pattern from an image"; static description = "Creates a tile pattern from an image";
@ -8,4 +8,4 @@ class TileCommand extends ImageCommand {
static command = "tile"; static command = "tile";
} }
module.exports = TileCommand; export default TileCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class TrumpCommand extends ImageCommand { class TrumpCommand extends ImageCommand {
static description = "Makes Trump display an image"; static description = "Makes Trump display an image";
@ -7,4 +7,4 @@ class TrumpCommand extends ImageCommand {
static command = "trump"; static command = "trump";
} }
module.exports = TrumpCommand; export default TrumpCommand;

View File

@ -1,4 +1,4 @@
const ImageCommand = require("../../classes/imageCommand.js"); import ImageCommand from "../../classes/imageCommand.js";
class UncaptionCommand extends ImageCommand { class UncaptionCommand extends ImageCommand {
static description = "Removes the caption from an image"; static description = "Removes the caption from an image";
@ -7,4 +7,4 @@ class UncaptionCommand extends ImageCommand {
static command = "uncaption"; static command = "uncaption";
} }
module.exports = UncaptionCommand; export default UncaptionCommand;

Some files were not shown because too many files have changed in this diff Show More