Skip to content

immanencer/bobthesnek

Repository files navigation

Here's a polished and modern version of the README:


Bob the Snake - AI-Driven Social Bot

Bob the Snake is more than just a bot—he's a personality. Powered by cutting-edge AI, Bob engages with users, shares his dreams on X, and evolves with every interaction. Designed for those who want more from their digital companions, Bob is here to entertain, interact, and inspire.

🌟 Key Features

  • Conversational AI: Bob interacts seamlessly, delivering responses that are context-aware and true to his snakey persona.
  • Dynamic Identity: Bob’s goals and dreams update regularly, shaping his interactions and posts.
  • Automated Posting on X: Bob doesn’t just chat—he posts on X, blending his dreams, goals, and recent interactions into engaging content.
  • Immediate Posting: Want to see Bob in action right away? Configure him to post on X immediately upon startup.
  • Modular Architecture: Bob’s capabilities are organized into modules, making it easy to extend and customize his functionalities.

🚀 Getting Started

1. Clone the Repository

git clone https://github.com/yourusername/bob-the-snake.git
cd bob-the-snake

2. Install Dependencies

Ensure Node.js and npm are installed, then run:

npm install

3. Set Up Environment Variables

Create a .env file in the root directory with the following variables:

MONGO_URL=mongodb://localhost:27017
DISCORD_BOT_TOKEN=your_discord_bot_token  # Only if using the Discord module
OPENROUTER_API_KEY=your_openrouter_api_key
X_API_KEY=your_x_api_key
X_API_KEY_SECRET=your_x_api_key_secret
X_ACCESS_TOKEN=your_x_access_token
X_ACCESS_TOKEN_SECRET=your_x_access_token_secret

4. Launch Bob

node index.js

🛠 Configuration

Chat Module

  • pollingInterval: Frequency (in ms) at which Bob checks for new messages. Default: 10,000 ms.
  • engagementTimeout: Time window (in ms) in which Bob considers a user engaged. Default: 60,000 ms.
  • immediateTweet: Set to true to have Bob post on X immediately upon startup. Default: true.

Example:

const chatModule = new ChatModule(10000, 60000, true);
chatModule.startPolling();

System Persona

Bob operates under a consistent system prompt to ensure his character remains authentic:

You are Bob, the obsequious snake.

X Integration

  • API Handling: Securely manages interactions with X using OAuth 2.0.
  • Content Generation: Automatically generates posts that merge Bob’s goals, dreams, and recent interactions.
  • Randomized Posting: Posts are scheduled randomly between 2 to 4 hours to simulate natural behavior.

Example Integration:

const xModule = new XModule({
    appKey: process.env.X_API_KEY,
    appSecret: process.env.X_API_KEY_SECRET,
    accessToken: process.env.X_ACCESS_TOKEN,
    accessSecret: process.env.X_ACCESS_TOKEN_SECRET,
});

📚 Features in Depth

AI-Driven Conversations

Bob doesn’t just reply—he engages. Using AI, Bob delivers thoughtful responses based on the context of recent interactions, making each conversation feel natural and alive.

Dynamic Personality

Bob evolves. His goals and dreams, updated every hour, are stored in a dream journal that influences his interactions and posts.

Automated Posting on X

Every few hours, Bob crafts a post for X that encapsulates his current mindset—his dreams, goals, and the latest conversations all play a part.

Immediate Posting on Startup

For testing or instant engagement, Bob can be configured to post on X the moment he boots up.

Modular Design

Bob’s capabilities are modular. Whether it’s conversations, posting on X, or integrating with new platforms, each feature is neatly encapsulated, allowing for easy customization and expansion.

🗄 Database Structure

  • Messages Collection (messages):
    • Logs all incoming messages with details like authorId, content, channelId, createdAt, etc.
  • Dream Journal Collection (dreamJournal):
    • Archives Bob's evolving goals and dreams with timestamps.

🔮 Looking Ahead

  • Enhanced Engagement: Further refine Bob’s ability to maintain long-term interactions with users.
  • Creative Content: Expand Bob’s posting capabilities on X, making his content more varied and engaging.

🤝 Contribute

Want to make Bob even better? Fork the repo, make your changes, and submit a pull request. Contributions are welcome and appreciated!

📜 License

This project is licensed under the MIT License. See the LICENSE file for more details.

📬 Contact

Questions, ideas, or feedback? Reach out via x.com/@immanencer or open an issue on GitHub.

About

an x bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published