removed discord and voice-specifc cmds

This commit is contained in:
murm 2023-03-17 02:21:02 -04:00
parent e8fc08d83a
commit 5786714505
5 changed files with 0 additions and 212 deletions

View file

@ -1,33 +0,0 @@
import emojiRegex from "emoji-regex";
import Command from "../../classes/command.js";
class EmoteCommand extends Command {
async run() {
const emoji = this.options.emoji ?? this.content;
if (emoji && emoji.trim() && emoji.split(" ")[0].match(/^<a?:.+:\d+>$/)) {
return `https://cdn.discordapp.com/emojis/${emoji.split(" ")[0].replace(/^<(a)?:.+:(\d+)>$/, "$2")}.${emoji.split(" ")[0].replace(/^<(a)?:.+:(\d+)>$/, "$1") === "a" ? "gif" : "png"}`;
} else if (emoji.match(emojiRegex())) {
const codePoints = [];
for (const codePoint of emoji) {
codePoints.push(codePoint.codePointAt(0).toString(16));
}
return `https://twemoji.maxcdn.com/v/latest/72x72/${codePoints.join("-").replace("-fe0f", "")}.png`;
} else {
this.success = false;
return "You need to provide a valid emoji to get an image!";
}
}
static flags = [{
name: "emoji",
type: 3,
description: "The emoji you want to get",
required: true
}];
static description = "Gets a raw emote image";
static aliases = ["e", "em", "hugemoji", "hugeemoji", "emoji"];
static arguments = ["[emote]"];
}
export default EmoteCommand;

View file

@ -1,20 +0,0 @@
import Command from "../../classes/command.js";
class SnowflakeCommand extends Command {
async run() {
this.success = false;
if (!this.args[0]) return "You need to provide a snowflake ID!";
if (!this.args[0].match(/^<?[@#]?[&!]?\d+>?$/) && this.args[0] < 21154535154122752n) return "That's not a valid snowflake!";
const id = Math.floor(((this.args[0].replaceAll("@", "").replaceAll("#", "").replaceAll("!", "").replaceAll("&", "").replaceAll("<", "").replaceAll(">", "") / 4194304) + 1420070400000) / 1000);
if (isNaN(id)) return "That's not a valid snowflake!";
this.success = true;
return `<t:${id}:F>`;
}
static description = "Converts a Discord snowflake id into a timestamp";
static aliases = ["timestamp", "snowstamp", "snow"];
static arguments = ["[id]"];
static slashAllowed = false;
}
export default SnowflakeCommand;

View file

@ -1,33 +0,0 @@
import Command from "../../classes/command.js";
import { reload } from "../../utils/soundplayer.js";
class SoundReloadCommand extends Command {
async run() {
const owners = process.env.OWNER.split(",");
if (!owners.includes(this.author)) {
this.success = false;
return "Only the bot owner can reload Lavalink!";
}
// await this.acknowledge();
const length = await reload();
if (process.env.PM2_USAGE) {
process.send({
type: "process:msg",
data: {
type: "soundreload"
}
});
}
if (length) {
return `Successfully connected to ${length} Lavalink node(s).`;
} else {
return "I couldn't connect to any Lavalink nodes!";
}
}
static description = "Attempts to reconnect to all available Lavalink nodes";
static aliases = ["lava", "lavalink", "lavaconnect", "soundconnect"];
static adminOnly = true;
}
export default SoundReloadCommand;

View file

@ -1,90 +0,0 @@
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 "oceanic.js";
import pm2 from "pm2";
import { getServers } from "../../utils/misc.js";
class StatsCommand extends Command {
async run() {
const uptime = process.uptime() * 1000;
const connUptime = this.client.uptime;
let owner = this.client.users.get(process.env.OWNER.split(",")[0]);
if (!owner) owner = await this.client.rest.users.get(process.env.OWNER.split(",")[0]);
const servers = await getServers(this.client);
const processMem = `${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB`;
return {
embeds: [{
"author": {
"name": "esmBot Statistics",
"iconURL": this.client.user.avatarURL()
},
"description": `This instance is managed by **${owner.username}#${owner.discriminator}**.`,
"color": 16711680,
"fields": [{
"name": "Version",
"value": `v${version}${process.env.NODE_ENV === "development" ? `-dev (${process.env.GIT_REV})` : ""}`
},
{
"name": "Process Memory Usage",
"value": processMem,
"inline": true
},
{
"name": "Total Memory Usage",
"value": process.env.PM2_USAGE ? `${((await this.list()).reduce((prev, cur) => prev + cur.monit.memory, 0) / 1024 / 1024).toFixed(2)} MB` : processMem,
"inline": true
},
{
"name": "Bot Uptime",
"value": `${Math.trunc(uptime / 86400000)} days, ${Math.trunc(uptime / 3600000) % 24} hrs, ${Math.trunc(uptime / 60000) % 60} mins, ${Math.trunc(uptime / 1000) % 60} secs`
},
{
"name": "Connection Uptime",
"value": `${Math.trunc(connUptime / 86400000)} days, ${Math.trunc(connUptime / 3600000) % 24} hrs, ${Math.trunc(connUptime / 60000) % 60} mins, ${Math.trunc(connUptime / 1000) % 60} secs`
},
{
"name": "Host",
"value": `${os.type()} ${os.release()} (${os.arch()})`,
"inline": true
},
{
"name": "Library",
"value": `Oceanic ${VERSION}`,
"inline": true
},
{
"name": "Node.js Version",
"value": process.version,
"inline": true
},
{
"name": "Shard",
"value": this.guild ? this.client.guildShardMap[this.guild.id] : "N/A",
"inline": true
},
{
"name": "Servers",
"value": servers ? servers : `${this.client.guilds.size} (for this process only)`,
"inline": true
}
]
}]
};
}
list() {
return new Promise((resolve, reject) => {
pm2.list((err, list) => {
if (err) return reject(err);
resolve(list.filter((v) => v.name.includes("esmBot-proc")));
});
});
}
static description = "Gets some statistics about me";
static aliases = ["status", "stat"];
}
export default StatsCommand;

View file

@ -1,36 +0,0 @@
import Command from "../../classes/command.js";
import imagedetect from "../../utils/imagedetect.js";
class StickerCommand extends Command {
async run() {
const result = await imagedetect(this.client, this.message, this.interaction, this.options, false, false, true);
this.success = false;
if (!result) return "You need to provide a sticker!";
if (result.format_type === 1) { // PNG
this.success = true;
return `https://cdn.discordapp.com/stickers/${result.id}.png`;
} else if (result.format_type === 2) { // APNG
this.success = true;
return {
embeds: [{
color: 16711680,
description: `[This sticker is an APNG; however, since Discord doesn't allow displaying APNGs outside of stickers, you'll have to save it or open it in your browser to view it.](https://cdn.discordapp.com/stickers/${result.id}.png)`,
image: {
url: `https://cdn.discordapp.com/stickers/${result.id}.png`
}
}]
};
} else if (result.format_type === 3) { // Lottie
this.success = true;
return `I can't display this sticker because it uses the Lottie animation format; however, I can give you the raw JSON link to it: https://cdn.discordapp.com/stickers/${result.id}.json`;
} else {
return "I don't recognize that sticker format!";
}
}
static description = "Gets a raw sticker image";
static aliases = ["stick"];
static arguments = ["[sticker]"];
}
export default StickerCommand;