Skip to content

Commit 6f84942

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature/starboard
# Conflicts: # src/store/storage.ts
2 parents b9ef0ff + 2733455 commit 6f84942

File tree

90 files changed

+1068
-329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1068
-329
lines changed

.github/workflows/sentry.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
run: bun install --frozen-lockfile
6060

6161
- name: Download CI build artifact
62-
uses: dawidd6/action-download-artifact@v3
62+
uses: dawidd6/action-download-artifact@v6
6363
with:
6464
run_id: ${{ github.event.workflow_run.id }}
6565
name: build-bin-${{ github.event.workflow_run.head_sha }}

biome.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": false
7+
},
8+
"files": {
9+
"ignoreUnknown": false,
10+
"includes": ["src/**/*"]
11+
},
12+
"formatter": {
13+
"enabled": true,
14+
"indentStyle": "tab"
15+
},
16+
"linter": {
17+
"enabled": true,
18+
"rules": {
19+
"recommended": true
20+
}
21+
},
22+
"javascript": {
23+
"formatter": {
24+
"quoteStyle": "double"
25+
}
26+
},
27+
"assist": {
28+
"enabled": true,
29+
"actions": {
30+
"source": {
31+
"organizeImports": "on"
32+
}
33+
}
34+
}
35+
}

bun.lock

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "devdenbot",
3-
"version": "8.4.5",
3+
"version": "9.0.0",
44
"type": "module",
55
"main": "src/index.ts",
66
"engines": {
@@ -66,6 +66,7 @@
6666
],
6767
"repository": "https://github.com/TheDeveloperDen/DevDenBot.git",
6868
"devDependencies": {
69+
"@biomejs/biome": "^2.2.2",
6970
"@eslint/eslintrc": "^3.3.1",
7071
"@eslint/js": "^9.32.0",
7172
"@microsoft/eslint-formatter-sarif": "3.1.0",

src/Config.prod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { actualMention } from "./util/users.js";
2-
import { Config } from "./config.type.js";
2+
import type { Config } from "./config.type.js";
33
import { ButtonBuilder, ButtonStyle, EmbedBuilder } from "discord.js";
44

55
// Config file for the Developer Den server (.gg/devden)

src/Config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { actualMention } from "./util/users.js";
2-
import { Config } from "./config.type.js";
2+
import type { Config } from "./config.type.js";
33
import { config as prodConfig } from "./Config.prod.js";
44

55
// Config file for the DevDen Testing server

src/config.type.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Snowflake } from "discord.js";
2-
import { BrandingConfig } from "./util/branding.js";
3-
import { InformationMessage } from "./modules/information/information.js";
1+
import type { Snowflake } from "discord.js";
2+
import type { BrandingConfig } from "./util/branding.js";
3+
import type { InformationMessage } from "./modules/information/information.js";
44

55
export interface Config {
66
guildId: string;

src/logging.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { createLogger, format, transports } from "winston";
2-
import * as path from "path";
1+
import * as path from "node:path";
32
import { stringify } from "safe-stable-stringify";
3+
import { createLogger, format, transports } from "winston";
44

55
const timestamp = format.timestamp({
66
format: "YYYY-MM-DD HH:mm:ss",
@@ -51,7 +51,7 @@ const cliFormat = format.combine(
5151
const metaString = Object.keys(filteredMeta).length
5252
? stringify(filteredMeta, null, 2)
5353
: "";
54-
return `[${timestamp}] ${level}${source ? ` (${source})` : ""}: ${message}${metaString ? " " + metaString : ""}`;
54+
return `[${timestamp}] ${level}${source ? ` (${source})` : ""}: ${message}${metaString ? ` ${metaString}` : ""}`;
5555
}),
5656
);
5757

src/modules/askToAsk.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import Module from "./module.js";
2-
import { getOrCreateUserById } from "../store/models/DDUser.js";
31
import stringSimilarity from "string-similarity";
42
import { logger } from "../logging.js";
3+
import { getOrCreateUserById } from "../store/models/DDUser.js";
54
import { FAQ } from "../store/models/FAQ.js";
5+
import { isSpecialUser } from "../util/users.js";
66
import { createFaqEmbed } from "./faq/faq.util.js";
7+
import type Module from "./module.js";
78
import { tierOf } from "./xp/xpRoles.util.js";
8-
import { isSpecialUser } from "../util/users.js";
99

1010
const targets = [
1111
"i need help",

src/modules/core/bump.listener.test.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import { afterEach, beforeAll, expect, mock, test } from "bun:test";
2-
import {
3-
handleBumpStreak,
4-
setLastBumpNotificationTime,
5-
} from "./bump.listener.js";
6-
import {
2+
import type {
73
Client,
84
Message,
95
MessageInteraction,
106
PartialTextBasedChannelFields,
117
User,
128
} from "discord.js";
9+
import { Bump } from "../../store/models/Bump.js";
10+
import { clearBumpsCache } from "../../store/models/bumps.js";
1311
import {
1412
clearUserCache,
1513
getOrCreateUserById,
1614
} from "../../store/models/DDUser.js";
1715
import { getSequelizeInstance, initStorage } from "../../store/storage.js";
18-
import { Bump } from "../../store/models/Bump.js";
19-
import { clearBumpsCache } from "../../store/models/bumps.js";
16+
import {
17+
handleBumpStreak,
18+
setLastBumpNotificationTime,
19+
} from "./bump.listener.js";
2020

2121
beforeAll(async () => {
2222
await initStorage();
@@ -107,9 +107,7 @@ test("simple bump with big streak", async () => {
107107
for (let i = 0; i < 9; i++) {
108108
await Bump.create({
109109
userId: BigInt(fakeUser.id),
110-
timestamp: new Date(
111-
new Date().getTime() - 1000 * 60 * 60 * 24 * (10 - i),
112-
),
110+
timestamp: new Date(Date.now() - 1000 * 60 * 60 * 24 * (10 - i)),
113111
messageId: BigInt(10 + i),
114112
});
115113
}
@@ -136,7 +134,7 @@ test("simple bump with big streak", async () => {
136134

137135
test("speedy bump ", async () => {
138136
const { ddUser, fakeUser, mockReact, mockChannel } = await setupMocks();
139-
setLastBumpNotificationTime(new Date(new Date().getTime() - 1000));
137+
setLastBumpNotificationTime(new Date(Date.now() - 1000));
140138
await handleBumpStreak(
141139
ddUser,
142140
{ user: fakeUser } as unknown as MessageInteraction,
@@ -157,9 +155,7 @@ test("End other user's streak", async () => {
157155
for (let i = 0; i < 5; i++) {
158156
await Bump.create({
159157
userId: BigInt(fakeUser.id),
160-
timestamp: new Date(
161-
new Date().getTime() - 1000 * 60 * 60 * 24 * (10 - i),
162-
),
158+
timestamp: new Date(Date.now() - 1000 * 60 * 60 * 24 * (10 - i)),
163159
messageId: BigInt(10 + i),
164160
});
165161
}

0 commit comments

Comments
 (0)