Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit 17bb5a9

Browse files
committed
feat: use new core (eris)
1 parent db909b3 commit 17bb5a9

11 files changed

+4836
-3003
lines changed

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@eazyautodelete:registry=https://npm.pkg.github.com/

package-lock.json

+4,577-2,745
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+19-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"name": "@eazyautodelete/misc-commands",
3-
"version": "1.0.2",
3+
"version": "1.1.1",
44
"description": "🌌 Misc commands",
55
"main": "src/MiscCommands.js",
66
"scripts": {
77
"format": "npx prettier --write .",
88
"build": "tsc",
9-
"module:build": "tsc"
9+
"module:build": "tsc src/**.ts src/commands/**.ts --skipLibCheck true --skipDefaultLibCheck true",
10+
"postinstall": "npm run module:build"
1011
},
1112
"repository": {
1213
"type": "git",
@@ -17,6 +18,15 @@
1718
"email": "dev@qreepex.xyz",
1819
"url": "https://qreepex.xyz"
1920
},
21+
"files": [
22+
"src/*.js",
23+
"src/**/*.js",
24+
"src/*.ts",
25+
"src/**/*.ts",
26+
"src/*.txt",
27+
"src/**/*.txt",
28+
"tsconfig.json"
29+
],
2030
"license": "ISC",
2131
"bugs": {
2232
"url": "https://github.com/EazyAutodelete/misc-commands/issues"
@@ -32,18 +42,18 @@
3242
"prettier": "^2.7.1"
3343
},
3444
"dependencies": {
35-
"@eazyautodelete/commands-support": "^1.1.5",
36-
"@eazyautodelete/core": "^3.3.4",
37-
"discord.js": "^13.10.3",
45+
"@eazyautodelete/commands-support": "^1.4.15",
46+
"@eazyautodelete/core": "^4.1.11",
47+
"eris": "github:EazyAutodelete/eris",
3848
"typescript": "^4.8.3"
3949
},
50+
"publishConfig": {
51+
"access": "restricted",
52+
"registry": "https://npm.pkg.github.com/"
53+
},
4054
"config": {
4155
"commitizen": {
4256
"path": "./node_modules/cz-conventional-changelog"
4357
}
44-
},
45-
"publishConfig": {
46-
"access": "restricted",
47-
"registry": "https://npm.pkg.github.com/"
4858
}
4959
}

src/commands/help.ts

+40-36
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import { Bot, Command, CommandArgs, CommandMessage } from "@eazyautodelete/core";
2-
import { Cipher } from "crypto";
3-
import { ApplicationCommandOptionChoiceData, MessageActionRow } from "discord.js";
1+
import { Bot, Command, CommandMessageArgs, CommandMessage } from "@eazyautodelete/core";
42

53
class HelpCommand extends Command {
64
constructor(bot: Bot) {
@@ -22,30 +20,36 @@ class HelpCommand extends Command {
2220
];
2321
}
2422

25-
async run(message: CommandMessage, args: CommandArgs): Promise<void> {
23+
async run(message: CommandMessage, args: CommandMessageArgs): Promise<void> {
2624
const commandName = args.consume("command");
2725

2826
if (!commandName) {
29-
const helpEmbed = this.embed
30-
.setDescription(
31-
message.translate("overview") +
27+
await message.send(
28+
{
29+
...this.embed,
30+
description:
31+
message.translate("overview") +
3232
"\n\n" +
3333
this.bot.commands
3434
.filter((c: Command) => c.permissionLevel != "botMod" && c.permissionLevel != "botAdmin")
3535
.map((x: Command) => `**/${x.name}**:\n\\↪ ${x.description}`)
36-
.join("\n\n")
37-
)
38-
.setTitle("**EazyAutodelete:** Help");
39-
40-
const helpButtons = new MessageActionRow().addComponents([
41-
this.urlButton("https://eazyautodelete.xyz/discord", "Support Server", "<:discord:985860686963937320>")
42-
.components[0],
43-
this.urlButton("https://eazyautodelete.xyz", "Website", "🌐").components[0],
44-
this.urlButton("https://status.eazyautodelete.xyz", "Status Page", "📣").components[0],
45-
this.urlButton("https://docs.eazyautodelete.xyz", "Documentation", "📖").components[0],
46-
]);
47-
48-
await message.send(helpEmbed, true, helpButtons);
36+
.join("\n\n"),
37+
title: "**EazyAutodelete:** Help",
38+
},
39+
true,
40+
[
41+
{
42+
type: 1,
43+
components: [
44+
this.urlButton("https://eazyautodelete.xyz/discord", "Support Server", "<:discord:985860686963937320>")[0]
45+
.components[0],
46+
this.urlButton("https://eazyautodelete.xyz", "Website", "🌐")[0].components[0],
47+
this.urlButton("https://status.eazyautodelete.xyz", "Status Page", "📣")[0].components[0],
48+
this.urlButton("https://docs.eazyautodelete.xyz", "Documentation", "📖")[0].components[0],
49+
],
50+
},
51+
]
52+
);
4953
return;
5054
} else if (commandName) {
5155
const command = this.bot.commands.get(commandName);
@@ -54,29 +58,29 @@ class HelpCommand extends Command {
5458
return;
5559
}
5660

57-
const cmdHelpEmbed = this.embed
58-
.setTitle("Command: **/" + command.name + "**")
59-
.setDescription(command.description)
60-
.addFields([
61-
{
62-
name: "**" + message.translate("usage") + "**",
63-
value: "```\n/" + command.usage + "```",
64-
inline: false,
65-
},
66-
{
67-
name: "**" + message.translate("example") + "**",
68-
value: "```\n" + command.examples.map((x: string) => `/${x}`).join("\n") + "```",
69-
inline: false,
70-
},
71-
]);
61+
const cmdHelpEmbed = this.embed;
62+
cmdHelpEmbed.title = "Command: **/" + command.name + "**";
63+
cmdHelpEmbed.description = command.description;
64+
cmdHelpEmbed.fields = [
65+
{
66+
name: "**" + message.translate("usage") + "**",
67+
value: "```\n/" + command.usage + "```",
68+
inline: false,
69+
},
70+
{
71+
name: "**" + message.translate("example") + "**",
72+
value: "```\n" + command.examples.map((x: string) => `/${x}`).join("\n") + "```",
73+
inline: false,
74+
},
75+
];
7276

7377
await message.send(cmdHelpEmbed, true);
7478
return;
7579
}
7680
}
7781

7882
async autocompleteHandler(query: string) {
79-
const queries: ApplicationCommandOptionChoiceData[] = [];
83+
const queries: { name: string; value: string }[] = [];
8084
const commands = this.bot.commands;
8185

8286
commands

0 commit comments

Comments
 (0)