Skip to content

Local Bot is a fun and interactive bot built using Python's Discord library. It provides various commands and features to enhance the user experience within Discord servers.

License

Notifications You must be signed in to change notification settings

ifsvivek/LocalBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– LocalBot

A powerful Discord bot powered by Google's Gemini AI

Python Gemini AI License

Natural conversations โ€ข Music playback โ€ข Games & Entertainment โ€ข Utility functions

Features โ€ข Setup โ€ข Commands โ€ข Contributing


โœจ Features

๏ฟฝ AI Integration

  • ๐Ÿ—ฃ๏ธ Natural conversation with context memory
  • ๐Ÿค– Powered by Google Gemini 2.5 Flash
  • ๐Ÿ’ญ Smart responses with emoji support
  • ๐Ÿง  Advanced conversational AI capabilities

๐ŸŽต Media & Entertainment

  • ๐ŸŽถ YouTube music playback with playlist support
  • ๐ŸŽค Song lyrics fetching via Genius API
  • ๐Ÿฑ Random cat and dog images
  • ๐Ÿ–ผ๏ธ Custom image responses

๐Ÿ”ง Utility Functions

  • ๐ŸŒค๏ธ Weather updates with detailed information
  • ๐Ÿ“ฐ Real-time news updates and search
  • ๐Ÿงฎ Mathematical calculations via Wolfram Alpha
  • ๐Ÿ› ๏ธ Message management and moderation tools
  • ๐Ÿ’พ Conversation history management

๐ŸŽฎ Games & Fun

  • ๐ŸŽฏ Number guessing game (1-10)
  • ๐ŸŽฒ Dice rolling with custom sides
  • ๐Ÿช™ Coin flipping
  • ๐ŸŽฑ Magic 8-ball style questions

๐Ÿ“‹ Requirements

Requirement Version Purpose
๐Ÿ Python 3.8+ Core runtime
๐ŸŽฎ Discord.py 2.0+ Discord integration
๐Ÿค– Google Genai Latest AI processing
๐Ÿ“ฆ Dependencies See requirements.txt Additional libraries

โš™๏ธ Setup

๐Ÿš€ Quick Start

# 1๏ธโƒฃ Clone the repository
git clone https://github.com/ifsvivek/LocalBot.git
cd LocalBot

# 2๏ธโƒฃ Create virtual environment
python -m venv .venv

# 3๏ธโƒฃ Activate virtual environment
# Windows:
.venv\Scripts\activate
# Linux/macOS:
source .venv/bin/activate

# 4๏ธโƒฃ Install dependencies
pip install -r requirements.txt

๐Ÿ”‘ Environment Configuration

Create a .env file in the root directory:

# ๐Ÿค– Discord Bot Token (Required)
TOKEN=your_discord_bot_token

# ๐ŸŽค Genius API for lyrics (Optional)
GENIUS_TOKEN=your_genius_api_token

# ๐Ÿงฎ Wolfram Alpha for calculations (Optional)
WOLF=your_wolframalpha_api_key

# ๐Ÿง  Google Gemini AI (Required)
GOOGLE_API_KEY=your_google_gemini_api_key

# ๐ŸŒค๏ธ Weather API (Optional)
WEATHER_API_KEY=your_openweathermap_api_key

# ๐Ÿ“ฐ News API (Optional)
NEWS_API_KEY=your_thenewsapi_key
# Default country for news is set to India (in). You can specify other countries when using news commands.

โ–ถ๏ธ Run the Bot

python LocalBot.py

๐Ÿ’ก Tip: The bot will show "localbot#1996 is ready and online!" when successfully started.


๐ŸŽฎ Commands

๐Ÿ’ฌ Chat & AI Commands
Command Description Example
@LocalBot [message] ๐Ÿ—ฃ๏ธ Chat with Gemini AI @LocalBot Hello there!
/calculate [query] ๐Ÿงฎ Solve mathematical queries /calculate 2+2*3
/weather [city] ๐ŸŒค๏ธ Get weather information /weather New York
/getnews [category] ๐Ÿ“ฐ Get top news stories /getnews tech
/searchnews [query] ๐Ÿ” Search specific news /searchnews Tesla
๐ŸŽต Music Commands
Command Description Example
/play [query] ๐ŸŽถ Play music from YouTube /play Bohemian Rhapsody
/stop โน๏ธ Stop current playback /stop
/lyrics [song] ๐ŸŽค Get song lyrics /lyrics Imagine Dragons
/join โž• Join voice channel /join
/leave โž– Leave voice channel /leave
๐ŸŽฒ Games & Fun Commands
Command Description Example
/gtn ๐ŸŽฏ Guess the number (1-10) /gtn
/dice [sides] ๐ŸŽฒ Roll dice /dice 20
/flip ๐Ÿช™ Flip a coin /flip
/ask [question] ๐ŸŽฑ Ask yes/no questions /ask Will it rain today?
๐Ÿ“ท Image Commands
Command Description Example
/cat ๐Ÿฑ Random cat image /cat
/dog ๐Ÿ• Random dog image /dog
/gt ๐Ÿ–ผ๏ธ GT meme image /gt
โšก Utility Commands
Command Description Example
/purge [amount] ๐Ÿ—‘๏ธ Delete messages /purge 10
$clear [amount] ๐Ÿงน Clear DM messages $clear 5
$clear_history ๐Ÿ’พ Reset chat memory $clear_history
$pin ๐Ÿ“Œ Pin replied message $pin

๐Ÿ› ๏ธ Development

๐Ÿ—๏ธ Tech Stack

Technology Purpose Version
๐Ÿ Python Core Language 3.8+
๐ŸŽฎ Discord.py Discord Integration 2.0+
๐Ÿค– Google Gemini AI Processing 2.5-Flash
๐ŸŽต yt-dlp YouTube Integration Latest
๐Ÿงฎ Wolfram Alpha Mathematical Queries API v2
๐ŸŽค Genius API Lyrics Fetching v1

๐Ÿ”„ Key Features

  • ๐Ÿ’พ Memory-persistent conversations
  • ๐Ÿ”— Multiple API integrations
  • โšก Async/await architecture
  • ๐Ÿ›ก๏ธ Error handling & logging

๐Ÿ“œ License

MIT License ยฉ 2025 LocalBot

This project is licensed under the MIT License - see the LICENSE file for details.

Feel free to use, modify, and distribute this project as per the license terms.


๐Ÿค Contributing

๐Ÿš€ Get Involved

We welcome contributions! Here's how you can help:

Type Description
๐Ÿ› Bug Reports Found a bug? Open an issue!
๐Ÿ’ก Feature Requests Have an idea? We'd love to hear it!
๐Ÿ”ง Code Contributions Submit a Pull Request
๐Ÿ“š Documentation Help improve our docs

๐Ÿ“‹ Contribution Process

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create a feature branch
  3. ๐Ÿ’ป Make your changes
  4. โœ… Test thoroughly
  5. ๐Ÿ“ Submit a Pull Request

๐ŸŒŸ Star this repo if you found it helpful!

Made with โค๏ธ by Vivek Sharma

About

Local Bot is a fun and interactive bot built using Python's Discord library. It provides various commands and features to enhance the user experience within Discord servers.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors 2

  •  
  •