added more pockej

This commit is contained in:
Histmy 2021-11-07 12:13:23 +01:00
parent e0d278e013
commit 6cdcfb6859

View File

@ -4,7 +4,7 @@
import { ActivityType, Message, PresenceStatusData } from "discord.js"; import { ActivityType, Message, PresenceStatusData } from "discord.js";
import { emouty } from "../utils/emotes"; import { emouty } from "../utils/emotes";
import { Modul } from "../utils/types"; import { Modul } from "../utils/types";
import { ping } from "../utils/utils"; import { formatter, ping } from "../utils/utils";
const changeStatus = (mes: Message, status: PresenceStatusData) => { const changeStatus = (mes: Message, status: PresenceStatusData) => {
mes.client.user?.setStatus(status); mes.client.user?.setStatus(status);
@ -17,6 +17,8 @@ const changeActivity = (mes: Message, activity: ActivityType | undefined = undef
return "ano pane"; return "ano pane";
}; };
const sleep = (time: number) => new Promise<void>(res => setTimeout(res, time));
const exp: Modul = { const exp: Modul = {
more_komandy: { more_komandy: {
@ -112,6 +114,31 @@ const exp: Modul = {
image: { url: "attachment://pocasi.png" } image: { url: "attachment://pocasi.png" }
}; };
return { embeds: [embed], files: ["https://util.deadfish.cz/morepocasi/v/49.4348358/12.8147250/pocasi.png"] }; return { embeds: [embed], files: ["https://util.deadfish.cz/morepocasi/v/49.4348358/12.8147250/pocasi.png"] };
},
pockej: {
als: ["cekej"],
run: (mes, arg) => {
let cas: number;
if (arg.length) {
cas = Number(arg);
if (isNaN(cas)) return "cos to tam napsal ty kkt";
} else {
cas = Math.floor(Math.random() * 10740 + 60);
}
setTimeout(async () => {
const chanel = await mes.author.createDM();
for (let i = 0; i < 15; i++) {
chanel.send("uz?");
await sleep(200);
}
}, cas * 1000);
const datum = new Date();
datum.setSeconds(datum.getSeconds() + cas);
return `doufam ze v ${formatter(datum)} to uz bude`;
}
} }
} }
}; };