enhance migration notices

This commit is contained in:
artie 2025-02-10 22:01:54 +01:00
parent c01c40336b
commit 5842a9911c
2 changed files with 21 additions and 2 deletions

View File

@ -11,10 +11,29 @@ export default defineEvent({
const command = message.content.match(/^\$[a-zA-Z]+$/); const command = message.content.match(/^\$[a-zA-Z]+$/);
if (command) { if (command) {
if (
["lens", "lenstr", "deepl"].includes(command[0].slice(1)) &&
message.reference
) {
await message.reply(
dedent`The bot has migrated to application commands!
If you wish to OCR and/or translate someone else's message, please select the appropriate action from the context menu on their message.
Desktop: Right click on the message and select the action you wish to perform.
Mobile: Long press on the message and select the action you wish to perform.
https://files.catbox.moe/0bo10j.png`
);
return;
}
await message.reply( await message.reply(
dedent`The bot has migrated to slash commands! dedent`The bot has migrated to slash commands!
Start typing \`/\` to see the available commands. Start typing \`/\` to see the available commands.
For example: \`/${command[0].slice(1)}\`` For example: \`/${command[0].slice(1)}\`
https://files.catbox.moe/594jzd.png`
); );
return; return;
} }

View File

@ -51,7 +51,7 @@ export function dedent(parts: TemplateStringsArray, ...values: unknown[]) {
i < values.length ? [part, String(values[i])] : [part] i < values.length ? [part, String(values[i])] : [part]
) )
.join("") .join("")
.replace(/(\n)\s+/g, "$1"); .replace(/^ +/gm, "");
} }
export function lazy<T>(cb: () => T) { export function lazy<T>(cb: () => T) {