From f58309743f1b2a51655a4b01b66cc44c3aa946d1 Mon Sep 17 00:00:00 2001 From: Histmy Date: Wed, 24 May 2023 13:35:54 +0200 Subject: [PATCH] pavel is online --- src/modules/zbytek.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/modules/zbytek.ts b/src/modules/zbytek.ts index 7f01427..239e3c7 100644 --- a/src/modules/zbytek.ts +++ b/src/modules/zbytek.ts @@ -1,12 +1,12 @@ // Komandy nebo handelery kterĂ˝ se nikam jinam nehodĂ­ import { getVoiceConnections } from "@discordjs/voice"; -import { Client, Message, User } from "discord.js"; +import { Client, Message, Presence, TextChannel, User } from "discord.js"; import { emouty } from "../utils/emotes"; import { createServer } from "http"; import { Modul } from "../utils/types"; import fetch from "node-fetch"; -import { formatCas, log, sendDM } from "../utils/utils"; +import { formatCas, log, prefix, sendDM } from "../utils/utils"; let spim = false; @@ -51,7 +51,6 @@ const exp: Modul = { pos: 0, fun: (mes: Message) => { const cont = mes.content.toLowerCase(); - const prefix = process.env.prefix || "more"; if (cont == `${prefix} zapni se`) { if (spim) { spim = false; @@ -102,6 +101,15 @@ const exp: Modul = { if (bef.avatar == aft.avatar) return; sendDM(aft, "cus bracho vydim ze sis zmenim profilofku na dalsi mrdku estli chces abi se ukazovala na na v3ech sr4kach kterz sou na dedfis.cy tak se tam prosymte prihlas haby se mohla zmnenit syk"); + }, + + on_userPresenceUpdate: (bef: Presence | null, aft: Presence) => { + if (aft.user?.id != "355053867265818635" || bef?.status == "online" || aft.status != "online") return; + + const client = module.exports.client as Client; + + (client.channels.cache.get("555779161067749448") as TextChannel) + .send("https://tenor.com/view/pavel-is-online-gif-21604335"); } };