mirror of
https://github.com/System-End/slack-end.git
synced 2026-04-19 22:05:10 +00:00
feat: hangman alongside some other stuff
This commit is contained in:
parent
532940f487
commit
56a1e766b1
7 changed files with 1056 additions and 43 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -138,3 +138,5 @@ ctf/unenc
|
|||
t3.ts
|
||||
highseas.har
|
||||
test_db.json
|
||||
t4.ts
|
||||
tiktok.json
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
## soon :D
|
||||
|
||||

|
||||
pretty much: no password enc mail system
|
||||
(db is serverside encrypted)
|
||||
|
|
@ -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
1039
src/modules/hangman.ts
Normal file
File diff suppressed because it is too large
Load diff
11
src/modules/watchMyIrl.ts
Normal file
11
src/modules/watchMyIrl.ts
Normal 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
|
||||
})
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
export default function watchLocation() {
|
||||
const location = null;
|
||||
// todo
|
||||
}
|
||||
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue