Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
ef17b2b
feat: Add chat command for AI interaction and enhance message handlin…
techwithanirudh Jun 15, 2025
7f16a78
chore: Update ESLint configuration and dependencies for improved code…
techwithanirudh Jun 15, 2025
61268b3
refactor: Reorganize imports across multiple files for improved clari…
techwithanirudh Jun 15, 2025
9d0d6e8
chore: Update cSpell configuration in VSCode settings for improved sp…
techwithanirudh Jun 15, 2025
6f5c055
chore: Comment out unused AI provider configurations for future refer…
techwithanirudh Jun 15, 2025
cb81c38
chore: Remove unused imports from AI provider configurations in provi…
techwithanirudh Jun 15, 2025
8d8d5e3
refactor: Replace 'any' with 'unknown' in type definitions for improv…
techwithanirudh Jun 15, 2025
2a00631
refactor: Update initialMessages to use 'as const' for improved type …
techwithanirudh Jun 15, 2025
0cc84fc
fix: Await audio generation in createListeningStream for proper execu…
techwithanirudh Jun 15, 2025
21f0a5a
ff
techwithanirudh Jun 16, 2025
02f0401
feat: Integrate ExaAI for web search functionality and update environ…
techwithanirudh Jun 16, 2025
401ace0
fix: Update speed factor for improved performance and refine AI respo…
techwithanirudh Jun 17, 2025
7ad6df3
feat: Add web search and weather functionality to AI prompts; update …
techwithanirudh Jun 17, 2025
d1f2fd1
fix: Update memory options check to allow explicit false value and ad…
techwithanirudh Jun 17, 2025
5bea9b2
fix: Replace console.log with logger for search results in searchWeb …
techwithanirudh Jun 18, 2025
3cbfa63
chore: add commitlint configuration and update package scripts
techwithanirudh Jun 18, 2025
d9369af
chore: add CODEOWNERS and FUNDING.yml files; include pull request tem…
techwithanirudh Jun 18, 2025
4bfc3be
fix: lint
techwithanirudh Jun 18, 2025
38ee5bc
fix: remove JavaScript files from ESLint ignore list
techwithanirudh Jun 18, 2025
f6f47b0
feat: add CI workflow with ESLint, TypeScript, Prettier, and spelling…
techwithanirudh Jun 18, 2025
ca29316
feat: add setup action for Bun with caching and environment variables
techwithanirudh Jun 18, 2025
646d04b
Merge branch 'main' of https://github.com/techwithanirudh/discord-ai-…
techwithanirudh Jun 18, 2025
817453c
chore: remove unused npl-testing.ts file
techwithanirudh Jun 18, 2025
4191a3e
fix: update license information from AGPL-v3 to MIT
techwithanirudh Jun 18, 2025
0f888d1
style(format): improve code formatting
techwithanirudh Jun 18, 2025
92f3d7d
fix(editorconfig): update newline and whitespace settings for consist…
techwithanirudh Jun 18, 2025
be5cf38
refactor: remove memories handling from chat context and related func…
techwithanirudh Jun 20, 2025
5d87928
Merge branch 'main' of https://github.com/techwithanirudh/discord-ai-…
techwithanirudh Jun 20, 2025
4512e58
refactor: clean up commented code and improve attachment processing l…
techwithanirudh Jun 20, 2025
6c00456
refactor: update reasoning model to use Google AI and log shared stat…
techwithanirudh Jun 20, 2025
4e3c3bc
refactor: update replyPrompt to remove unnecessary starting sentence
techwithanirudh Jun 20, 2025
1aa2a14
refactor: update AI provider configurations
techwithanirudh Jun 20, 2025
3f5113a
feat: improve prompt eng
techwithanirudh Jun 25, 2025
f3ff46f
init
techwithanirudh Jul 26, 2025
aae569b
upd
techwithanirudh Jul 26, 2025
97fe67b
refactor: migrate from discord.js v14 to selfbot v13 API
techwithanirudh Jul 26, 2025
e4f5ad0
fix: check bot ID directly instead of using author.bot flag for messa…
techwithanirudh Jul 26, 2025
20d0ad7
refactor: remove discord tool and update bot personality to Gork
techwithanirudh Jul 26, 2025
3dd4a02
refactor: remove chat/channels commands and update bot personality wi…
techwithanirudh Jul 26, 2025
de9be26
refactor: remove chat/channels commands and update bot personality wi…
techwithanirudh Jul 26, 2025
27b82fa
refactor: remove sandbox utility and update message normalization to …
techwithanirudh Jul 26, 2025
bebcf73
refactor: remove channel allowlist functionality and associated Redis…
techwithanirudh Jul 26, 2025
138d2bf
refactor: simplify and clarify AI prompt instructions for message rel…
techwithanirudh Jul 26, 2025
c967783
feat: add message reference support to model message conversion
techwithanirudh Jul 27, 2025
1e9a0d2
refactor: make getTrigger async and add null check for botId
techwithanirudh Jul 27, 2025
200ea0b
refactor: centralize types and add rich presence with external image …
techwithanirudh Jul 27, 2025
458ed30
refactor: centralize type definitions and add new activity statuses
techwithanirudh Jul 27, 2025
9404e1c
feat: add command deployment script and format imports
techwithanirudh Jul 27, 2025
db935f5
refactor: move RequestHints type to types file and clean up config/lo…
techwithanirudh Jul 27, 2025
beec044
feat: add command filtering to reply prompt to prevent prompt injection
techwithanirudh Jul 27, 2025
7c675c8
refactor: improve AI relevance detection prompt with clearer examples…
techwithanirudh Jul 27, 2025
8eb2af2
feat: add joinServer tool to allow bot to join Discord servers via in…
techwithanirudh Jul 27, 2025
eb03332
feat: add startDM tool to send direct messages to users
techwithanirudh Jul 27, 2025
d76e44c
feat: add Pinecone vector database integration for semantic search
techwithanirudh Jul 27, 2025
b536032
feat: integrate Pinecone for vector memory storage and retrieval
techwithanirudh Jul 27, 2025
00ce6e2
refactor: reorganize Pinecone integration with hybrid search and memo…
techwithanirudh Jul 27, 2025
a84a66c
refactor: reorganize pinecone code into dedicated module with improve…
techwithanirudh Jul 27, 2025
641ba49
refactor: reorganize pinecone code into dedicated module with improve…
techwithanirudh Jul 27, 2025
5a3ccb1
refactor: reorganize pinecone code into dedicated module with improve…
techwithanirudh Jul 27, 2025
4e871a7
refactor: replace BM25 hybrid search with memory query system using P…
techwithanirudh Jul 27, 2025
bb3ae73
refactor: consolidate memory operations into dedicated modules with i…
techwithanirudh Jul 27, 2025
5c68624
feat: implement memory querying with age filters and metadata updates
techwithanirudh Jul 27, 2025
c58d75b
chore: fix typos, formatting and import order across documentation an…
techwithanirudh Jul 27, 2025
6d34e1c
feat: store chat history in Pinecone after successful bot responses
techwithanirudh Jul 27, 2025
09510a5
feat: add getUserInfo tool for fetching Discord user details
techwithanirudh Jul 27, 2025
ee1bd50
feat: add searchMemories tool and store guild/channel context in memo…
techwithanirudh Jul 27, 2025
6c2ab8a
refactor: remove hash field from memory metadata and search results
techwithanirudh Jul 27, 2025
bf8a358
feat: improve prompt security and reduce typing delay for faster resp…
techwithanirudh Jul 27, 2025
aa9ed10
feat: improve prompt security and reduce typing delay for faster resp…
techwithanirudh Jul 27, 2025
f86c2a7
feat: add message reactions and switch MinimalContext to Message type
techwithanirudh Jul 28, 2025
95cf974
chore: remove unused message type definitions
techwithanirudh Jul 28, 2025
5bc603a
feat: add HTTP error handling for attachments and expand model fallba…
techwithanirudh Jul 28, 2025
95b85b3
refactor: update error logging, import paths and prompt guidelines ac…
techwithanirudh Jul 28, 2025
9d8d203
feat: increase rate limit, add search logging and improve prompt clarity
techwithanirudh Jul 28, 2025
43d6944
refactor: split prompts into separate modules and add memory tool fun…
techwithanirudh Jul 28, 2025
56f6fc2
feat: improve image attachment handling and fix message prefix stripping
techwithanirudh Jul 28, 2025
2bf46e6
style: capitalize 'DO NOT' for consistency in core prompt text
techwithanirudh Jul 28, 2025
1478770
feat: improve message handling with ping validation and zero delay re…
techwithanirudh Jul 28, 2025
e06efc1
feat: add Docker support and update core prompts and message handling
techwithanirudh Jul 28, 2025
829ae66
feat: add Python3 installation to Docker base image
techwithanirudh Jul 28, 2025
2c433b0
feat: add Python3 installation to Docker base image
techwithanirudh Jul 28, 2025
d3dfa45
fix: disable preinstall scripts during production dependency installa…
techwithanirudh Jul 28, 2025
d2c8a61
fix: update bun install flags to use --ignore-scripts instead of BUN_…
techwithanirudh Jul 28, 2025
960c7b3
fix: copy entire app directory from builder stage instead of individu…
techwithanirudh Jul 28, 2025
39aa61b
feat: create logs directory with write permissions in Docker container
techwithanirudh Jul 28, 2025
274706c
feat: add HTTP error handling for attachments and expand model fallba…
techwithanirudh Jul 29, 2025
8a96357
docs: clarify user message format and bot response guidelines in core…
techwithanirudh Jul 29, 2025
110c982
feat: implement tool call memory storage and auto-create Pinecone index
techwithanirudh Jul 29, 2025
f6fc38b
refactor: improve pinecone metadata validation with zod schema and JS…
techwithanirudh Jul 29, 2025
67ffb52
refactor: standardize memory context storage and retrieval in Pinecone
techwithanirudh Jul 29, 2025
1875741
refactor: move context field from base metadata to chat-specific schema
techwithanirudh Jul 29, 2025
552f22d
refactor: update pinecone queries to use namespace and standardize ti…
techwithanirudh Jul 29, 2025
784b797
refactor: update pinecone queries to use namespace and standardize ti…
techwithanirudh Jul 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 44 additions & 35 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,44 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"dictionaries": ["software-terms", "npm", "fullstack", "redis"],
"files": ["**", ".vscode/**", ".github/**"],
"ignorePaths": ["bun.lock"],
"ignoreRegExpList": ["apiKey='[a-zA-Z0-9-]{32}'"],
"import": [
"@cspell/dict-redis/cspell-ext.json",
"@cspell/dict-bash/cspell-ext.json"
],
"useGitignore": true,
"version": "0.2",
"words": [
"anirudh",
"sriram",
"Fellipe",
"Utaka",
"umami",
"assemblyai",
"bitstream",
"zenix",
"openrouter",
"elevenlabs",
"hackclub",
"deepgram",
"libsodium",
"livecrawl",
"grok",
"gork",
"dalle",
"dall",
"arcas",
"techwithanirudh"
]
}
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"dictionaries": ["software-terms", "npm", "fullstack", "redis"],
"files": ["**", ".vscode/**", ".github/**"],
"ignorePaths": ["bun.lock"],
"ignoreRegExpList": ["apiKey='[a-zA-Z0-9-]{32}'"],
"import": [
"@cspell/dict-redis/cspell-ext.json",
"@cspell/dict-bash/cspell-ext.json"
],
"useGitignore": true,
"version": "0.2",
"words": [
"anirudh",
"sriram",
"Fellipe",
"Utaka",
"umami",
"assemblyai",
"bitstream",
"zenix",
"openrouter",
"elevenlabs",
"hackclub",
"deepgram",
"libsodium",
"livecrawl",
"grok",
"gork",
"imgork",
"dalle",
"dall",
"arcas",
"techwithanirudh",
"selfbot",
"shitposter",
"cynicist",
"autobotting",
"dotproduct",
"rerankinig",
"textembbeding",
"lefthook"
Comment on lines +35 to +42
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Dictionary contains obvious misspellings
Keeping typos in the “words” whitelist nullifies spell-checking:

 • rerankinigreranking
 • textembbedingtextembedding

-    "rerankinig",
-    "textembbeding",
+    "reranking",
+    "textembedding",

Please audit new entries before committing.

📝 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.

Suggested change
"selfbot",
"shitposter",
"cynicist",
"autobotting",
"dotproduct",
"rerankinig",
"textembbeding",
"lefthook"
"selfbot",
"shitposter",
"cynicist",
"autobotting",
"dotproduct",
"reranking",
"textembedding",
"lefthook"
🤖 Prompt for AI Agents
In the .cspell.json file between lines 34 and 41, there are misspelled words in
the whitelist dictionary that undermine spell-checking. Correct the misspellings
by changing "rerankinig" to "reranking" and "textembbeding" to "textembedding".
Review all new entries carefully before committing to avoid similar issues.

]
}
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ indent_size = 2
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = true
quote_type = single

[*.md]
trim_trailing_whitespace = true
insert_final_newline = false
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ DISCORD_DEFAULT_GUILD_ID=your_discord_default_guild_id_here
OPENAI_API_KEY=your_openai_api_key_here
# HACKCLUB_API_KEY=your_hackclub_api_key_here
# OPENROUTER_API_KEY=your_openrouter_api_key_here
# COHERE_API_KEY=your_cohere_api_key_here

# ---------------------------------------------------------------------------------------------------------
# Redis
Expand All @@ -39,9 +40,8 @@ LOG_DIRECTORY=logs
# ---------------------------------------------------------------------------------------------------------
# Memory
# A global memory service for storing and retrieving data.
# @see https://mem0.ai/
# ---------------------------------------------------------------------------------------------------------
MEM0_API_KEY=your_mem0_api_key_here
# MEM0_API_KEY=your_mem0_api_key_here

# ---------------------------------------------------------------------------------------------------------
# Voice Channel
Expand Down
68 changes: 34 additions & 34 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"env": {
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import-x/recommended",
"plugin:import-x/typescript",
"prettier"
],
"plugins": ["@typescript-eslint", "import-x"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"semi": ["warn", "always"],
"arrow-parens": ["warn", "always"],
"no-unused-vars": "warn",
"no-console": "off",
"import/prefer-default-export": "off"
},
"settings": {
"import/resolver": {
// You will also need to install and configure the TypeScript resolver
// See also https://github.com/import-js/eslint-import-resolver-typescript#configuration
"typescript": true,
"node": true
}
}
}
{
"env": {
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import-x/recommended",
"plugin:import-x/typescript",
"prettier"
],
"plugins": ["@typescript-eslint", "import-x"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"semi": ["warn", "always"],
"arrow-parens": ["warn", "always"],
"no-unused-vars": "warn",
"no-console": "off",
"import/prefer-default-export": "off"
},
"settings": {
"import/resolver": {
// You will also need to install and configure the TypeScript resolver
// See also https://github.com/import-js/eslint-import-resolver-typescript#configuration
"typescript": true,
"node": true
}
}
}
4 changes: 2 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github: techwithanirudh
buy_me_a_coffee: techwithanirudh
github: techwithanirudh
buy_me_a_coffee: techwithanirudh
Comment on lines +1 to +2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix CRLF line-endings to satisfy yamllint
yamllint fails with “wrong new line character: expected \n” because the file is committed with Windows (CRLF) line endings. Convert to Unix (LF) to unblock CI.

-github: techwithanirudh\r
-buy_me_a_coffee: techwithanirudh\r
+github: techwithanirudh
+buy_me_a_coffee: techwithanirudh
📝 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.

Suggested change
github: techwithanirudh
buy_me_a_coffee: techwithanirudh
github: techwithanirudh
buy_me_a_coffee: techwithanirudh
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 1-1: wrong new line character: expected \n

(new-lines)

🤖 Prompt for AI Agents
In .github/FUNDING.yml at lines 1 to 2, the file uses Windows CRLF line endings
which cause yamllint to fail. Convert all line endings in this file from CRLF to
Unix LF format to satisfy yamllint and unblock the CI process.

85 changes: 42 additions & 43 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
name: Check setup

runs:
using: composite
steps:
- name: Setup bun
uses: oven-sh/setup-bun@v2

- name: Get Bun cache directory
shell: bash
run: |
echo "STORE_PATH=${HOME}/.bun/install/cache" >> $GITHUB_ENV
- name: Setup Bun cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install dependencies
shell: bash
run: bun install

- name: Create environment variables file
shell: bash
run: |
cat << EOF > .env.local
DISCORD_TOKEN=your_discord_token_here
DISCORD_CLIENT_ID=your_discord_client_id_here
DISCORD_OWNER_ID=your_discord_owner_id_here
DISCORD_DEFAULT_GUILD_ID=your_discord_default_guild_id_here
OPENAI_API_KEY=sk-your_openai_api_key_here
UPSTASH_REDIS_REST_URL=https://your_upstash_redis_rest_url.upstash.io
UPSTASH_REDIS_REST_TOKEN=your_upstash_redis_rest_token
LOG_LEVEL=INFO
LOG_DIRECTORY=logs
MEM0_API_KEY=m0-api_key_here
DEEPGRAM_API_KEY=your_deepgram_api_key_here
ELEVENLABS_API_KEY=your_elevenlabs_api_key_here
EXA_API_KEY=your_exa_api_key_here
EOF
name: Check setup

runs:
using: composite
steps:
- name: Setup bun
uses: oven-sh/setup-bun@v2

- name: Get Bun cache directory
shell: bash
run: |
echo "STORE_PATH=${HOME}/.bun/install/cache" >> $GITHUB_ENV
- name: Setup Bun cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install dependencies
shell: bash
run: bun install

- name: Create environment variables file
shell: bash
run: |
cat << EOF > .env.local
DISCORD_TOKEN=your_discord_token_here
DISCORD_CLIENT_ID=your_discord_client_id_here
DISCORD_OWNER_ID=your_discord_owner_id_here
DISCORD_DEFAULT_GUILD_ID=your_discord_default_guild_id_here
OPENAI_API_KEY=sk-your_openai_api_key_here
UPSTASH_REDIS_REST_URL=https://your_upstash_redis_rest_url.upstash.io
UPSTASH_REDIS_REST_TOKEN=your_upstash_redis_rest_token
LOG_LEVEL=INFO
LOG_DIRECTORY=logs
DEEPGRAM_API_KEY=your_deepgram_api_key_here
ELEVENLABS_API_KEY=your_elevenlabs_api_key_here
EXA_API_KEY=your_exa_api_key_here
EOF
Comment on lines +1 to +42
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

YAML-lint failure caused by CRLF – convert file to LF.

The CI hint shows
wrong new line character: expected \n.
GitHub Actions runner accepts CRLF, but lint/check jobs that invoke yamllint will fail. A one-line fix:

-<CRLF line endings>
+<LF line endings>

After conversion, rerun the pipeline to confirm the error disappears.

Committable suggestion skipped: line range outside the PR's diff.

🧰 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 lines 1 to 42, the file uses CRLF line
endings which cause YAML linting to fail due to expecting LF line endings.
Convert the entire file's line endings from CRLF to LF to fix the linting error.
After conversion, commit the change and rerun the pipeline to verify the issue
is resolved.

50 changes: 25 additions & 25 deletions .github/pull-request-template.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
### Description

<!-- Describe your changes in detail. What problem does this PR solve? -->

### Type of Change

<!-- Put an 'x' in all boxes that apply -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Refactor (non-breaking change that doesn't fix a bug or add a feature)
- [ ] Documentation update

### Pre-flight Checklist

<!-- Put an 'x' in all boxes that apply -->

- [ ] Changes are limited to a single feature, bugfix or chore (split larger changes into separate PRs)
- [ ] `bun check` without any issues
- [ ] I have reviewed [contributor guidelines](https://github.com/techwithanirudh/discord-ai-bot/blob/main/CONTRIBUTING.md)

### Additional Notes

<!-- Add any additional notes for reviewers -->
### Description
<!-- Describe your changes in detail. What problem does this PR solve? -->
### Type of Change
<!-- Put an 'x' in all boxes that apply -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Refactor (non-breaking change that doesn't fix a bug or add a feature)
- [ ] Documentation update
### Pre-flight Checklist
<!-- Put an 'x' in all boxes that apply -->
- [ ] Changes are limited to a single feature, bugfix or chore (split larger changes into separate PRs)
- [ ] `bun check` without any issues
- [ ] I have reviewed [contributor guidelines](https://github.com/techwithanirudh/discord-ai-bot/blob/main/CONTRIBUTING.md)
### Additional Notes
<!-- Add any additional notes for reviewers -->
Loading
Loading