rm: old stuff

This commit is contained in:
Saahil 2025-02-15 20:49:52 -05:00
parent 6b1a5ad115
commit 16d93e596f
No known key found for this signature in database
GPG key ID: 8A8B64515254CFC6
6 changed files with 18 additions and 1208 deletions

View file

@ -1,29 +0,0 @@
import { Command, onlyForMe } from "../modules/BaseCommand";
import { ModifiedApp } from "../modules/slackapp";
import bcrypt from "bcrypt";
export default class Ping implements Command {
name: string;
description: string;
constructor() {
this.name = `aichannelthing!`;
this.description = `idek`;
}
run(app: ModifiedApp) {
app.action(`i_want_key`, async ({ ack, action, body }) => {
ack();
console.log(body);
// create random key
//@ts-ignore
const key = Math.random().toString() + body.user.id;
//@ts-ignore
const _keys = app.db.get(`ai_keys`) || [];
_keys.push(bcrypt.hashSync(key, 10));
app.db.set(`ai_keys`, _keys);
await app.client.chat.postMessage({
//@ts-ignore
channel: body.user.id,
text: `Here is your key!\n \`${key}\``,
});
});
}
}

View file

@ -32,6 +32,7 @@ export default class Bday implements Command {
where: `(userID,eq,${command.user_id})`,
},
)
//@ts-ignore
).userID
) {
await app.client.chat.postEphemeral({

View file

@ -1,87 +0,0 @@
// @ts-nocheck
import { App } from "@slack/bolt";
import { ModifiedApp } from "../modules/slackapp";
import util from "util";
import { Command, onlyForMe } from "../modules/BaseCommand";
// example str
// *PySoundboard*\nBy <@U0827CL509G> | <https://github.com/UnstoppableBlob/PySoundboard|Repo> | <https://www.youtube.com/watch?v=6aCpx02h738|Demo>\nMade in 0 hours
const extractInfo = (input) => {
const idMatch = input.match(/<@(\w+)>/); // Matches the ID pattern
const gitMatch = input.match(/<([^|]+)\|Repo>/); // Matches the GitHub URL (without relying on domain)
const demoMatch = input.match(/<([^|]+)\|Demo>/); // Matches the Demo URL (without relying on domain)
const hoursMatch = input.match(/Made in (\d+) hours/); // Matches the hours information
return {
userId: idMatch ? idMatch[1] : null,
git: gitMatch ? gitMatch[1] : null, // Get the URL without the '<>' symbols
demo: demoMatch ? demoMatch[1] : null, // Get the URL without the '<>' symbols
hourCount: hoursMatch ? parseInt(hoursMatch[1], 10) : null,
};
};
export default class HighSeasShipExtractor implements Command {
name: string;
description: string;
is_event?: boolean;
constructor() {
this.name = `message`;
this.description = `high seas ships yum yum`;
this.is_event = true;
}
run(app: ModifiedApp) {
// console.debug(`#message-hwowasurday`);
// app.command()
app.event(this.name, async (par) => {
// console.debug(par);
if (par.event.channel !== "C07UA18MXBJ") return;
if (par.event.user !== "U07NGBJUDRD") return;
const message = par;
// if (!par.ack) return;
// console.debug(0);
// if (!par.say) return;
if (par.event.hidden) return;
// console.log(
// `uh one of them are here ffs`,
// par.event,
// par.event.channel_type,
// );
//@ts-ignore
// await par.ack();
// if (par.event.channel_type !== "im") return;
// if (!par.event.text.startsWith("!")) return;
console.debug(`cmd`);
const { event, say } = par;
const args = event.text.trim().split(/ +/);
const cmd = args.shift().toLowerCase();
// console.log(cmd, args);
const blocks = par.event.blocks;
const textEl = blocks[0].text.text;
const info = extractInfo(textEl);
console.log(info);
// debug it -- it works dw
// await app.client.chat.postMessage({
// channel: `C07LGLUTNH2`,
// text: `${JSON.stringify(info)}\n\n I GOT THE SHIP MAYBE`,
// // blocks,
// });
// userid most importent because it is what the thingy ac uses.
if (!info.userId) return;
fetch(`https://api.saahild.com/api/highseasships/add_ship`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `${process.env.AUTH}`,
},
body: JSON.stringify(info),
});
console.debug(`#message-`);
//@ts-ignore
// await say(`Hi there! im a WIP rn but my site is:\n> http://zeon.rocks/`);
});
}
}

View file

@ -33,7 +33,7 @@ export default class AppHome implements Command {
const shipmentData = app.db.get(`shipments_${event.user}`);
const ctfData = app.db.get("ctf") || [];
const adventOfCodeData = app.db.get("adventofcode_lb");
const highSeasLb = app.db.get("highseas_lb") || [];
// const highSeasLb = app.db.get("highseas_lb") || [];
console.log(
Boolean(shipmentData),
Boolean(adventOfCodeData),
@ -80,21 +80,21 @@ export default class AppHome implements Command {
//@ts-ignore
console.log(`USER: ${event.user}`);
function genView(): View {
const high_seas_section = [
{
type: "section",
text: {
type: "mrkdwn",
text: `*High seas lb:*\n${highSeasLb
.slice(0, 10)
.map(
(e, i) =>
`${i + 1} <@${e.id}> - ${e.current_doubloons} (${e.total_doubloons} overall) :doubloon:`,
)
.join("\n")}`,
},
},
];
// const high_seas_section = [
// {
// type: "section",
// text: {
// type: "mrkdwn",
// text: `*High seas lb:*\n${highSeasLb
// .slice(0, 10)
// .map(
// (e, i) =>
// `${i + 1} <@${e.id}> - ${e.current_doubloons} (${e.total_doubloons} overall) :doubloon:`,
// )
// .join("\n")}`,
// },
// },
// ];
const anon_mail_section = [
{
type: "divider",
@ -211,7 +211,6 @@ export default class AppHome implements Command {
// },
// },
...anon_mail_section,
...high_seas_section,
].filter(Boolean),
};
return {
@ -295,7 +294,6 @@ export default class AppHome implements Command {
// },
// },
...anon_mail_section,
...high_seas_section,
{
type: "divider",
},

View file

@ -161,6 +161,7 @@ export default class TagSystem implements Command {
text: `Zeon Tag System Help\n\n/tag use <tag>\n/tag add\n/tag rm <tag>`,
});
} else if (cmd == "list") {
//@ts-ignore
const tags = Object.keys(app.dbs.tags.JSON())
.filter((e) => e.startsWith(command.user_id))
.map((e) => {

File diff suppressed because it is too large Load diff