-
Notifications
You must be signed in to change notification settings - Fork 4
Feat/personification #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… quality and organization - Added `import-x` plugin and TypeScript resolver to ESLint configuration. - Updated dependencies in `package.json` and `bun.lock` for ESLint and Prettier plugins. - Refactored imports in `discord.ts` and `stream.ts` for better organization and clarity.
…ty and consistency - Adjusted import statements in `deploy-commands.ts`, `index.ts`, and various command files to enhance readability. - Ensured consistent ordering of imports in `message-create` event handlers and utility files. - Removed redundant imports and streamlined code structure in several modules.
…ell checking - Corrected spelling for "ASSEMBLYAI" to "assemblyai" and "ELEVENLABS" to "ElevenLabs". - Added new entries "HackClub" and "OpenRouter" to the cSpell dictionary.
…ence - Commented out the `hackclub`, `openrouter`, and `google` provider configurations in `providers.ts` to prevent unused code while maintaining the option to re-enable them later.
…ders.ts - Removed unused import statements for `env`, `createGoogleGenerativeAI`, `createOpenAICompatible`, and `createOpenRouter` to clean up the code and improve maintainability.
…ment configuration
…nse prompts for better user interaction
…language model references
WalkthroughThis update introduces a new GitHub Actions CI workflow and a reusable setup action, both automating code quality checks (linting, type-checking, formatting, spelling). It also changes the project license to MIT, removes the Prettier config, and applies extensive formatting and whitespace normalization across the codebase and configuration files, without altering any logic or functionality. Changes
Sequence Diagram(s)sequenceDiagram
participant PR as Pull Request
participant CI as GitHub Actions CI Workflow
participant Setup as Setup Action
participant Bun as Bun Tool
PR->>CI: Open PR targeting main branch
CI->>Setup: Run reusable setup action
Setup->>Bun: Install Bun, restore cache, install dependencies
Setup->>Setup: Create .env.local with placeholders
CI->>Bun: Run lint/typecheck/format:check/check:spelling jobs
Bun->>CI: Return results for each job
CI->>PR: Report status (pass/fail)
Poem
✨ Finishing Touches
🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 13
🔭 Outside diff range comments (3)
src/utils/voice/helpers/deepgram.ts (1)
1-24
: ESLint import resolution
Theimport-x/no-unresolved
warning for@deepgram/sdk
is a false positive if your resolver isn’t configured for Node modules/TypeScript paths. Verify your ESLint settings (e.g.,settings.import/resolver
) so dependencies resolve correctly.src/utils/triggers.ts (1)
1-28
: ESLint import resolution
The reportedimport-x/no-unresolved
ondiscord.js
is likely a resolver configuration issue. Ensure ESLint is set up to handle Node modules and any TS path aliases.TODO.md (1)
1-34
: Markdown structure
Consider adding a top-level heading (# TODO
) to satisfy markdownlint’s MD041 rule and improve document clarity.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (56)
.cspell.json
(1 hunks).editorconfig
(1 hunks).eslintrc.json
(1 hunks).github/FUNDING.yml
(1 hunks).github/actions/setup/action.yml
(1 hunks).github/pull-request-template.md
(1 hunks).github/workflows/ci.yml
(1 hunks).prettierrc.json
(0 hunks)README.md
(1 hunks)TODO.md
(1 hunks)commitlint.config.ts
(1 hunks)package.json
(1 hunks)src/commands/channels.ts
(1 hunks)src/commands/chat.ts
(1 hunks)src/commands/index.ts
(1 hunks)src/commands/ping.ts
(1 hunks)src/commands/voice-channel/index.ts
(1 hunks)src/commands/voice-channel/join.ts
(1 hunks)src/commands/voice-channel/leave.ts
(1 hunks)src/config.ts
(1 hunks)src/deploy-commands.ts
(1 hunks)src/env.ts
(1 hunks)src/events/index.ts
(1 hunks)src/events/message-create/index.ts
(1 hunks)src/events/message-create/utils/relevance.ts
(1 hunks)src/events/message-create/utils/respond.ts
(1 hunks)src/index.ts
(1 hunks)src/lib/ai/prompts.ts
(1 hunks)src/lib/ai/providers.ts
(1 hunks)src/lib/ai/tools/discord.ts
(1 hunks)src/lib/ai/tools/get-weather.ts
(1 hunks)src/lib/ai/tools/report.ts
(1 hunks)src/lib/ai/tools/search-web.ts
(1 hunks)src/lib/kv.ts
(1 hunks)src/lib/logger.ts
(1 hunks)src/lib/queries.ts
(1 hunks)src/lib/search.ts
(1 hunks)src/lib/validators/index.ts
(1 hunks)src/lib/validators/probability.ts
(1 hunks)src/utils/context.ts
(1 hunks)src/utils/delay.ts
(1 hunks)src/utils/discord.ts
(1 hunks)src/utils/log.ts
(1 hunks)src/utils/message-rate-limiter.ts
(1 hunks)src/utils/messages.ts
(1 hunks)src/utils/sandbox.ts
(1 hunks)src/utils/status.ts
(1 hunks)src/utils/time.ts
(1 hunks)src/utils/tokenize-messages.ts
(1 hunks)src/utils/triggers.ts
(1 hunks)src/utils/voice/helpers/ai.ts
(1 hunks)src/utils/voice/helpers/audio.ts
(1 hunks)src/utils/voice/helpers/deepgram.ts
(1 hunks)src/utils/voice/helpers/index.ts
(1 hunks)src/utils/voice/stream.ts
(1 hunks)tsconfig.json
(1 hunks)
💤 Files with no reviewable changes (1)
- .prettierrc.json
🧰 Additional context used
🧬 Code Graph Analysis (14)
src/lib/ai/tools/report.ts (1)
src/utils/messages.ts (1)
MinimalContext
(10-13)
src/utils/message-rate-limiter.ts (2)
src/lib/kv.ts (2)
redisKeys
(19-24)redis
(7-10)src/config.ts (1)
messageThreshold
(23-23)
src/deploy-commands.ts (2)
src/commands/index.ts (1)
commands
(6-11)src/env.ts (1)
env
(4-58)
src/utils/status.ts (2)
src/config.ts (2)
activities
(16-21)statuses
(15-15)src/index.ts (1)
client
(9-23)
src/lib/logger.ts (1)
src/env.ts (1)
env
(4-58)
src/utils/triggers.ts (1)
src/config.ts (1)
keywords
(3-3)
src/lib/search.ts (1)
src/env.ts (1)
env
(4-58)
src/utils/voice/helpers/deepgram.ts (1)
src/env.ts (1)
env
(4-58)
src/lib/kv.ts (1)
src/env.ts (1)
env
(4-58)
src/utils/delay.ts (1)
src/utils/tokenize-messages.ts (2)
normalize
(10-17)sentences
(3-8)
src/lib/ai/tools/search-web.ts (1)
src/lib/search.ts (1)
exa
(10-10)
src/utils/context.ts (5)
src/utils/messages.ts (2)
MinimalContext
(10-13)convertToModelMessages
(15-33)src/lib/ai/prompts.ts (1)
RequestHints
(3-12)src/lib/queries.ts (2)
getMessagesByChannel
(11-28)getChannelName
(30-42)src/config.ts (2)
initialMessages
(24-35)timezone
(6-6)src/utils/time.ts (1)
getTimeInCity
(4-11)
src/utils/log.ts (1)
src/utils/triggers.ts (1)
TriggerType
(3-3)
src/utils/time.ts (1)
src/config.ts (1)
timezone
(6-6)
🪛 ESLint
src/lib/ai/tools/report.ts
[error] 3-3: Unable to resolve path to module 'ai'.
(import-x/no-unresolved)
[error] 4-4: Unable to resolve path to module 'zod/v4'.
(import-x/no-unresolved)
src/utils/discord.ts
[error] 1-1: Unable to resolve path to module 'discord.js'.
(import-x/no-unresolved)
src/commands/voice-channel/join.ts
[error] 8-8: Unable to resolve path to module '@discordjs/voice'.
(import-x/no-unresolved)
src/commands/ping.ts
[error] 1-1: Unable to resolve path to module 'discord.js'.
(import-x/no-unresolved)
src/deploy-commands.ts
[error] 2-2: Unable to resolve path to module 'discord.js'.
(import-x/no-unresolved)
src/utils/voice/helpers/ai.ts
[error] 3-3: Unable to resolve path to module 'ai'.
(import-x/no-unresolved)
src/utils/status.ts
[error] 4-4: Unable to resolve path to module 'discord.js'.
(import-x/no-unresolved)
src/lib/logger.ts
[error] 5-5: Unable to resolve path to module 'pino'.
(import-x/no-unresolved)
src/utils/triggers.ts
[error] 1-1: Unable to resolve path to module 'discord.js'.
(import-x/no-unresolved)
src/commands/voice-channel/index.ts
[error] 1-1: Unable to resolve path to module 'discord.js'.
(import-x/no-unresolved)
src/events/message-create/utils/respond.ts
[error] 9-9: Unable to resolve path to module '@mem0/vercel-ai-provider'.
(import-x/no-unresolved)
[error] 11-11: Unable to resolve path to module 'ai'.
(import-x/no-unresolved)
src/lib/ai/tools/get-weather.ts
[error] 1-1: Unable to resolve path to module 'ai'.
(import-x/no-unresolved)
[error] 2-2: Unable to resolve path to module 'zod/v4'.
(import-x/no-unresolved)
src/lib/search.ts
[error] 2-2: Unable to resolve path to module 'exa-js'.
(import-x/no-unresolved)
src/utils/voice/helpers/deepgram.ts
[error] 2-2: Unable to resolve path to module '@deepgram/sdk'.
(import-x/no-unresolved)
src/lib/kv.ts
[error] 2-2: Unable to resolve path to module '@upstash/ratelimit'.
(import-x/no-unresolved)
[error] 3-3: Unable to resolve path to module '@upstash/redis'.
(import-x/no-unresolved)
src/events/message-create/utils/relevance.ts
[error] 4-4: Unable to resolve path to module 'ai'.
(import-x/no-unresolved)
src/utils/delay.ts
[error] 3-3: Unable to resolve path to module 'discord.js'.
(import-x/no-unresolved)
src/lib/ai/providers.ts
[error] 1-1: Unable to resolve path to module 'ai'.
(import-x/no-unresolved)
[error] 3-3: Unable to resolve path to module '@ai-sdk/openai'.
(import-x/no-unresolved)
src/lib/validators/probability.ts
[error] 1-1: Unable to resolve path to module 'zod/v4'.
(import-x/no-unresolved)
src/lib/ai/tools/search-web.ts
[error] 3-3: Unable to resolve path to module 'ai'.
(import-x/no-unresolved)
[error] 4-4: Unable to resolve path to module 'zod/v4'.
(import-x/no-unresolved)
src/config.ts
[error] 1-1: Unable to resolve path to module 'discord.js'.
(import-x/no-unresolved)
src/utils/tokenize-messages.ts
[error] 1-1: Unable to resolve path to module 'compromise'.
(import-x/no-unresolved)
src/commands/voice-channel/leave.ts
[error] 1-1: Unable to resolve path to module '@discordjs/voice'.
(import-x/no-unresolved)
src/index.ts
[error] 7-7: Unable to resolve path to module 'discord.js'.
(import-x/no-unresolved)
src/commands/chat.ts
[error] 8-8: Unable to resolve path to module 'discord.js'.
(import-x/no-unresolved)
src/lib/queries.ts
[error] 9-9: Unable to resolve path to module 'discord.js'.
(import-x/no-unresolved)
src/utils/context.ts
[error] 6-6: Unable to resolve path to module '@mem0/vercel-ai-provider'.
(import-x/no-unresolved)
src/events/message-create/index.ts
[error] 10-10: Unable to resolve path to module 'discord.js'.
(import-x/no-unresolved)
src/utils/messages.ts
[error] 8-8: Unable to resolve path to module 'discord.js'.
(import-x/no-unresolved)
src/utils/time.ts
[error] 1-1: Unable to resolve path to module '@date-fns/tz'.
(import-x/no-unresolved)
[error] 2-2: Unable to resolve path to module 'date-fns'.
(import-x/no-unresolved)
src/commands/channels.ts
[error] 9-9: Unable to resolve path to module 'discord.js'.
(import-x/no-unresolved)
src/lib/ai/tools/discord.ts
[error] 6-6: Unable to resolve path to module 'ai'.
(import-x/no-unresolved)
[error] 8-8: Unable to resolve path to module 'zod/v4'.
(import-x/no-unresolved)
src/utils/voice/helpers/audio.ts
[error] 6-6: Unable to resolve path to module '@discordjs/voice'.
(import-x/no-unresolved)
src/utils/voice/stream.ts
[error] 3-3: Unable to resolve path to module '@deepgram/sdk'.
(import-x/no-unresolved)
[error] 8-8: Unable to resolve path to module '@discordjs/voice'.
(import-x/no-unresolved)
[error] 10-10: Unable to resolve path to module 'prism-media'.
(import-x/no-unresolved)
src/env.ts
[error] 1-1: Unable to resolve path to module '@t3-oss/env-core'.
(import-x/no-unresolved)
[error] 2-2: Unable to resolve path to module 'zod/v4'.
(import-x/no-unresolved)
🪛 YAMLlint (1.37.1)
.github/FUNDING.yml
[error] 1-1: wrong new line character: expected \n
(new-lines)
.github/actions/setup/action.yml
[error] 1-1: wrong new line character: expected \n
(new-lines)
.github/workflows/ci.yml
[error] 1-1: wrong new line character: expected \n
(new-lines)
[warning] 3-3: truthy value should be one of [false, true]
(truthy)
🪛 Biome (1.9.4)
src/utils/discord.ts
[error] 35-35: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
src/utils/voice/helpers/ai.ts
[error] 11-12: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
src/commands/chat.ts
[error] 36-36: Forbidden non-null assertion.
(lint/style/noNonNullAssertion)
🪛 LanguageTool
README.md
[locale-violation] ~29-~29: In American English, ‘afterward’ is the preferred variant. ‘Afterwards’ is more commonly used in British English and other dialects.
Context: ...idpolice.com/how-to-make-discord-bot/). Afterwards, you will need [Git][git] and [Bun][bun...
(AFTERWARDS_US)
TODO.md
[uncategorized] ~9-~9: Did you mean “its” (the possessive pronoun)?
Context: ...alistic.
Separate Deepgram code into it's files
Implement Conversation history f...
(ITS_PREMIUM)
[style] ~13-~13: The phrasing ‘more easy’ can sound awkward and informal. Consider using a comparative adjective or other alternative.
Context: ...).
Refactor the channels command to be more easy to use, with deny and allow lists.
D...
(MORE_EASY_N_CLEAR)
[typographical] ~15-~15: If specifying a range, consider using an en dash instead of a hyphen.
Context: ...he response before replying fully, wait 1-2 seconds (for one user). This adds dedup...
(HYPHEN_TO_EN)
[uncategorized] ~23-~23: A comma might be missing here.
Context: ...ram things are kept
When the user is typing increase the response speed by 0.5x. Al...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
[uncategorized] ~23-~23: Possible missing comma found.
Context: ... 0.5x. Also, use a different method for responding like a set WPM.
Add CI/CD testing so...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~25-~25: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...testing so pushing things to production don't break stuff.
Add context to when ...
(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)
[typographical] ~33-~33: Consider adding a comma here.
Context: ...the bot always remembers the same person no matter where they interact with it.
(NO_MATTER_COMMA)
.github/pull-request-template.md
[style] ~9-~9: Consider using a different verb for a more formal wording.
Context: ... [ ] Bug fix (non-breaking change which fixes an issue)
- New feature (non-break...
(FIX_RESOLVE)
🪛 markdownlint-cli2 (0.17.2)
README.md
1-1: Inline HTML
Element: h1
(MD033, no-inline-html)
10-10: Inline HTML
Element: a
(MD033, no-inline-html)
14-14: Inline HTML
Element: a
(MD033, no-inline-html)
27-27: Inline HTML
Element: a
(MD033, no-inline-html)
49-49: Inline HTML
Element: a
(MD033, no-inline-html)
55-55: Link and image reference definitions should be needed
Unused link or image reference definition: "pr"
(MD053, link-image-reference-definitions)
57-57: Link and image reference definitions should be needed
Unused link or image reference definition: "node"
(MD053, link-image-reference-definitions)
TODO.md
1-1: First line in a file should be a top-level heading
null
(MD041, first-line-heading, first-line-h1)
🪛 actionlint (1.7.7)
.github/workflows/ci.yml
56-56: description is required in metadata of "Check setup" action at "/home/jailuser/git/.github/actions/setup/action.yml"
(action)
🔇 Additional comments (71)
src/index.ts (7)
1-7
: Formatting-only: imports section standardizedThe import statements have been normalized and aligned without any functional changes.
9-23
: Formatting-only: client initialization unchangedClient configuration (intents and partials) has been reformatted for consistency; no logic modifications.
25-30
: Formatting-only: ClientReady event handlerThe
once(Events.ClientReady)
listener has been reformatted only. Functionality (logging and status updates) remains the same.
32-39
: Formatting-only: GuildCreate event handlerThe guild creation listener was whitespace-normalized; behavior (deploy commands and send greeting) is intact.
41-50
: Formatting-only: InteractionCreate event handlerThe interaction handler’s formatting was updated. Control flow (command check and execution) is unchanged.
52-60
: Formatting-only: dynamic event registration loopThe loop registering events has been reformatted; no changes to event wiring logic.
62-62
: Formatting-only: login call remains the sameThe
client.login
invocation was whitespace-adjusted only.src/lib/validators/probability.ts (2)
6-8
: Stylistic change only: removed trailing comma
This .describe() call had its trailing comma removed for consistency; no functional impact.
12-14
: Stylistic change only: removed trailing comma
The second .describe() also lost its trailing comma—purely formatting.src/lib/validators/index.ts (1)
1-1
: Formatting-only update: export whitespace
This change only adjusts whitespace in the export statement and does not alter functionality..github/FUNDING.yml (1)
1-3
: Skip formatting-only change.
These line ending adjustments don’t affect functionality or content.README.md (1)
49-51
: Ensure LICENSE file content matches the MIT license.
The README now states “MIT license,” but confirm that theLICENSE
file itself has been updated from AGPL-v3 to MIT.src/lib/ai/tools/get-weather.ts (1)
11-13
: Approve removal of extraneous trailing comma.
This formatting fix in the fetch URL has no impact on logic or behavior.commitlint.config.ts (1)
1-1
: Skip formatting-only change.
No configuration or logic changes here—only whitespace normalization.src/events/index.ts (1)
1-6
: Skip line ending normalization.
This update standardizes CRLF line endings but doesn’t touch any imports or logic.src/commands/ping.ts (1)
1-9
: Formatting-only change
All modifications here are whitespace and line-ending normalizations without any logic or behavior changes.src/utils/voice/helpers/index.ts (1)
1-3
: Formatting-only change
This file’s exports were re-serialized with different line endings only; functionality remains unchanged.src/config.ts (1)
1-40
: Formatting-only change
The entire file was reformatted (whitespace/line endings); no semantic or configuration values were altered.src/utils/status.ts (1)
30-33
: Formatting-only change
The trailing comma in the parameters list was removed for style consistency; logic is untouched.src/commands/index.ts (1)
1-11
: Formatting-only change
Whitespace and newline adjustments only; imports and the exportedcommands
object remain the same.src/utils/sandbox.ts (1)
1-50
: LGTM! Formatting changes look good.The formatting cleanup is consistent and the sandbox implementation is well-structured. The timeout handling and error management are appropriately implemented.
src/lib/logger.ts (2)
1-40
: LGTM! Formatting changes are consistent.The logging configuration is well-structured with appropriate file and console transports.
18-20
: To confirm that top‐level await is fully supported, we need to see your Node.js engine requirement:#!/bin/bash # Print the Node.js version constraint from engines jq '.engines.node' package.jsonsrc/lib/ai/tools/report.ts (2)
1-34
: LGTM! Well-implemented content moderation tool.The formatting changes are consistent, and the content reporting functionality is well-designed with proper logging and clear user feedback.
8-9
: Good enforcement of content moderation policy.The description clearly states that reporting is mandatory regardless of user input, which is a solid approach for content moderation.
src/env.ts (1)
1-58
: LGTM! Comprehensive environment configuration.The formatting normalization is good, and the environment schema is well-structured with appropriate validation, defaults, and documentation.
src/deploy-commands.ts (1)
1-43
: LGTM! Clean command deployment implementation.The formatting changes are consistent and the deployment logic is well-structured with proper separation of guild and global command deployment.
src/lib/queries.ts (2)
1-9
: Verify module resolution fordiscord.js
import
ESLint reportsimport-x/no-unresolved
for'discord.js'
. Confirm thatdiscord.js
is installed and that your TypeScript/ESLint resolvers are configured to locate it.
1-28
: Formatting only: trailing comma & whitespace normalization
All adjustments in this file are stylistic (removing trailing commas, normalizing line endings). No logic or behavior has changed.src/lib/kv.ts (2)
2-3
: Verify module resolution for Upstash imports
ESLint flagsimport-x/no-unresolved
for@upstash/ratelimit
and@upstash/redis
. Ensure these packages are installed and that your resolver is configured correctly.
1-25
: Formatting only: no functional changes
This hunk is purely whitespace and line-ending normalization. The exportedredis
,ratelimit
, andredisKeys
definitions remain unchanged in logic..github/pull-request-template.md (1)
1-26
: Formatting only: CRLF normalization
All changes here convert LF to CRLF line endings. The template’s content, structure, and checklist items are untouched.src/utils/discord.ts (2)
1-1
: Verify module resolution fordiscord.js
import
ESLint reportsimport-x/no-unresolved
here. Confirmdiscord.js
is present in dependencies and your resolver settings cover it.
73-75
: Formatting only: trailing comma removal
This change removes a trailing comma in the JSON replacer; behavior is unaffected.src/lib/ai/providers.ts (2)
1-3
: Verify module resolution for external imports
ESLint flagsimport-x/no-unresolved
for both'ai'
and'@ai-sdk/openai'
. Please confirm these packages exist in package.json and that your module resolver is configured to find them.
1-31
: Formatting only: CRLF line ending conversion
This file’s edits are limited to converting LF to CRLF line endings; no code logic or exported APIs were changed.src/utils/message-rate-limiter.ts (1)
1-20
: Formatting-only changes
All edits in this file are whitespace normalization and minor style tweaks—no functional or API changes.src/utils/voice/helpers/deepgram.ts (1)
1-24
: Formatting-only changes
Only trailing commas and line breaks were adjusted; logic remains identical.src/utils/triggers.ts (1)
1-28
: Formatting-only changes
This diff only normalizes whitespace; no behavior was altered.TODO.md (1)
1-34
: Formatting-only changes
List markers were switched from-
to+
without semantic edits.tsconfig.json (2)
1-32
: Formatting-only changes
All compiler settings remain intact; edits are purely stylistic.
1-32
: Inconsistent AI summary
The AI-generated summary mentions replacing ASCII quotes/braces with full-width Unicode characters, but this file still uses standard ASCII—summary appears incorrect.Likely an incorrect or invalid review comment.
src/utils/messages.ts (1)
1-70
: Stylistic formatting only – no functional changesAll edits remove trailing commas, adjust line breaks, and standardize spacing without altering any logic, control flow, or exported types.
src/utils/log.ts (1)
1-40
: Stylistic formatting only – no functional changesChanges consist solely of trailing comma removals and minor whitespace normalization; the logging logic and function signatures remain untouched.
src/utils/tokenize-messages.ts (1)
1-17
: Stylistic formatting only – no functional changesThe updates remove trailing commas and realign indentation in the
sentences
andnormalize
functions without affecting their behavior.package.json (1)
1-95
: Stylistic formatting only – no functional changesReformatted JSON to enforce consistent quoting, trailing commas, and indentation. No dependency versions or script definitions were modified.
src/utils/delay.ts (1)
1-75
: Stylistic formatting only – no functional changesAll changes are limited to whitespace and trailing comma adjustments; the delay calculation and message sending logic remain the same.
src/lib/ai/prompts.ts (1)
1-186
: Formatting-only changes; no functional modifications to prompt logic..editorconfig (1)
8-10
: Validatequote_type
support. Thequote_type
property is not part of the EditorConfig standard and may not be recognized by most editors or plugins. If this is intended for a specific plugin, please document its usage or consider configuring quote styles in an appropriate formatter.src/commands/channels.ts (1)
1-126
: Purely whitespace and trailing comma formatting; no logic changes detected. The import resolution errors seem to be false positives due to path aliases configured in TS.src/utils/voice/helpers/ai.ts (1)
1-4
: Only formatting adjustments; function logic remains unchanged.Also applies to: 8-19
src/utils/context.ts (2)
1-48
: No functional changes—formatting only. The diff applies whitespace normalization and indentation adjustments across this file without altering any logic inbuildChatContext
. All branches and return values remain intact.
6-6
: Verify module resolution for '@mem0/vercel-ai-provider'. ESLint flagged an unresolved import here. Please confirm that@mem0/vercel-ai-provider
is listed as a dependency and that your TypeScript and ESLint configs support path alias resolution.src/lib/search.ts (2)
1-11
: No functional changes—formatting only. Only import spacing and comment indentation were adjusted; the instantiation ofExa
withenv.EXA_API_KEY
remains unchanged.
2-2
: Verifyexa-js
dependency. ESLint reports an unresolved import forexa-js
. Ensure it's installed inpackage.json
or that your module resolver is configured correctly.src/commands/voice-channel/index.ts (1)
1-34
: No functional changes—formatting only. Removed a few trailing commas and normalized whitespace around the subcommand builders and theexecute
signature. Command registration and dispatch logic are unchanged.src/events/message-create/utils/relevance.ts (1)
1-32
: No functional changes—formatting only. Adjusted line breaks and removed trailing commas inassessRelevance
, but the try/catch logic, object generation, and error fallback remain the same.src/commands/voice-channel/join.ts (1)
1-59
: No functional changes—formatting only. Formatting updates include removal of trailing commas and consistent indentation; the core flow for deferring the reply, establishing a voice connection, and handling playback is untouched..eslintrc.json (1)
1-35
: Formatting-only update
This reformat maintains the existing ESLint configuration without semantic changes. All config values and rules remain unchanged.src/lib/ai/tools/search-web.ts (2)
1-4
: Formatting-only change
Whitespace and indentation were normalized; no functional modifications were made to thesearchWeb
tool.
1-4
: Verify module resolution
ESLint reports unresolved imports for'ai'
and'zod/v4'
. Please confirm that these packages are installed and that your TS/ESLint resolver configuration supports these module paths..cspell.json (1)
1-36
: Formatting-only update
The CSpell configuration was reformatted without content changes.src/events/message-create/utils/respond.ts (2)
1-11
: Formatting-only cleanup
This commit removes trailing commas and normalizes whitespace; function logic and exports are unchanged.
9-11
: Verify module resolution
Static analysis flags imports from@mem0/vercel-ai-provider
andai
as unresolved. Ensure these packages are installed and your import aliases or path mappings are correctly configured.src/commands/voice-channel/leave.ts (1)
8-10
: Formatting-only update
Removed trailing comma from theexecute
function signature; no behavior changes.src/events/message-create/index.ts (1)
10-10
: Verify module resolution for 'discord.js' import.
ESLint reports an unresolved path fordiscord.js
. Confirmtsconfig.json
and alias configuration support this import, or adjust the import path accordingly.src/commands/chat.ts (1)
8-8
: Verify 'discord.js' import path.
ESLint flags an unresolved import fordiscord.js
. Ensure module resolution and path aliases are correctly configured intsconfig.json
, or update the import path.src/utils/voice/helpers/audio.ts (1)
1-6
: Verify '@discordjs/voice' import resolution.
ESLint reports an unresolved path for@discordjs/voice
. Confirm that dependencies are installed and that module aliases are correctly configured.src/utils/voice/stream.ts (1)
3-3
: Verify dependency imports.
ESLint flags unresolved imports for@deepgram/sdk
,@discordjs/voice
, andprism-media
. Ensure these packages are installed and module resolution is configured properly.Also applies to: 8-8, 10-10
src/lib/ai/tools/discord.ts (1)
1-167
: Formatting-only update — functionality unchanged
This commit strictly normalizes whitespace and line endings; there are no modifications to control flow, error handling, or tool behavior in this file..github/workflows/ci.yml (1)
1-60
: Introduce CI workflow for code quality checks
A new GitHub Actions pipeline now runs ESLint, TypeScript type‐checking, Prettier formatting validation, and spelling checks on pull requests targetingmain
, leveraging a reusable setup action for consistent environment provisioning and caching. Configuration looks sound and aligns with project conventions.
}); | ||
|
||
export type Probability = z.infer<typeof probabilitySchema>; | ||
import { z } from 'zod/v4'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verify Zod import path
The ESLint error indicates zod/v4
cannot be resolved. Confirm whether your project’s module resolution supports this subpath or update to the standard import:
-import { z } from 'zod/v4';
+import { z } from 'zod';
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
import { z } from 'zod/v4'; | |
-import { z } from 'zod/v4'; | |
+import { z } from 'zod'; |
🧰 Tools
🪛 ESLint
[error] 1-1: Unable to resolve path to module 'zod/v4'.
(import-x/no-unresolved)
🤖 Prompt for AI Agents
In src/lib/validators/probability.ts at line 1, the import path 'zod/v4' is
causing an ESLint error because it cannot be resolved. Change the import
statement to use the standard 'zod' package import instead of the subpath
'zod/v4' to ensure compatibility with your project's module resolution.
|
||
## <a name="getting-started">📚 Getting Started</a> | ||
|
||
To clone and run this application, first you need to create a [Discord Bot](https://www.androidpolice.com/how-to-make-discord-bot/). Afterwards, you will need [Git][git] and [Bun][bun] installed on your computer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Prefer American English for consistency.
Use “Afterward” instead of “Afterwards” to match the rest of the README’s style.
🧰 Tools
🪛 LanguageTool
[locale-violation] ~29-~29: In American English, ‘afterward’ is the preferred variant. ‘Afterwards’ is more commonly used in British English and other dialects.
Context: ...idpolice.com/how-to-make-discord-bot/). Afterwards, you will need [Git][git] and [Bun][bun...
(AFTERWARDS_US)
🤖 Prompt for AI Agents
In README.md at line 29, replace the word "Afterwards" with "Afterward" to
maintain consistency with American English usage throughout the document.
[pr]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request | ||
[git]: https://git-scm.com | ||
[node]: https://nodejs.org/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Remove unused link reference definitions.
The [pr]
and [node]
references are defined but never used. Consider deleting these lines to clean up the markdown.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
55-55: Link and image reference definitions should be needed
Unused link or image reference definition: "pr"
(MD053, link-image-reference-definitions)
57-57: Link and image reference definitions should be needed
Unused link or image reference definition: "node"
(MD053, link-image-reference-definitions)
🤖 Prompt for AI Agents
In README.md around lines 55 to 57, the link reference definitions for [pr] and
[node] are declared but not used anywhere in the document. Remove these two
lines entirely to clean up unused markdown link references and keep the file
tidy.
[bun]: https://bun.sh/ | ||
[mem0]: https://mem0.ai/ | ||
[exa]: https://exa.ai/ | ||
<h1 align="center">AI Discord Bot</h4> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix mismatched HTML tags in heading.
The opening <h1>
tag is closed with </h4>
. Replace with a proper closing </h1>
or switch to markdown heading syntax (# AI Discord Bot
).
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
1-1: Inline HTML
Element: h1
(MD033, no-inline-html)
🤖 Prompt for AI Agents
In README.md at line 1, the heading tag is opened with <h1> but incorrectly
closed with </h4>. Fix this by replacing the closing tag with </h1> to match the
opening tag, or alternatively convert the heading to markdown syntax by
replacing the entire line with '# AI Discord Bot'.
const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor; | ||
|
||
try { | ||
const runner = new AsyncFunction(...keys, `"use strict";\n${code}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Consider security implications of dynamic code execution.
The use of AsyncFunction
constructor effectively allows arbitrary code execution. While the context filtering provides some protection, consider additional security measures:
- Input sanitization for the code parameter
- Restricting available globals in the execution context
- Adding memory/CPU usage limits
🤖 Prompt for AI Agents
In src/utils/sandbox.ts around lines 33 to 36, the use of AsyncFunction
constructor allows dynamic code execution, which poses security risks. To fix
this, implement input sanitization on the code parameter to prevent malicious
code, restrict the globals accessible within the execution context to a minimal
safe set, and consider adding resource limits such as memory and CPU usage
constraints to prevent abuse or denial of service.
if (description) embed.setDescription(description); | ||
if (typeof color === 'number') embed.setColor(color); | ||
|
||
if (fields && fields.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Simplify with optional chaining
You can replace if (fields && fields.length)
with if (fields?.length)
to streamline the check.
🧰 Tools
🪛 Biome (1.9.4)
[error] 35-35: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
🤖 Prompt for AI Agents
In src/utils/discord.ts at line 35, simplify the conditional check by replacing
`if (fields && fields.length)` with `if (fields?.length)`. This uses optional
chaining to streamline the check for the existence and length of the fields
array.
import { TZDate } from '@date-fns/tz'; | ||
import { format } from 'date-fns'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix unresolved imports for date-fns-tz. The imports @date-fns/tz
and date-fns
cannot be resolved. Confirm the correct package and path for timezone handling (e.g., use import { utcToZonedTime, format } from 'date-fns-tz'
or import { formatInTimeZone } from 'date-fns-tz'
).
🧰 Tools
🪛 ESLint
[error] 1-1: Unable to resolve path to module '@date-fns/tz'.
(import-x/no-unresolved)
[error] 2-2: Unable to resolve path to module 'date-fns'.
(import-x/no-unresolved)
🤖 Prompt for AI Agents
In src/utils/time.ts at lines 1 to 2, the imports from '@date-fns/tz' and
'date-fns' are unresolved. Replace these imports with the correct ones from
'date-fns-tz', such as importing { utcToZonedTime, format } or {
formatInTimeZone } directly from 'date-fns-tz' to properly handle timezone
formatting.
// TODO: Add Memories, and other tools available in the AI provider | ||
// TODO: Add History from the VC Chat Channel | ||
// TODO: Add a better voice prompt, and also switch to 11labs v3 as the voice is much better |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Track or address remaining TODOs. There are TODOs for adding memories, history, and improving the voice prompt. Consider creating issues or implementing these enhancements.
🤖 Prompt for AI Agents
In src/utils/voice/helpers/ai.ts around lines 5 to 7, there are TODO comments
about adding memories, chat history, and improving the voice prompt with 11labs
v3. To address this, either create detailed issues in the project tracker for
each TODO or start implementing these features by integrating memory handling,
fetching chat history from the VC channel, and updating the voice prompt logic
to use 11labs v3 for better voice quality.
author: interaction.user, | ||
content: prompt, | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
channel: interaction.channel!, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Avoid non-null assertion.
The channel!
non-null assertion can lead to runtime errors if channel
is undefined. Consider narrowing the type or adding a runtime fallback.
🧰 Tools
🪛 Biome (1.9.4)
[error] 36-36: Forbidden non-null assertion.
(lint/style/noNonNullAssertion)
🤖 Prompt for AI Agents
In src/commands/chat.ts at line 36, avoid using the non-null assertion operator
on interaction.channel as it may cause runtime errors if channel is undefined.
Instead, add a runtime check to verify that interaction.channel is defined
before using it, or provide a fallback value or error handling to safely handle
the case when channel is undefined.
ELEVENLABS_API_KEY=your_elevenlabs_api_key_here | ||
EXA_API_KEY=your_exa_api_key_here | ||
EOF | ||
name: Check setup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Normalize line endings to LF.
YAMLlint reports incorrect newline characters; ensure this file uses Unix (LF) line endings to comply with YAML standards.
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 1-1: wrong new line character: expected \n
(new-lines)
🤖 Prompt for AI Agents
In .github/actions/setup/action.yml at line 1, the file uses incorrect newline
characters that do not comply with YAML standards. Convert all line endings in
this file to Unix-style LF line endings to fix the YAMLlint errors and ensure
proper parsing.
Description
Type of Change
Pre-flight Checklist
bun check
without any issuesAdditional Notes
Summary by CodeRabbit
New Features
Chores
.editorconfig
to enforce final newlines and single quotes globally, with specific rules for Markdown files.Documentation
Style
Bug Fixes