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": {
"no-console": "off",
"indent": [
@ -29,6 +29,7 @@
"error",
"unix"
],
"unicorn/prefer-module": "error",
"quotes": [
"warn",
"double"

View file

@ -1,9 +1,12 @@
require("dotenv").config();
const os = require("os");
const { Worker } = require("worker_threads");
const path = require("path");
const http = require("http");
const WebSocket = require("ws");
import { config } from "dotenv";
config();
import { cpus } from "os";
import { Worker } from "worker_threads";
import { join } from "path";
import { createServer } from "http";
import ws from "ws";
import { fileURLToPath } from "url";
import { dirname } from "path";
const start = process.hrtime();
const log = (msg, jobNum) => {
@ -24,9 +27,9 @@ const jobs = new JobCache();
const queue = [];
// 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;
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) => {
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);
});
const httpServer = http.createServer();
const httpServer = createServer();
httpServer.on("request", async (req, res) => {
if (req.method !== "GET") {
@ -192,7 +195,7 @@ const runJob = (job, sock) => {
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
});
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");
// load config from .env file
require("dotenv").config();
import { config } from "dotenv";
config();
// main sharding manager
const { Fleet } = require("eris-fleet");
const { isMaster } = require("cluster");
import { Fleet } from "eris-fleet";
import { isMaster } from "cluster";
// some utils
const path = require("path");
const winston = require("winston");
import { join, dirname } from "path";
import { fileURLToPath } from "url";
import { readFileSync } from "fs";
import winston from "winston";
// dbl posting
const TopGG = require("@top-gg/sdk");
const dbl = process.env.NODE_ENV === "production" && process.env.DBL !== "" ? new TopGG.Api(process.env.DBL) : null;
import { Api } from "@top-gg/sdk";
const dbl = process.env.NODE_ENV === "production" && process.env.DBL !== "" ? new Api(process.env.DBL) : null;
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(`
,*\`$ z\`"v
F zBw\`% A ,W "W
@ -37,13 +42,12 @@ k <BBBw BBBBEBBBBBBBBBBBBBBBBBQ4BM #
*+, " 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({
path: path.join(__dirname, "./shard.js"),
path: join(dirname(fileURLToPath(import.meta.url)), "./shard.js"),
token: `Bot ${process.env.TOKEN}`,
startingStatus: {
status: "idle",
@ -99,8 +103,8 @@ const Admiral = new Fleet({
}
},
services: [
{ name: "prometheus", path: path.join(__dirname, "./utils/services/prometheus.js") },
{ name: "image", path: path.join(__dirname, "./utils/services/image.js") }
{ name: "prometheus", path: join(dirname(fileURLToPath(import.meta.url)), "./utils/services/prometheus.js") },
{ name: "image", path: join(dirname(fileURLToPath(import.meta.url)), "./utils/services/image.js") }
]
});

View file

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

View file

@ -1,8 +1,9 @@
const Command = require("./command.js");
const imageDetect = require("../utils/imagedetect.js");
const collections = require("../utils/collections.js");
const { emotes } = require("../messages.json");
const { random } = require("../utils/misc.js");
import Command from "./command.js";
import imageDetect from "../utils/imagedetect.js";
import { runningCommands } from "../utils/collections.js";
import { readFileSync } from "fs";
const { emotes } = JSON.parse(readFileSync(new URL("../messages.json", import.meta.url)));
import { random } from "../utils/misc.js";
class ImageCommand extends Command {
/*this.embed = {
@ -39,11 +40,11 @@ class ImageCommand extends Command {
async run() {
// 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 (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.";
}
// 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 = {
cmd: this.constructor.command
@ -53,13 +54,13 @@ class ImageCommand extends Command {
try {
const image = await imageDetect(this.client, this.message, true);
if (image === undefined) {
collections.runningCommands.delete(this.message.author.id);
runningCommands.delete(this.message.author.id);
return this.constructor.noImage;
} 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.";
} 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.";
}
magickParams.path = image.path;
@ -68,7 +69,7 @@ class ImageCommand extends Command {
magickParams.delay = image.delay ? image.delay : 0;
if (this.constructor.requiresGIF) magickParams.onlyGIF = true;
} catch (e) {
collections.runningCommands.delete(this.message.author.id);
runningCommands.delete(this.message.author.id);
throw e;
}
@ -76,7 +77,7 @@ class ImageCommand extends Command {
if (this.constructor.requiresText) {
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;
}
}
@ -112,7 +113,7 @@ class ImageCommand extends Command {
throw e;
} finally {
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 = "";
}
module.exports = ImageCommand;
export default ImageCommand;

View file

@ -1,13 +1,13 @@
const Command = require("./command.js");
const soundPlayer = require("../utils/soundplayer.js");
import Command from "./command.js";
import { players } from "../utils/soundplayer.js";
class MusicCommand extends Command {
constructor(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"];
}
module.exports = MusicCommand;
export default MusicCommand;

View file

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

View file

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

View file

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

View file

@ -1,5 +1,5 @@
const fetch = require("node-fetch");
const Command = require("../../classes/command.js");
import fetch from "node-fetch";
import Command from "../../classes/command.js";
class CatCommand extends Command {
async run() {
@ -31,4 +31,4 @@ class CatCommand extends Command {
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");
const cows = require("cowsay2/cows");
const Command = require("../../classes/command.js");
import { say } from "cowsay2";
import cows from "cowsay2/cows/index.js";
import Command from "../../classes/command.js";
class CowsayCommand extends Command {
async run() {
@ -8,9 +8,9 @@ class CowsayCommand extends Command {
return "You need to provide some text for the cow to say!";
} else if (cows[this.args[0].toLowerCase()] != undefined) {
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 {
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]"];
}
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 {
async run() {
@ -14,4 +14,4 @@ class DiceCommand extends Command {
static arguments = ["{number}"];
}
module.exports = DiceCommand;
export default DiceCommand;

View file

@ -1,5 +1,5 @@
const fetch = require("node-fetch");
const Command = require("../../classes/command.js");
import fetch from "node-fetch";
import Command from "../../classes/command.js";
class DogCommand extends Command {
async run() {
@ -20,4 +20,4 @@ class DogCommand extends Command {
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 {
async run() {
@ -11,4 +11,4 @@ class FullwidthCommand extends Command {
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 {
params() {
@ -17,4 +17,4 @@ class HomebrewCommand extends ImageCommand {
static command = "homebrew";
}
module.exports = HomebrewCommand;
export default HomebrewCommand;

View file

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

View file

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

View file

@ -1,12 +1,12 @@
const misc = require("../../utils/misc.js");
const Command = require("../../classes/command.js");
import { random } from "../../utils/misc.js";
import Command from "../../classes/command.js";
class RPSCommand extends Command {
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!";
let emoji;
let winOrLose;
const result = misc.random(["rock", "paper", "scissors"]);
const result = random(["rock", "paper", "scissors"]);
switch (result) {
case "rock":
emoji = "✊";
@ -31,4 +31,4 @@ class RPSCommand extends Command {
static arguments = ["[rock/paper/scissors]"];
}
module.exports = RPSCommand;
export default RPSCommand;

View file

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

View file

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

View file

@ -1,5 +1,5 @@
const fetch = require("node-fetch");
const Command = require("../../classes/command.js");
import fetch from "node-fetch";
import Command from "../../classes/command.js";
class XKCDCommand extends Command {
async run() {
@ -28,4 +28,4 @@ class XKCDCommand extends Command {
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 {
async run() {
@ -23,4 +23,4 @@ class AvatarCommand extends Command {
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 {
// 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";
}
module.exports = BroadcastCommand;
export default BroadcastCommand;

View file

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

View file

@ -1,6 +1,6 @@
const db = require("../../utils/database.js");
const Command = require("../../classes/command.js");
const collections = require("../../utils/collections.js");
import db from "../../utils/database.js";
import Command from "../../classes/command.js";
import * as collections from "../../utils/collections.js";
class CommandCommand extends Command {
async run() {
@ -35,4 +35,4 @@ class CommandCommand extends 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");
const database = require("../../utils/database.js");
const Command = require("../../classes/command.js");
import paginator from "../../utils/pagination/pagination.js";
import database from "../../utils/database.js";
import Command from "../../classes/command.js";
class CountCommand extends Command {
async run() {
@ -46,4 +46,4 @@ class CountCommand extends Command {
static arguments = ["{mention/id}"];
}
module.exports = CountCommand;
export default CountCommand;

View file

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

View file

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

View file

@ -1,5 +1,5 @@
const emojiRegex = require("emoji-regex");
const Command = require("../../classes/command.js");
import emojiRegex from "emoji-regex";
import Command from "../../classes/command.js";
class EmoteCommand extends Command {
async run() {
@ -22,4 +22,4 @@ class EmoteCommand extends Command {
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 {
async run() {
@ -12,4 +12,4 @@ class EncodeCommand extends Command {
static arguments = ["[text]"];
}
module.exports = EncodeCommand;
export default EncodeCommand;

View file

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

View file

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

View file

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

View file

@ -1,10 +1,10 @@
const database = require("../../utils/database.js");
const collections = require("../../utils/collections.js");
const misc = require("../../utils/misc.js");
const paginator = require("../../utils/pagination/pagination.js");
const help = require("../../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"];
const Command = require("../../classes/command.js");
import database from "../../utils/database.js";
import * as collections from "../../utils/collections.js";
import { random } from "../../utils/misc.js";
import paginator from "../../utils/pagination/pagination.js";
import * as help from "../../utils/help.js";
import Command from "../../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 {
async run() {
@ -89,7 +89,7 @@ class HelpCommand extends Command {
"value": this.message.channel.guild ? prefix : "N/A"
}, {
"name": "Tip",
"value": misc.random(tips)
"value": random(tips)
}]
}
});
@ -103,4 +103,4 @@ class HelpCommand extends Command {
static arguments = ["{command}"];
}
module.exports = HelpCommand;
export default HelpCommand;

View file

@ -1,8 +1,9 @@
const paginator = require("../../utils/pagination/pagination.js");
const { searx } = require("../../servers.json");
const { random } = require("../../utils/misc.js");
const fetch = require("node-fetch");
const Command = require("../../classes/command.js");
import paginator from "../../utils/pagination/pagination.js";
import { readFileSync } from "fs";
const { searx } = JSON.parse(readFileSync(new URL("../../servers.json", import.meta.url)));
import { random } from "../../utils/misc.js";
import fetch from "node-fetch";
import Command from "../../classes/command.js";
class ImageSearchCommand extends Command {
async run() {
@ -40,4 +41,4 @@ class ImageSearchCommand extends Command {
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 {
async run() {
@ -15,4 +15,4 @@ class ImageReloadCommand extends Command {
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 {
async run() {
@ -28,4 +28,4 @@ class ImageStatsCommand extends Command {
static aliases = ["imgstat", "imstats", "imgstats", "imstat"];
}
module.exports = ImageStatsCommand;
export default ImageStatsCommand;

View file

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

View file

@ -1,6 +1,6 @@
const urlCheck = require("../../utils/urlcheck.js");
const fetch = require("node-fetch");
const Command = require("../../classes/command.js");
import urlCheck from "../../utils/urlcheck.js";
import fetch from "node-fetch";
import Command from "../../classes/command.js";
class LengthenCommand extends Command {
async run() {
@ -19,4 +19,4 @@ class LengthenCommand extends Command {
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 {
async run() {
@ -12,4 +12,4 @@ class PingCommand extends Command {
static aliases = ["pong"];
}
module.exports = PingCommand;
export default PingCommand;

View file

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

View file

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

View file

@ -1,12 +1,13 @@
const jsqr = require("jsqr");
const fetch = require("node-fetch");
const sharp = require("sharp");
const { clean } = require("../../utils/misc.js");
const Command = require("../../classes/command.js");
import jsqr from "jsqr";
import fetch from "node-fetch";
import sharp from "sharp";
import { clean } from "../../utils/misc.js";
import Command from "../../classes/command.js";
import imageDetect from "../../utils/imagedetect.js";
class QrReadCommand extends Command {
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!";
this.client.sendChannelTyping(this.message.channel.id);
const data = await (await fetch(image.path)).buffer();
@ -19,4 +20,4 @@ class QrReadCommand extends Command {
static description = "Reads a QR code";
}
module.exports = QrReadCommand;
export default QrReadCommand;

View file

@ -1,5 +1,5 @@
const Command = require("../../classes/command.js");
const imageDetect = require("../../utils/imagedetect.js");
import Command from "../../classes/command.js";
import imageDetect from "../../utils/imagedetect.js";
class RawCommand extends Command {
async run() {
@ -13,4 +13,4 @@ class RawCommand extends Command {
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 {
// quite possibly one of the hackiest commands in the bot
@ -24,4 +24,4 @@ class ReloadCommand extends Command {
static arguments = ["[command]"];
}
module.exports = ReloadCommand;
export default ReloadCommand;

View file

@ -1,6 +1,4 @@
const handler = require("../../utils/handler.js");
const collections = require("../../utils/collections.js");
const Command = require("../../classes/command.js");
import Command from "../../classes/command.js";
class RestartCommand extends Command {
async run() {
@ -8,9 +6,6 @@ class RestartCommand extends Command {
await this.client.createMessage(this.message.channel.id, Object.assign({
content: "esmBot is restarting."
}, this.reference));
for (const command of collections.commands) {
await handler.unload(command);
}
this.ipc.restartAllClusters(true);
//this.ipc.broadcast("restart");
}
@ -19,4 +14,4 @@ class RestartCommand extends Command {
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 {
async run() {
@ -49,4 +49,4 @@ class ServerInfoCommand extends Command {
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 {
async run() {
@ -12,4 +12,4 @@ class SnowflakeCommand extends Command {
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 {
// another very hacky command
@ -24,4 +24,4 @@ class SoundReloadCommand extends Command {
static aliases = ["lava", "lavalink", "lavaconnect", "soundconnect"];
}
module.exports = SoundReloadCommand;
export default SoundReloadCommand;

View file

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

View file

@ -1,8 +1,9 @@
const fetch = require("node-fetch");
const { searx } = require("../../servers.json");
const { random } = require("../../utils/misc.js");
const paginator = require("../../utils/pagination/pagination.js");
const Command = require("../../classes/command.js");
import fetch from "node-fetch";
import { readFileSync } from "fs";
const { searx } = JSON.parse(readFileSync(new URL("../../servers.json", import.meta.url)));
import { random } from "../../utils/misc.js";
import paginator from "../../utils/pagination/pagination.js";
import Command from "../../classes/command.js";
class YouTubeCommand extends Command {
async run() {
@ -22,4 +23,4 @@ class YouTubeCommand extends Command {
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 {
params = {
@ -13,4 +13,4 @@ class NineGagCommand extends ImageCommand {
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 {
params = {
@ -14,4 +14,4 @@ class BandicamCommand extends ImageCommand {
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 {
params = {
@ -11,4 +11,4 @@ class BlurCommand extends ImageCommand {
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 {
params() {
@ -18,4 +18,4 @@ class BlurpleCommand extends ImageCommand {
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"];
class CaptionCommand extends ImageCommand {
@ -30,4 +30,4 @@ class CaptionCommand extends ImageCommand {
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"];
class CaptionTwoCommand extends ImageCommand {
@ -23,4 +23,4 @@ class CaptionTwoCommand extends ImageCommand {
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 {
static description = "Applies a radial blur effect on an image";
@ -8,4 +8,4 @@ class CircleCommand extends ImageCommand {
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 {
static description = "Crops an image to 1:1";
@ -7,4 +7,4 @@ class CropCommand extends ImageCommand {
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 {
static description = "Deep-fries an image";
@ -8,4 +8,4 @@ class DeepfryCommand extends ImageCommand {
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 {
params = {
@ -14,4 +14,4 @@ class DeviantArtCommand extends ImageCommand {
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 {
params = {
@ -12,4 +12,4 @@ class ExplodeCommand extends ImageCommand {
static command = "explode";
}
module.exports = ExplodeCommand;
export default ExplodeCommand;

View file

@ -1,7 +1,7 @@
const fs = require("fs");
const emojiRegex = require("emoji-regex");
const emoji = require("node-emoji");
const ImageCommand = require("../../classes/imageCommand.js");
import fs from "fs";
import emojiRegex from "emoji-regex";
import emoji from "node-emoji";
import ImageCommand from "../../classes/imageCommand.js";
class FlagCommand extends ImageCommand {
flagPath = "";
@ -38,4 +38,4 @@ class FlagCommand extends ImageCommand {
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 {
static description = "Flips an image";
@ -7,4 +7,4 @@ class FlipCommand extends ImageCommand {
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 {
params = {
@ -12,4 +12,4 @@ class FlopCommand extends ImageCommand {
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 {
params() {
@ -18,4 +18,4 @@ class FreezeCommand extends ImageCommand {
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 {
params = {
@ -14,4 +14,4 @@ class FunkyCommand extends ImageCommand {
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 {
static description = "Makes a GameXplain thumbnail from an image";
@ -8,4 +8,4 @@ class GameXplainCommand extends ImageCommand {
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 {
static description = "Spins an image";
@ -8,4 +8,4 @@ class GlobeCommand extends ImageCommand {
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 {
params = {
@ -12,4 +12,4 @@ class HaaHCommand extends ImageCommand {
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 {
params = {
@ -12,4 +12,4 @@ class HooHCommand extends ImageCommand {
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 {
params = {
@ -14,4 +14,4 @@ class HypercamCommand extends ImageCommand {
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 {
params = {
@ -14,4 +14,4 @@ class iFunnyCommand extends ImageCommand {
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 {
params = {
@ -12,4 +12,4 @@ class ImplodeCommand extends ImageCommand {
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 {
static description = "Inverts an image";
@ -8,4 +8,4 @@ class InvertCommand extends ImageCommand {
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 {
static description = "Adds max JPEG compression to an image";
@ -8,4 +8,4 @@ class JPEGCommand extends ImageCommand {
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 {
params = {
@ -14,4 +14,4 @@ class KineMasterCommand extends ImageCommand {
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 {
static description = "Creates a fake Smash leak thumbnail";
@ -8,4 +8,4 @@ class LeakCommand extends ImageCommand {
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 {
static description = "Adds a content aware scale effect to an image";
@ -8,4 +8,4 @@ class MagikCommand extends ImageCommand {
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 {
params(url) {
@ -19,4 +19,4 @@ class MemeCommand extends ImageCommand {
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 {
params = {
@ -14,4 +14,4 @@ class MemeCenterCommand extends ImageCommand {
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 {
params(url) {
@ -20,4 +20,4 @@ class MotivateCommand extends ImageCommand {
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 {
static description = "Pixelates an image";
@ -8,4 +8,4 @@ class PixelateCommand extends ImageCommand {
static command = "resize";
}
module.exports = PixelateCommand;
export default PixelateCommand;

View file

@ -1,5 +1,5 @@
const ImageCommand = require("../../classes/imageCommand.js");
const { random } = require("../../utils/misc.js");
import ImageCommand from "../../classes/imageCommand.js";
import { random } from "../../utils/misc.js";
const names = ["esmBot", "me_irl", "dankmemes", "hmmm", "gaming", "wholesome", "chonkers", "memes", "funny", "pcmasterrace", "bellybros"];
class RedditCommand extends ImageCommand {
@ -16,4 +16,4 @@ class RedditCommand extends ImageCommand {
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 {
params(url, delay) {
@ -15,4 +15,4 @@ class ReverseCommand extends ImageCommand {
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 {
static description = "Makes Scott the Woz show off an image";
@ -8,4 +8,4 @@ class ScottCommand extends ImageCommand {
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 {
params = {
@ -12,4 +12,4 @@ class SharpenCommand extends ImageCommand {
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 {
params = {
@ -14,4 +14,4 @@ class ShutterstockCommand extends ImageCommand {
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 {
params() {
@ -18,4 +18,4 @@ class SlowCommand extends ImageCommand {
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 {
params(url) {
@ -25,4 +25,4 @@ class SnapchatCommand extends ImageCommand {
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 {
params(url, delay) {
@ -16,4 +16,4 @@ class SooSCommand extends ImageCommand {
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 {
params() {
@ -17,4 +17,4 @@ class SpeedCommand extends ImageCommand {
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 {
static description = "Spins an image";
@ -8,4 +8,4 @@ class SpinCommand extends ImageCommand {
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 {
params = {
@ -12,4 +12,4 @@ class StretchCommand extends ImageCommand {
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 {
static description = "Swirls an image";
@ -8,4 +8,4 @@ class SwirlCommand extends ImageCommand {
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 {
static description = "Creates a tile pattern from an image";
@ -8,4 +8,4 @@ class TileCommand extends ImageCommand {
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 {
static description = "Makes Trump display an image";
@ -7,4 +7,4 @@ class TrumpCommand extends ImageCommand {
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 {
static description = "Removes the caption from an image";
@ -7,4 +7,4 @@ class UncaptionCommand extends ImageCommand {
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