Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

Commit

Permalink
postinstall commands && trycatch if msg delete
Browse files Browse the repository at this point in the history
  • Loading branch information
RedDusty authored Jun 15, 2022
1 parent 11009b5 commit f9a83f2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/node_modules
/yarn-error.log
/env
/build
/build
/temp
32 changes: 17 additions & 15 deletions commands/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,23 +231,25 @@ async function searcherGoodSearch(inter: CommandInteraction, query: string) {
}

async function findError(inter: CommandInteraction, msg?: string) {
return await inter.editReply({ content: `Упс! ${msg ? msg : "Кажется ничего не найдено..."}` }).then((msg) => {
(msg as Message).react("🔟").then((msg) => {
setTimeout(() => {
msg.message.react("5️⃣").then((msg) => {
setTimeout(() => {
msg.message.react(getRandomEmoji()).then((msg) => {
msg.message.react("🔫").then((msg) => {
setTimeout(() => {
msg.message.delete();
}, 1500);
try {
return await inter.editReply({ content: `Упс! ${msg ? msg : "Кажется ничего не найдено..."}` }).then((msg) => {
(msg as Message).react("🔟").then((msg) => {
setTimeout(() => {
msg.message.react("5️⃣").then((msg) => {
setTimeout(() => {
msg.message.react(getRandomEmoji()).then((msg) => {
msg.message.react("🔫").then((msg) => {
setTimeout(() => {
msg.message.delete();
}, 1500);
});
});
});
}, 4000);
});
}, 5000);
}, 4000);
});
}, 5000);
});
});
});
} catch (error) {}
}

function getRandomEmoji() {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"scripts": {
"start": "node build/index.js",
"dev": "nodemon index.ts",
"postinstall": "tsc && tsc-alias",
"build": "tsc && tsc-alias"
"postinstall": "tsc && tsc-alias && cp -r ./images/ ./build/images/ && cp -r ./json/ ./build/json/ && mkdir build/temp",
"build": "tsc && tsc-alias && cp -r ./images/ ./build/images/ && cp -r ./json/ ./build/json/ && mkdir build/temp"
},
"heroku-run-build-script": true,
"nodemonConfig": {
Expand Down

0 comments on commit f9a83f2

Please sign in to comment.