sedřetec

This commit is contained in:
Histmy 2022-12-02 17:32:14 +01:00
parent d8c9c24da8
commit 2e89310d2b
3 changed files with 4 additions and 8 deletions

View File

@ -136,16 +136,15 @@ const exp: Modul = {
cas = Math.floor(Math.random() * 10740 + 60); cas = Math.floor(Math.random() * 10740 + 60);
} }
const channel = await mes.author.createDM();
try { try {
await channel.send(`test ${emouty.d3k}`); await mes.author.send(`test ${emouty.d3k}`);
} catch { } catch {
return "ja ti ale napsat nemuzu ti kundo"; return "ja ti ale napsat nemuzu ti kundo";
} }
setTimeout(async () => { setTimeout(async () => {
for (let i = 0; i < 15; i++) { for (let i = 0; i < 15; i++) {
await channel.send("uz?"); await mes.author.send("uz?");
} }
}, cas * 1000); }, cas * 1000);

View File

@ -236,9 +236,7 @@ const exp: Modul = {
if (mes.channel.type == ChannelType.DM) return mes.channel.send("drz hubu"); if (mes.channel.type == ChannelType.DM) return mes.channel.send("drz hubu");
mes.delete(); mes.delete();
(async () => { sendDM(mes.author, "spis tak nepis");
sendDM(mes.author, "spis tak nepis");
})();
return true; return true;
} }
}, },

View File

@ -246,6 +246,5 @@ export const statusOnFoun = (bef: FakePresence | null, aft: FakePresence) => {
export const getGuildConnection = (guildId: string) => pripojeni[guildId]?.connection; export const getGuildConnection = (guildId: string) => pripojeni[guildId]?.connection;
export async function sendDM(user: User, txt: string) { export async function sendDM(user: User, txt: string) {
const channel = await user.createDM(); user.send(txt).catch(() => console.log(`dementovi ${user} nejde poslat DM`));
channel.send(txt).catch(() => console.log(`dementovi ${user} nejde poslat DM`));
} }