Skip to content

Commit

Permalink
chore: add cache limits
Browse files Browse the repository at this point in the history
  • Loading branch information
paring-chan committed Aug 6, 2022
1 parent 586bd16 commit c2c9d84
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"typescript": "4.7.4"
},
"dependencies": {
"@pikokr/command.ts": "5.0.7",
"@pikokr/command.ts": "^5.1.7",
"@sentry/node": "7.7.0",
"@sentry/tracing": "7.7.0",
"@trpc/server": "9.26.2",
Expand Down
12 changes: 12 additions & 0 deletions bot/src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {
ApplicationCommandType,
ChatInputCommandInteraction,
Client,
Options,
Partials,
} from "discord.js"
import path from "path"
import { YPClient } from "./structures/YPClient"
Expand Down Expand Up @@ -54,6 +56,16 @@ class DevModule extends Extension {

export const client = new Client({
intents: ["MessageContent", "Guilds", "DirectMessages", "GuildMessages"],
partials: [
Partials.User,
Partials.ThreadMember,
Partials.Channel,
Partials.GuildMember,
],
makeCache: Options.cacheWithLimits({
MessageManager: 0,
PresenceManager: 0,
}),
})

export const cts = new YPClient(client, logger)
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@pikokr/command.ts@5.0.7":
version "5.0.7"
resolved "https://registry.yarnpkg.com/@pikokr/command.ts/-/command.ts-5.0.7.tgz#deab1c52700247ef40e770aed04b7575a9f99795"
integrity sha512-9/qfSUFima4JMyqzdMYD7yHMG38dq+b+laMJy9BARSLjH2sIKDlOaM/nBtI1rdmrv+d949P9rRBVQyEtlXTrPg==
"@pikokr/command.ts@^5.1.7":
version "5.1.7"
resolved "https://registry.yarnpkg.com/@pikokr/command.ts/-/command.ts-5.1.7.tgz#02f309a06e7fa70fce61f1ae02dbe3109c3b0dca"
integrity sha512-QJYlFZg9omgSG5Bqnyw6RCZQCNzGZ0qWy+f6vgseu0HF3L+PRPgU3Sy2KmCNaF0wlnpXyBE75noZxcMmO/sOLA==
dependencies:
"@types/node" "^16.0.0"
chalk "4.1.2"
Expand Down

0 comments on commit c2c9d84

Please sign in to comment.