update:home

This commit is contained in:
Saahil 2024-11-22 09:09:45 -05:00
parent 79cdd373ba
commit 706b86b9dc
No known key found for this signature in database
GPG key ID: 8A8B64515254CFC6
3 changed files with 61 additions and 2 deletions

31
.env.example Normal file
View file

@ -0,0 +1,31 @@
## Some of this may not be able to be filled out.
SLACK_USER_TOKEN=
SLACK_BOT_TOKEN=
APP_ID=
CLIENT_ID=
CLIENT_SECRET=
SLACK_SIGNING_SECRET=
VERIFY_TOKEN=
APP_LEVEL_TOKEN=
WEBHOOK_URL=
PORT=
MY_USER_ID=U07L45W79E1
AUTH=
MY_JELLYFIN_INSTANCE=
MY_JELLYFIN_TOKEN=
ZEON_DISCORD_INSTANCE=
MY_SLACK_TOKEN=
IRL_AUTH=
MY_NEXTDNS=
HACKCLUB_NEXTDNS=
NEXTDNS_API_KEY=
HW_URL=https://..../iCal.aspx
ENC_HACKTIME_TOKEN=
OPENAI_API_KEY=sk-proj-
# ctf
SECOND_FLAG=
SONAR_KEY=
CTF_PASSWORD=
FINAL_KEY=
ENC_KEY=
ENC_IV=

View file

@ -2,6 +2,8 @@
import { App, View } from "@slack/bolt";
import { Command, onlyForMe } from "../modules/BaseCommand";
import { ModifiedApp } from "../modules/slackapp";
import { getSpotifyStatus } from "../modules/status";
function formatUptime(uptime: number = process.uptime()) {
const seconds = Math.floor(uptime % 60);
const minutes = Math.floor((uptime / 60) % 60);
@ -19,10 +21,12 @@ export default class AppHome implements Command {
this.description = `app home`;
this.is_event = true;
}
run(app: App) {
run(app: ModifiedApp) {
// app.command()
app.event(this.name, async ({ event, client, logger }) => {
try {
const spotifyStr = await getSpotifyStatus();
const ctfData = app.db.get("ctf") || []
//@ts-ignore
console.log(`USER: ${event.user}`);
function genView(): View {
@ -47,6 +51,14 @@ export default class AppHome implements Command {
text: "Nothing on the home page for you :P.",
},
},
// ctf channels (the user can see it)
ctfData.length > 0 && {
type: "section",
text: {
type: "mrkdwn",
text: `*Ctf channels:*\n${ctfData.map(e => `<#${e.channel}>`).join("\n")}`,
}
}
],
};
return {
@ -88,6 +100,14 @@ export default class AppHome implements Command {
),
},
},
// ctf channels (the user can see it)
ctfData.length > 0 && {
type: "section",
text: {
type: "mrkdwn",
text: `*Ctf channels:*\n${ctfData.map(e => `<#${e.channel}>`).join("\n")}`,
}
},
{
type: "divider",
},
@ -134,6 +154,13 @@ export default class AppHome implements Command {
},
],
},
spotifyStr && {
type: "section",
text: {
type: "mrkdwn",
text: `*Spotify:*\n${spotifyStr}`,
},
},
{
type: "divider",
},

View file

@ -4,7 +4,7 @@ export const acRandom = () => [
"It might be {hour} but i COULD be tweaking",
"hello today, my name is ~markiplier~ zeon.",
"Wana break from the ads, tap now because YOU can get spotify premium",
"Counterspell about to be lit (yes)",
//"Counterspell about to be lit (yes)",
"Um uh im a robot.",
"do NOT star this message",
"Start this message",
@ -19,6 +19,7 @@ export const beggingMessage = [
"PLEASE JOIN IT RAA",
"Its epik i swear",
"warning: may contain extremly dead chat.",
"PLEASE PLEASE PLZ PLZPLZ"
];
// if you want to become a neighboor of this channel just dm me on slack or add your self to the canvas
export const neighbors = [