|
1 | 1 | import { SlashCommandBuilder, type CommandInteraction, type CommandInteractionOption } from "discord.js"; |
2 | | -import { embedify } from "@lib/embedify.ts"; |
| 2 | +import { useEmbedify } from "@lib/embedify.ts"; |
3 | 3 | import { CmdBase, SlashCommand } from "@lib/Command.ts"; |
4 | 4 | import pkg from "@root/package.json" with { type: "json" }; |
5 | 5 | import { getEnvVar } from "@lib/env.ts"; |
@@ -79,40 +79,32 @@ export class HelpCmd extends SlashCommand { |
79 | 79 | await int.deferReply({ ephemeral }); |
80 | 80 | const locale = await HelpCmd.getGuildLocale(int); |
81 | 81 |
|
82 | | - return int.editReply({ |
83 | | - embeds: [ |
84 | | - embedify(cmdList) |
85 | | - .setTitle(tr.for(locale, "commands.help.embedTitles.commands")) |
86 | | - .setFooter({ text: tr.for(locale, "commands.help.embedFooters.commands") }), |
87 | | - ], |
88 | | - }); |
| 82 | + return int.editReply(useEmbedify(cmdList, undefined, (e) => e |
| 83 | + .setTitle(tr.for(locale, "commands.help.embedTitles.commands")) |
| 84 | + .setFooter({ text: tr.for(locale, "commands.help.embedFooters.commands") }), |
| 85 | + )); |
89 | 86 | } |
90 | 87 | case "info": { |
91 | 88 | await int.deferReply(); |
92 | 89 | const locale = await HelpCmd.getGuildLocale(int); |
93 | 90 |
|
94 | 91 | const { version, author: { name, url }} = pkg; |
95 | | - return int.editReply({ |
96 | | - embeds: [ |
97 | | - embedify([ |
98 | | - tr.for(locale, "commands.help.info.headline", { version, name, url }), |
99 | | - tr.for(locale, "commands.help.info.donationLink", pkg.funding.url), |
100 | | - "", |
101 | | - tr.for(locale, "commands.help.info.bugsLink", pkg.bugs.url), |
102 | | - tr.for(locale, "commands.help.info.supportServerLink", getEnvVar("SUPPORT_SERVER_INVITE_URL")), |
103 | | - tr.for(locale, "commands.help.info.globalOptOut"), |
104 | | - "", |
105 | | - tr.for(locale, "commands.help.info.installExtensions"), |
106 | | - tr.for(locale, "commands.help.info.installExtReturnYtDislike"), |
107 | | - tr.for(locale, "commands.help.info.installExtSponsorBlock"), |
108 | | - tr.for(locale, "commands.help.info.installExtDeArrow"), |
109 | | - tr.for(locale, "commands.help.info.installExtMobile"), |
110 | | - "", |
111 | | - tr.for(locale, "commands.help.info.poweredBy"), |
112 | | - ]) |
113 | | - .setTitle(tr.for(locale, "commands.help.embedTitles.info")), |
114 | | - ], |
115 | | - }); |
| 92 | + return int.editReply(useEmbedify([ |
| 93 | + tr.for(locale, "commands.help.info.headline", { version, name, url }), |
| 94 | + tr.for(locale, "commands.help.info.donationLink", pkg.funding.url), |
| 95 | + "", |
| 96 | + tr.for(locale, "commands.help.info.bugsLink", pkg.bugs.url), |
| 97 | + tr.for(locale, "commands.help.info.supportServerLink", getEnvVar("SUPPORT_SERVER_INVITE_URL")), |
| 98 | + tr.for(locale, "commands.help.info.globalOptOut"), |
| 99 | + "", |
| 100 | + tr.for(locale, "commands.help.info.installExtensions"), |
| 101 | + tr.for(locale, "commands.help.info.installExtReturnYtDislike"), |
| 102 | + tr.for(locale, "commands.help.info.installExtSponsorBlock"), |
| 103 | + tr.for(locale, "commands.help.info.installExtDeArrow"), |
| 104 | + tr.for(locale, "commands.help.info.installExtMobile"), |
| 105 | + "", |
| 106 | + tr.for(locale, "commands.help.info.poweredBy"), |
| 107 | + ], undefined, (e) => e.setTitle(tr.for(locale, "commands.help.embedTitles.info")))); |
116 | 108 | } |
117 | 109 | } |
118 | 110 | } |
|
0 commit comments