Skip to content

Commit

Permalink
feat: Bump dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
vxern committed Aug 18, 2024
1 parent 709caba commit 2ff50b9
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 76 deletions.
Binary file modified bun.lockb
Binary file not shown.
24 changes: 11 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "logos",
"description": "A multi-purpose community bot built to cater to language-learning communities on Discord.",
"license": "Apache-2.0",
"version": "4.20.2",
"version": "4.20.3",
"type": "module",
"keywords": [
"discord",
Expand Down Expand Up @@ -44,34 +44,32 @@
"start": "bun run ./source/index.ts"
},
"dependencies": {
"@discordeno/bot": "19.0.0-next.d81b28a",
"@discordeno/bot": "19.0.0-next.a0510da",
"cldpre": "^2.9.0",
"dexonline-scraper": "^0.2.1",
"dotenv": "^16.4.5",
"eld": "github:vxern/efficient-language-detector-js#b8f7a21413bef94fc71207241748f4a1d0089cd3",
"event-stream": "^4.0.1",
"fastest-levenshtein": "^1.0.16",
"fasttext.wasm.js": "^1.0.0",
"ioredis": "^5.4.1",
"mongodb": "^6.7.0",
"nano": "^10.1.3",
"mongodb": "^6.8.0",
"nano": "^10.1.4",
"nanoid": "^5.0.7",
"object-hash": "^3.0.0",
"ravendb": "^5.4.2",
"rethinkdb-ts": "^2.6.0",
"ravendb": "^5.4.3",
"rethinkdb-ts": "^2.6.1",
"shoukaku": "^4.0.1",
"tinyld": "^1.3.4",
"wiktionary-scraper": "^0.0.1-patch.3",
"winston": "^3.13.0",
"winston": "^3.14.2",
"youtube-sr": "^4.3.11"
},
"devDependencies": {
"@biomejs/biome": "1.8.1",
"@types/bun": "^1.1.4",
"@types/chai": "^4.3.16",
"@types/event-stream": "^4.0.5",
"@biomejs/biome": "1.8.3",
"@types/bun": "^1.1.6",
"@types/chai": "^4.3.17",
"@types/object-hash": "^3.0.6",
"chai": "^5.1.1",
"typescript": "^5.4.5"
"typescript": "^5.5.4"
}
}
1 change: 0 additions & 1 deletion source/constants/licences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ You must also include, in your app or site, wherever you provide attributions or
"dexonline-scraper": mit('Copyright (c) 2023 Dorian "vxern" Oszczęda'),
dotenv: bsd("Copyright (c) 2015, Scott Motte"),
eld: apache("Copyright 2023 Nito T.M."),
"event-stream": mit("Copyright (c) 2011 Dominic Tarr"),
"fastest-levenshtein": mit("Copyright (c) 2020 Kasper Unn Weihe"),
"fasttext.wasm.js": mit("Copyright (c) 2023 Yuns <https://github.com/yunsii>"),
ioredis: mit("Copyright (c) 2015-2022 Zihua Li"),
Expand Down
110 changes: 60 additions & 50 deletions source/constants/properties.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
const properties = {
attachment: {
id: true,
filename: true,
contentType: true,
url: true,
proxyUrl: true,
},
channel: {
guildId: true,
position: true,
id: true,
name: true,
parentId: true,
type: true,
rateLimitPerUser: true,
permissionOverwrites: true,
},
forumTag: {},
emoji: {
id: true,
name: true,
roles: true,
user: true,
},
defaultReactionEmoji: {},
guild: {
description: true,
icon: true,
Expand All @@ -13,23 +38,20 @@ const properties = {
shardId: true,
voiceStates: true,
},
channel: {
guildId: true,
position: true,
interaction: {
id: true,
name: true,
parentId: true,
applicationId: true,
type: true,
rateLimitPerUser: true,
permissionOverwrites: true,
},
user: {
avatar: true,
discriminator: true,
id: true,
username: true,
bot: true,
guildId: true,
channelId: true,
member: true,
user: true,
token: true,
data: true,
locale: true,
guildLocale: true,
},
invite: {},
member: {
avatar: true,
permissions: true,
Expand All @@ -51,9 +73,14 @@ const properties = {
embeds: true,
author: true,
attachments: true,
interaction: {},
messageReference: {},
interaction: true,
messageReference: true,
},
messageSnapshot: {},
messageInteractionMetadata: {},
messageInteraction: {},
messageReference: {},
messageCall: {},
role: {
guildId: true,
id: true,
Expand All @@ -62,52 +89,35 @@ const properties = {
permissions: true,
color: true,
},
emoji: {
id: true,
name: true,
roles: true,
user: true,
},
attachment: {
id: true,
filename: true,
contentType: true,
url: true,
proxyUrl: true,
},
interaction: {
id: true,
applicationId: true,
type: true,
guildId: true,
channelId: true,
member: true,
user: true,
token: true,
data: true,
locale: true,
guildLocale: true,
},
invite: {},
scheduledEvent: {},
scheduledEventRecurrenceRule: {},
stageInstance: {},
inviteStageInstance: {},
sticker: {},
webhook: {},
guildOnboarding: {
prompts: {
options: {},
},
user: {
avatar: true,
discriminator: true,
id: true,
username: true,
toggles: true,
},
avatarDecorationData: {},
webhook: {},
guildOnboarding: {},
guildOnboardingPrompt: {},
guildOnboardingPromptOption: {},
entitlement: {},
sku: {},
// REMINDER(vxern): Remove once added in Discordeno.
// @ts-ignore: This is fine.
voiceState: {
guildId: true,
channelId: true,
userId: true,
},
poll: {},
pollAnswer: {},
pollResult: {},
pollAnswerCount: {},
pollMedia: {},
} as const satisfies Discord.DesiredProperties;
type Properties = typeof properties;

Expand Down
6 changes: 1 addition & 5 deletions source/library/adapters/databases/ravendb/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ class RavenDBAdapter extends DatabaseAdapter {
const protocol = certificate !== undefined ? "https" : "http";

const url = `${protocol}://${host}:${port}`;
if (certificate !== undefined) {
this.#database = new ravendb.DocumentStore(url, database, { certificate, type: "pfx" });
} else {
this.#database = new ravendb.DocumentStore(url, database);
}
this.#database = new ravendb.DocumentStore(url, database, { certificate, type: "pfx" });

// @ts-expect-error: We don't want RavenDB to be setting the `id` property on documents since we handle that
// ourselves.
Expand Down
6 changes: 5 additions & 1 deletion source/library/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,11 @@ class Client {
gateway: {
token: environment.discordSecret,
events: {},
cache: { requestMembers: { enabled: true, pending: new Discord.Collection() } },
cache: {
requestMembers: {
enabled: true,
},
},
},
});

Expand Down
4 changes: 3 additions & 1 deletion source/library/commands/handlers/information/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ function getProficiencyRoleDistribution(client: Client, guild: Logos.Guild): Pro
.sort((a, b) => a.position - b.position)
.map((role) => role.id);

const members = guild.members.array().filter((member) => !client.entities.users.get(member.id)?.bot ?? true);
const members = guild.members
.array()
.filter((member) => !client.entities.users.get(member.id)?.toggles?.has("bot") ?? true);

let withoutProficiencyRole = 0;
const roleFrequencies: Record<`${bigint}`, number> = Object.fromEntries(
Expand Down
3 changes: 1 addition & 2 deletions source/library/stores/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ class EventStore {
this.collectEvent(payload.guildId, "messageDelete", { args: [payload, message] }),
messageDeleteBulk: (payload) =>
this.collectEvent(payload.guildId, "messageDeleteBulk", { args: [payload] }),
messageUpdate: (message, oldMessage) =>
this.collectEvent(message.guildId, "messageUpdate", { args: [message, oldMessage] }),
messageUpdate: (message) => this.collectEvent(message.guildId, "messageUpdate", { args: [message] }),
voiceServerUpdate: (payload) =>
this.collectEvent(payload.guildId, "voiceServerUpdate", { args: [payload] }),
voiceStateUpdate: (voiceState) =>
Expand Down
4 changes: 2 additions & 2 deletions source/library/stores/journalling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,13 @@ class JournallingStore {
await this.tryLog("messageDelete", { guildId, args: [payload, message] });
}

async #messageUpdate(message: Discord.Message, oldMessage: Discord.Message | undefined): Promise<void> {
async #messageUpdate(message: Discord.Message): Promise<void> {
const guildId = message.guildId;
if (guildId === undefined) {
return;
}

await this.tryLog("messageUpdate", { guildId, args: [message, oldMessage] });
await this.tryLog("messageUpdate", { guildId, args: [message] });
}

async #getKickInformation({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { codeMultiline, mention, trim } from "logos:core/formatting";
import type { EventLogger } from "logos/stores/journalling/loggers";

const logger: EventLogger<"messageUpdate"> = (client, [message, _], { guildLocale }) => {
const logger: EventLogger<"messageUpdate"> = (client, [message], { guildLocale }) => {
const oldMessage = client.entities.messages.previous.get(message.id);
if (oldMessage === undefined) {
return undefined;
Expand Down

0 comments on commit 2ff50b9

Please sign in to comment.