feat: hangman alongside some other stuff

This commit is contained in:
Saahil 2024-12-15 18:56:50 -05:00
parent 532940f487
commit 56a1e766b1
No known key found for this signature in database
GPG key ID: 8A8B64515254CFC6
7 changed files with 1056 additions and 43 deletions

2
.gitignore vendored
View file

@ -138,3 +138,5 @@ ctf/unenc
t3.ts
highseas.har
test_db.json
t4.ts
tiktok.json

View file

@ -1,3 +1,5 @@
## soon :D
![diagram](../assets/Zeon%20-%20anon%20dm.drawio.png)
pretty much: no password enc mail system
(db is serverside encrypted)

View file

@ -4,6 +4,7 @@ import * as Sentry from "@sentry/node";
import init from "./modules/watch-git";
// import "./modules/smee"
import app from "./modules/slackapp";
import { View } from "@slack/bolt";
import Loader from "./modules/CommandLoader";
import path from "path";
@ -171,7 +172,7 @@ cronWithCheckIn.schedule(
"1 7 * * 1-5",
async () => {
const hw = await getTodaysEvents().then((e: any) => {
const start = [];
const start = [];fff
const end = [];
//@ts-ignore
e.forEach((e) => {

1039
src/modules/hangman.ts Normal file

File diff suppressed because it is too large Load diff

11
src/modules/watchMyIrl.ts Normal file
View file

@ -0,0 +1,11 @@
export default function watchLocation() {
const location = null;
// todo
}
export function watchBattery() {
fetch(process.env.ZEON_DISCORD_INSTANCE! + "/irl/locations", {
// auth etcc
// iff batt under 100, send message if not already sent
})
}

View file

@ -1,4 +0,0 @@
export default function watchLocation() {
const location = null;
// todo
}

View file

@ -1,38 +0,0 @@
import WebSocket from "ws";
import { ModifiedApp } from "./slackapp";
export const tempCache = [];
export function startWatchingDirectory(app: ModifiedApp) {
const wss = new WebSocket(`wss://l.hack.club`);
wss.on("open", () => {
console.log("connected to wss://l.hack.club");
});
wss.on("message", async (data) => {
const d = JSON.parse(data.toString());
console.debug(d.channel, `C07ST3FF4S0`, d.ts);
const uniqueId = Buffer.from(d.ts + d.channel).toString("base64");
if (tempCache.includes(uniqueId)) {
console.log(`Already processed ${uniqueId}`);
return;
}
if (d.channel == "C07ST3FF4S0") return;
tempCache.push(uniqueId);
// console.log(d);
//console.log(d)
const messageLink = await app.client.chat
.getPermalink({
channel: d.channel,
message_ts: d.ts,
})
.then((d) => d.permalink);
await app.client.chat.postMessage({
text: messageLink,
channel: `C07ST3FF4S0`,
});
});
wss.on("close", () => {
console.log(`Closing connection`);
setTimeout(() => {
startWatchingDirectory(app);
}, 10_000);
});
}