Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[BUG] TG bot won't show /commands #16

Open
lospoy opened this issue Jan 22, 2025 · 3 comments
Open

[BUG] TG bot won't show /commands #16

lospoy opened this issue Jan 22, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@lospoy
Copy link

lospoy commented Jan 22, 2025

Describe the bug

Tried setting up a simple DevRel agent connected to Telegram only, but the TG bot wouldn't show /commands. One of the scrips was modified (details below).

To Reproduce
Steps to reproduce the behavior:

  1. Connect to TG using the steps in the read.me and pasting the TG Bot username without the @ on the .env file
  2. On package.json file, modify "predev": "node bin/validate-env && node bin/check-x-login", to predev": "node bin/validate-env"
  3. Execute pnpm run dev
  4. See error

Expected behavior
TG bot shows /commands

Log

[server] Server environment: development
[server] [ElizaLogger] Initializing with:
[server]             isNode: true
[server]             verbose: false
[server]             VERBOSE env: undefined
[server]             NODE_ENV: undefined
[server]         
[server]  ℹ INFORMATIONS
[server]    Loading embedding settings: 
[server]    {"OLLAMA_EMBEDDING_MODEL":"mxbai-embed-large"} 
[server] 
[server]  ℹ INFORMATIONS
[server]    Loading character settings: 
[server]    {"ARGV":["/opt/homebrew/Cellar/node/23.3.0/bin/node","/Users/carlos/Gaia/agents/Gaia-DevRel/server/dist/index.js"],"CWD":"/Users/carlos/Gaia/agents/Gaia-DevRel/server"} 
[server] 
[server] Loaded .env file from: /Users/carlos/Gaia/agents/Gaia-DevRel/.env
[server]  ℹ INFORMATIONS
[server]    Parsed settings: 
[server]    {"USE_OPENAI_EMBEDDING_TYPE":"undefined","USE_OLLAMA_EMBEDDING_TYPE":"undefined","OLLAMA_EMBEDDING_MODEL":"mxbai-embed-large"} 
[server] 
[server] Loading character from: /Users/carlos/Gaia/agents/Gaia-DevRel/character.json
[server] Successfully loaded custom character: Ace
[server] Using SQLite database at: /Users/carlos/Gaia/agents/Gaia-DevRel/eliza.sqlite
[server]  ["◎ sqlite-vec extensions loaded successfully."] 
[server]  ℹ INFORMATIONS
[server]    Initializing AgentRuntime with options: 
[server]    {"character":"Ace","modelProvider":"openai","characterModelProvider":"openai"} 
[server]  ✓ SUCCESS
[server]    Agent ID 
[server]    fc2b5a9c-b80a-00a1-926f-4fbc887646dd 
[server]  ["ℹ Setting model provider..."] 
[server]  ℹ INFORMATIONS
[server]    Model Provider Selection: 
[server]    {"characterModelProvider":"openai","optsModelProvider":"openai","finalSelection":"openai"} 
[server]  ℹ INFORMATIONS
[server]    Selected model provider: 
[server]    openai 
[server]  ℹ INFORMATIONS
[server]    Selected image model provider: 
[server]    openai 
[server]  ["✓ Registering action: CONTINUE"] 
[server]  ["✓ Registering action: FOLLOW_ROOM"] 
[server]  ["✓ Registering action: UNFOLLOW_ROOM"] 
[server]  ["✓ Registering action: IGNORE"] 
[server]  ["✓ Registering action: NONE"] 
[server]  ["✓ Registering action: MUTE_ROOM"] 
[server]  ["✓ Registering action: UNMUTE_ROOM"] 
[server]  ["✓ Registering action: EXTRACT_CHAIN"] 
[server]  ["✓ Registering action: GET_SMART_ACCOUNT"] 
[server]  ["✓ Registering action: SEND_ETH"] 
[server]  ["✓ Registering action: SEND_SOL"] 
[server] Database initialized.
[server]  ["◎ Room fc2b5a9c-b80a-00a1-926f-4fbc887646dd created successfully."] 
[server]  ["✓ User Ace created successfully."] 
[server] (node:23597) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
[server] (Use `node --trace-deprecation ...` to show where the warning was created)
[server] Server running on PORT: 3001
[server] Server Environment: development
[server] NGROK URL: https://alive-weevil-nationally.ngrok-free.app
[server] [TwitterService] Starting service...
[server] [TwitterService] Loading Twitter cookies from: /Users/carlos/Gaia/agents/Gaia-DevRel/twitter-cookies.json
[server] [TwitterService] Error: Error: Twitter cookies not found. Please run the `pnpm letsgo` script first.
[server]     at TwitterService.start (file:///Users/carlos/Gaia/agents/Gaia-DevRel/server/dist/services/twitter.service.js:25:23)
[server]     at async Server.<anonymous> (file:///Users/carlos/Gaia/agents/Gaia-DevRel/server/dist/index.js:65:9)
[server] Failed to start server: Error: Twitter cookies not found. Please run the `pnpm letsgo` script first.
[server]     at TwitterService.start (file:///Users/carlos/Gaia/agents/Gaia-DevRel/server/dist/services/twitter.service.js:41:19)
[server]     at async Server.<anonymous> (file:///Users/carlos/Gaia/agents/Gaia-DevRel/server/dist/index.js:65:9)
[tunnel] API available at: https://alive-weevil-nationally.ngrok-free.app
[tunnel] Front-end available at: https://c6cc-100-2-116-4.ngrok-free.app

ENV File

PORT=3001
NODE_ENV=development
TELEGRAM_BOT_TOKEN=[secret]
OPENAI_API_KEY=disabled
NGROK_AUTH_TOKEN=[secret]
JOKERACE_CONTRACT_ADDRESS=disabled
NGROK_DOMAIN=[secret]
COLLABLAND_API_KEY=[secret]
GAIANET_MODEL=llama-3.2-3b
GAIANET_SERVER_URL=[secret]
GAIANET_EMBEDDING_MODEL=nomic-embed-text-v1.5.f16
USE_GAIANET_EMBEDDING=TRUE
ELIZA_CHARACTER_PATH=character.json
TOKEN_DETAILS_PATH=disabled
TWITTER_CLIENT_ID=disabled
TWITTER_CLIENT_SECRET=disabled
DISCORD_CLIENT_ID=disabled
DISCORD_CLIENT_SECRET=disabled
GITHUB_CLIENT_ID=disabled
GITHUB_CLIENT_SECRET=disabled
TWITTER_USERNAME=disabled
TWITTER_PASSWORD=disabled
TWITTER_API_KEY=disabled
TWITTER_API_SECRET_KEY=disabled
TWITTER_ACCESS_TOKEN=disabled
TWITTER_ACCESS_TOKEN_SECRET=disabled
NGROK_URL=[secret]
NEXT_PUBLIC_HOSTNAME=[secret]
@lospoy lospoy added the bug Something isn't working label Jan 22, 2025
@gitaalekhyapaul
Copy link
Contributor

@lospoy it seems you didn't log in to Twitter which is why the server is crashing
Can you check if there's a twitter-cookies.json file created in your local?
If you're planning to skip Twitter, feel free to remove the twitter.service.ts file

@lospoy
Copy link
Author

lospoy commented Jan 28, 2025

@gitaalekhyapaul thank you!

I also get this error in an agent that I have logged into Twitter. Sometimes it runs if I delete the twitter-cookies.json file and then run pnpm letsgo, typically if I do it 2-3 times. Probably a race condition?

[server] [TwitterService] Error: Error: Twitter cookies not found. Please run the `pnpm letsgo` script first.

This is what the Twitter .env part looks like for the Agent logged into Twitter

TWITTER_CLIENT_ID=disabled
TWITTER_CLIENT_SECRET=disabled
TWITTER_USERNAME=[secret]
TWITTER_PASSWORD=[secret]
TWITTER_API_KEY=disabled
TWITTER_API_SECRET_KEY=disabled
TWITTER_ACCESS_TOKEN=disabled
TWITTER_ACCESS_TOKEN_SECRET=disabled

@gitaalekhyapaul
Copy link
Contributor

For cookie generation it needs to have the Twitter API V2 credentials as well, and I see you have set them to disabled
You can get those at https://developer.twitter.com/en/portal/projects/<project-id>/apps/<app-id>/keys

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants