diff --git a/.gitignore b/.gitignore index 5ef042b..852f6d9 100644 --- a/.gitignore +++ b/.gitignore @@ -138,3 +138,5 @@ ctf/unenc t3.ts highseas.har test_db.json +t4.ts +tiktok.json \ No newline at end of file diff --git a/docs/HOW_ANON_MAIL_WORKS.md b/docs/HOW_ANON_MAIL_WORKS.md index 8b493f2..93f64fe 100644 --- a/docs/HOW_ANON_MAIL_WORKS.md +++ b/docs/HOW_ANON_MAIL_WORKS.md @@ -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) \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 6c220bd..c4e3163 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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) => { diff --git a/src/modules/hangman.ts b/src/modules/hangman.ts new file mode 100644 index 0000000..6fa1d6d --- /dev/null +++ b/src/modules/hangman.ts @@ -0,0 +1,1039 @@ +// https://github.com/fahadimaduddin/cli-hangman/blob/main/index.ts + +export function buildBoard(stage: number) { + // build the board +return `_________ + | | + | ${stage>=1?"O":""} + | ${stage>=3?"/":""}${stage >= 2?"|":""}${stage>=4?"\\":""} + | ${stage >= 5?"/":""} ${stage>=6?"\\":""} + | + |_________` +} + +function hideWord(word:string, guessedLetters: string[]) { +return word.split("") +.map(w=> guessedLetters.includes(w)? "_":w) +.join("") +} + +export function getWords() { + return [ + + "ability", + "able", + "about", + "above", + "accept", + "according", + "account", + "across", + "act", + "action", + "activity", + "actually", + "add", + "address", + "administration", + "admit", + "adult", + "affect", + "after", + "again", + "against", + "age", + "agency", + "agent", + "ago", + "agree", + "agreement", + "ahead", + "air", + "all", + "allow", + "almost", + "alone", + "along", + "already", + "also", + "although", + "always", + "American", + "among", + "amount", + "analysis", + "and", + "animal", + "another", + "answer", + "any", + "anyone", + "anything", + "appear", + "apply", + "approach", + "area", + "argue", + "arm", + "around", + "arrive", + "art", + "article", + "artist", + "ask", + "assume", + "attack", + "attention", + "attorney", + "audience", + "author", + "authority", + "available", + "avoid", + "away", + "baby", + "back", + "bad", + "bag", + "ball", + "bank", + "bar", + "base", + "beat", + "beautiful", + "because", + "become", + "bed", + "before", + "begin", + "behavior", + "behind", + "believe", + "benefit", + "best", + "better", + "between", + "beyond", + "big", + "bill", + "billion", + "bit", + "black", + "blood", + "blue", + "board", + "body", + "book", + "born", + "both", + "box", + "boy", + "break", + "bring", + "brother", + "budget", + "build", + "building", + "business", + "but", + "buy", + "call", + "camera", + "campaign", + "can", + "cancer", + "candidate", + "capital", + "car", + "card", + "care", + "career", + "carry", + "case", + "catch", + "cause", + "cell", + "center", + "central", + "century", + "certain", + "certainly", + "chair", + "challenge", + "chance", + "change", + "character", + "charge", + "check", + "child", + "choice", + "choose", + "church", + "citizen", + "city", + "civil", + "claim", + "class", + "clear", + "clearly", + "close", + "coach", + "cold", + "collection", + "college", + "color", + "come", + "commercial", + "common", + "community", + "company", + "compare", + "computer", + "concern", + "condition", + "conference", + "Congress", + "consider", + "consumer", + "contain", + "continue", + "control", + "cost", + "could", + "country", + "couple", + "course", + "court", + "cover", + "create", + "crime", + "cultural", + "culture", + "cup", + "current", + "customer", + "cut", + "dark", + "data", + "daughter", + "day", + "dead", + "deal", + "death", + "debate", + "decade", + "decide", + "decision", + "deep", + "defense", + "degree", + "Democrat", + "democratic", + "describe", + "design", + "despite", + "detail", + "determine", + "develop", + "development", + "die", + "difference", + "different", + "difficult", + "dinner", + "direction", + "director", + "discover", + "discuss", + "discussion", + "disease", + "doctor", + "dog", + "door", + "down", + "draw", + "dream", + "drive", + "drop", + "drug", + "during", + "each", + "early", + "east", + "easy", + "eat", + "economic", + "economy", + "edge", + "education", + "effect", + "effort", + "eight", + "either", + "election", + "else", + "employee", + "end", + "energy", + "enjoy", + "enough", + "enter", + "entire", + "environment", + "environmental", + "especially", + "establish", + "even", + "evening", + "event", + "ever", + "every", + "everybody", + "everyone", + "everything", + "evidence", + "exactly", + "example", + "executive", + "exist", + "expect", + "experience", + "expert", + "explain", + "eye", + "face", + "fact", + "factor", + "fail", + "fall", + "family", + "far", + "fast", + "father", + "fear", + "federal", + "feel", + "feeling", + "few", + "field", + "fight", + "figure", + "fill", + "film", + "final", + "finally", + "financial", + "find", + "fine", + "finger", + "finish", + "fire", + "firm", + "first", + "fish", + "five", + "floor", + "fly", + "focus", + "follow", + "food", + "foot", + "for", + "force", + "foreign", + "forget", + "form", + "former", + "forward", + "four", + "free", + "friend", + "from", + "front", + "full", + "fund", + "future", + "game", + "garden", + "gas", + "general", + "generation", + "get", + "girl", + "give", + "glass", + "goal", + "good", + "government", + "great", + "green", + "ground", + "group", + "grow", + "growth", + "guess", + "gun", + "guy", + "hair", + "half", + "hand", + "hang", + "happen", + "happy", + "hard", + "have", + "head", + "health", + "hear", + "heart", + "heat", + "heavy", + "help", + "her", + "here", + "herself", + "high", + "him", + "himself", + "his", + "history", + "hit", + "hold", + "home", + "hope", + "hospital", + "hot", + "hotel", + "hour", + "house", + "how", + "however", + "huge", + "human", + "hundred", + "husband", + "idea", + "identify", + "image", + "imagine", + "impact", + "important", + "improve", + "include", + "including", + "increase", + "indeed", + "indicate", + "individual", + "industry", + "information", + "inside", + "instead", + "institution", + "interest", + "interesting", + "international", + "interview", + "into", + "investment", + "involve", + "issue", + "item", + "its", + "itself", + "job", + "join", + "just", + "keep", + "key", + "kid", + "kill", + "kind", + "kitchen", + "know", + "knowledge", + "land", + "language", + "large", + "last", + "late", + "later", + "laugh", + "law", + "lawyer", + "lay", + "lead", + "leader", + "learn", + "least", + "leave", + "left", + "leg", + "legal", + "less", + "let", + "letter", + "level", + "lie", + "life", + "light", + "like", + "likely", + "line", + "list", + "listen", + "little", + "live", + "local", + "long", + "look", + "lose", + "loss", + "lot", + "love", + "low", + "machine", + "magazine", + "main", + "maintain", + "major", + "majority", + "make", + "man", + "manage", + "management", + "manager", + "many", + "market", + "marriage", + "material", + "matter", + "may", + "maybe", + "mean", + "measure", + "media", + "medical", + "meet", + "meeting", + "member", + "memory", + "mention", + "message", + "method", + "middle", + "might", + "military", + "million", + "mind", + "minute", + "miss", + "mission", + "model", + "modern", + "moment", + "money", + "month", + "more", + "morning", + "most", + "mother", + "mouth", + "move", + "movement", + "movie", + "Mrs", + "much", + "music", + "must", + "myself", + "name", + "nation", + "national", + "natural", + "nature", + "near", + "nearly", + "necessary", + "need", + "network", + "never", + "new", + "news", + "newspaper", + "next", + "nice", + "night", + "none", + "nor", + "north", + "not", + "note", + "nothing", + "notice", + "now", + "n't", + "number", + "occur", + "off", + "offer", + "office", + "officer", + "official", + "often", + "oil", + "old", + "once", + "one", + "only", + "onto", + "open", + "operation", + "opportunity", + "option", + "order", + "organization", + "other", + "others", + "our", + "out", + "outside", + "over", + "own", + "owner", + "page", + "pain", + "painting", + "paper", + "parent", + "part", + "participant", + "particular", + "particularly", + "partner", + "party", + "pass", + "past", + "patient", + "pattern", + "pay", + "peace", + "people", + "per", + "perform", + "performance", + "perhaps", + "period", + "person", + "personal", + "phone", + "physical", + "pick", + "picture", + "piece", + "place", + "plan", + "plant", + "play", + "player", + "point", + "police", + "policy", + "political", + "politics", + "poor", + "popular", + "population", + "position", + "positive", + "possible", + "power", + "practice", + "prepare", + "present", + "president", + "pressure", + "pretty", + "prevent", + "price", + "private", + "probably", + "problem", + "process", + "produce", + "product", + "production", + "professional", + "professor", + "program", + "project", + "property", + "protect", + "prove", + "provide", + "public", + "pull", + "purpose", + "push", + "put", + "quality", + "question", + "quickly", + "quite", + "race", + "radio", + "raise", + "range", + "rate", + "rather", + "reach", + "read", + "ready", + "real", + "reality", + "realize", + "really", + "reason", + "receive", + "recent", + "recently", + "recognize", + "record", + "red", + "reduce", + "reflect", + "region", + "relate", + "relationship", + "religious", + "remain", + "remember", + "remove", + "report", + "represent", + "Republican", + "require", + "research", + "resource", + "respond", + "response", + "responsibility", + "rest", + "result", + "return", + "reveal", + "rich", + "right", + "rise", + "risk", + "road", + "rock", + "role", + "room", + "rule", + "run", + "safe", + "same", + "save", + "say", + "scene", + "school", + "science", + "scientist", + "score", + "sea", + "season", + "seat", + "second", + "section", + "security", + "see", + "seek", + "seem", + "sell", + "send", + "senior", + "sense", + "series", + "serious", + "serve", + "service", + "set", + "seven", + "several", + "sex", + "sexual", + "shake", + "share", + "she", + "shoot", + "short", + "shot", + "should", + "shoulder", + "show", + "side", + "sign", + "significant", + "similar", + "simple", + "simply", + "since", + "sing", + "single", + "sister", + "sit", + "site", + "situation", + "six", + "size", + "skill", + "skin", + "small", + "smile", + "social", + "society", + "soldier", + "some", + "somebody", + "someone", + "something", + "sometimes", + "son", + "song", + "soon", + "sort", + "sound", + "source", + "south", + "southern", + "space", + "speak", + "special", + "specific", + "speech", + "spend", + "sport", + "spring", + "staff", + "stage", + "stand", + "standard", + "star", + "start", + "state", + "statement", + "station", + "stay", + "step", + "still", + "stock", + "stop", + "store", + "story", + "strategy", + "street", + "strong", + "structure", + "student", + "study", + "stuff", + "style", + "subject", + "success", + "successful", + "such", + "suddenly", + "suffer", + "suggest", + "summer", + "support", + "sure", + "surface", + "system", + "table", + "take", + "talk", + "task", + "tax", + "teach", + "teacher", + "team", + "technology", + "television", + "tell", + "ten", + "tend", + "term", + "test", + "than", + "thank", + "that", + "the", + "their", + "them", + "themselves", + "then", + "theory", + "there", + "these", + "they", + "thing", + "think", + "third", + "this", + "those", + "though", + "thought", + "thousand", + "threat", + "three", + "through", + "throughout", + "throw", + "thus", + "time", + "today", + "together", + "tonight", + "too", + "top", + "total", + "tough", + "toward", + "town", + "trade", + "traditional", + "training", + "travel", + "treat", + "treatment", + "tree", + "trial", + "trip", + "trouble", + "true", + "truth", + "try", + "turn", + "two", + "type", + "under", + "understand", + "unit", + "until", + "upon", + "use", + "usually", + "value", + "various", + "very", + "victim", + "view", + "violence", + "visit", + "voice", + "vote", + "wait", + "walk", + "wall", + "want", + "war", + "watch", + "water", + "way", + "weapon", + "wear", + "week", + "weight", + "well", + "west", + "western", + "what", + "whatever", + "when", + "where", + "whether", + "which", + "while", + "white", + "who", + "whole", + "whom", + "whose", + "why", + "wide", + "wife", + "will", + "win", + "wind", + "window", + "wish", + "with", + "within", + "without", + "woman", + "wonder", + "word", + "work", + "worker", + "world", + "worry", + "would", + "write", + "writer", + "wrong", + "yard", + "yeah", + "year", + "yes", + "yet", + "you", + "young", + "your", + "yourself" + ] + } +export function getRandomWord() { + return getWords()[Math.round(Math.random() * (getWords().length - 1))] +} +export function onGuess(guessedLetter: string, word: string, guessedLetters: string[], stage: number) { + if(guessedLetters.includes(guessedLetter)) return { + message: `\`\`\`${buildBoard(stage)}\`\`\`\n\nYou already guessed \`${guessedLetter}\`\n${hideWord(word,guessedLetters)}`, + guessedLetters, + guessedLetter, + word, + stage + } + if(stage >= 5) return { + message: `\`\`\`${buildBoard(stage)}\`\`\`\n\nYou already lost.. \`${guessedLetter}\`\n${hideWord(word,guessedLetters)}`, + guessedLetters, + guessedLetter, + word, + stage + } + if(guessedLetters.join("") === word) return { + message: `\`\`\`${buildBoard(stage)}\`\`\`\n\nYou have won! \`${guessedLetter}\`\n${hideWord(word,guessedLetters)}`, + guessedLetters, + guessedLetter, + word, + stage + } + + if(word.includes(guessedLetter)) { + guessedLetters.push(guessedLetter); + return {message:`\`\`\`${buildBoard(stage)}\`\`\`\n\nYou guessed \`${guessedLetter}\`\n${hideWord(word,guessedLetters)}`, + guessedLetters, + guessedLetter, + word, + stage + } + } else { + return {message:`\`\`\`${buildBoard(stage)}\`\`\`\n\nYou guessed \`${guessedLetter}\`\n${hideWord(word,guessedLetters)}`, guessedLetters, + guessedLetter, + word, + stage + } + } +} + diff --git a/src/modules/watchMyIrl.ts b/src/modules/watchMyIrl.ts new file mode 100644 index 0000000..c5c207c --- /dev/null +++ b/src/modules/watchMyIrl.ts @@ -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 + }) +} \ No newline at end of file diff --git a/src/modules/watchMyLocation.ts b/src/modules/watchMyLocation.ts deleted file mode 100644 index 02e4287..0000000 --- a/src/modules/watchMyLocation.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default function watchLocation() { - const location = null; - // todo -} diff --git a/src/modules/wsDirectory.ts b/src/modules/wsDirectory.ts deleted file mode 100644 index 1a5b467..0000000 --- a/src/modules/wsDirectory.ts +++ /dev/null @@ -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); - }); -}