Compare commits
3 commits
de714b78ff
...
1a510b61d0
Author | SHA1 | Date | |
---|---|---|---|
|
1a510b61d0 | ||
|
5786714505 | ||
|
e8fc08d83a |
8 changed files with 3 additions and 166 deletions
|
@ -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;
|
|
|
@ -9,7 +9,7 @@ import Command from "../../classes/command.js";
|
||||||
|
|
||||||
class HelpCommand extends Command {
|
class HelpCommand extends Command {
|
||||||
async run() {
|
async run() {
|
||||||
return "https://esmbot.net/help.html"
|
return { html: "<h1>There are no mrmBot Docs Yet</h1>In the meantime, please refer to https://esmbot.net/help.html" };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,49 +5,8 @@ import { getServers } from "../../utils/misc.js";
|
||||||
|
|
||||||
class InfoCommand extends Command {
|
class InfoCommand extends Command {
|
||||||
async run() {
|
async run() {
|
||||||
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);
|
|
||||||
// await this.acknowledge();
|
// await this.acknowledge();
|
||||||
return {
|
return { html: `<h1>mrmBot Info/Credits</h1>This instance is managed by <b>${process.env.OWNER.split(",")[0]}</b>.<br>v${version}-mrm (${process.env.GIT_REV})<br>Bot by <a href="https://essem.space"><font color="#FF0000"><i>Essem</i></font></a> and <a href="https://github.com/esmBot/esmBot/graphs/contributors"><i>other contributors</i></a>.<br>Fork by <a href="https://murm.gay"><font color="#18FF00"><b>Murm</b></font></a>.` };
|
||||||
embeds: [{
|
|
||||||
color: 16711680,
|
|
||||||
author: {
|
|
||||||
name: "esmBot Info/Credits",
|
|
||||||
iconURL: this.client.user.avatarURL()
|
|
||||||
},
|
|
||||||
description: `This instance is managed by **${owner.username}#${owner.discriminator}**.`,
|
|
||||||
fields: [{
|
|
||||||
name: "ℹ️ Version:",
|
|
||||||
value: `v${version}${process.env.NODE_ENV === "development" ? `-dev (${process.env.GIT_REV})` : ""}`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "📝 Credits:",
|
|
||||||
value: "Bot by **[Essem](https://essem.space)** and **[various contributors](https://github.com/esmBot/esmBot/graphs/contributors)**\nLogo by **[MintBurrow](https://twitter.com/MintBurrow)**"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "💬 Total Servers:",
|
|
||||||
value: servers ? servers : `${this.client.guilds.size} (for this process only)`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "✅ Official Server:",
|
|
||||||
value: "[Click here!](https://esmbot.net/support)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "💻 Source Code:",
|
|
||||||
value: "[Click here!](https://github.com/esmBot/esmBot)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "🛡️ Privacy Policy:",
|
|
||||||
value: "[Click here!](https://esmbot.net/privacy.html)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "🐘 Mastodon:",
|
|
||||||
value: "[Click here!](https://wetdry.world/@esmBot)"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static description = "Gets some info and credits about me";
|
static description = "Gets some info and credits about me";
|
||||||
|
|
|
@ -22,7 +22,7 @@ class ReloadCommand extends Command {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return `The command \`${commandName}\` has been reloaded.`;
|
return{ html: `The command <code>${commandName}</code> has been reloaded.` };
|
||||||
}
|
}
|
||||||
|
|
||||||
static flags = [{
|
static flags = [{
|
||||||
|
|
|
@ -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;
|
|
|
@ -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;
|
|
|
@ -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;
|
|
Loading…
Reference in a new issue