Skip to content

Commit

Permalink
dep clean up + redis fix + accessibility fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dispherical committed Oct 14, 2024
1 parent 0fb7d31 commit c126b53
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 387 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Array.prototype.random = function () {
const client = await createClient({
url: process.env.REDIS_DATABASE,
})
.on("error", (err) => console.log("Redis Client Error", err))
.on("error", (err) => console.error("Redis Client Error", err))
.connect();
receiver.router.get("/", async (req, res) => {
res.redirect(302, "https://github.com/hackclub/channel-directory");
Expand Down
2 changes: 0 additions & 2 deletions interactions/message.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const utils = require("../utils");
const pms = require("pretty-ms");
const fs = require("node:fs");

/**
* @param {{app: import('@slack/bolt').App, client: import('redis').RedisClientType}} param1
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
"dependencies": {
"@prisma/client": "5.17.0",
"@slack/bolt": "^3.18.0",
"airtable": "^0.12.2",
"dotenv": "^16.4.5",
"figlet": "^1.7.0",
"geoip-lite2": "^2.1.36",
"geolib": "^3.3.4",
"node-cron": "^3.0.3",
"pretty-ms": "7.0.1",
"prisma": "^5.17.0",
Expand Down
8 changes: 1 addition & 7 deletions utils/allTimeline.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const emojis = require("./emojis");
const crypto = require("crypto");
const { createClient } = require("redis");


Array.prototype.random = function () {
return this[Math.floor(Math.random() * this.length)];
Expand Down Expand Up @@ -33,11 +32,6 @@ async function getChannelEmoji(channelId, prisma) {
}

async function generateMessageString(messages, currentTime, prisma) {
const client = await createClient({
url: process.env.REDIS_DATABASE,
})
.on("error", (err) => console.log("Redis Client Error", err))
.connect();
const interval = 5;
const secondsInDay = 86400;
const intervalsInDay = secondsInDay / interval;
Expand Down
1 change: 1 addition & 0 deletions utils/pull.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = async function ({ app, client, prisma }) {
await app.client.chat.update({
channel: process.env.SLACK_CHANNEL,
ts: await client.get(`${process.env.INSTANCE_ID || "production"}.${section.id}.messageId`),
text: `*${section.title}*\n\n${rend}\n\n════════════════════════════════════\n`,
blocks: [
{
type: "section",
Expand Down
Loading

0 comments on commit c126b53

Please sign in to comment.