Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Discord UserInfo Bot

discord userinfo bot

A Python Discord bot that fetches user information and sends it to a specified channel. The bot runs from the command line and continuously prompts for user IDs to process.

Features

  • Command-line interface: Interactive terminal prompts for user ID input
  • Enhanced user information: Retrieves username, tag, ID, bot status, account creation date, avatar, and banner
  • Visual embeds: Rich Discord embeds with user avatars as thumbnails and banners as images
  • Avatar & Banner display: Shows profile pictures and banners with clickable links
  • Auto-configuration: Automatically prompts for credentials on first run or invalid token
  • Continuous operation: Loops indefinitely until manually stopped
  • Error handling: Validates input and handles various error cases
  • Discord commands: Use !info command for bot information and support

Setup Instructions

1. Install Dependencies

pip install -r requirements.txt

2. Create Discord Bot

  1. Go to Discord Developer Portal
  2. Click "New Application" and give it a name
  3. Go to "Bot" section and click "Add Bot"
  4. Copy the bot token
  5. Enable the following intents:
    • Message Content Intent
    • Server Members Intent

3. Invite Bot to Server

  1. Go to "OAuth2" > "URL Generator"
  2. Select scopes: bot
  3. Select bot permissions:
    • Send Messages
    • Use Slash Commands
    • Read Message History
    • Embed Links
  4. Copy the generated URL and invite the bot to your server

4. Configure the Bot

Automatic Setup (Recommended): Just run the bot! It will automatically prompt you for credentials if no .env file exists:

python main.py

The bot will ask for:

  • BOT TOKEN: Your Discord bot token
  • CHANNEL ID: The channel where user info will be sent

Manual Setup: Alternatively, create a .env file manually:

BOT_TOKEN=your_actual_bot_token_here
CHANNEL_ID=your_actual_channel_id_here

To get a channel ID:

  • Enable Developer Mode in Discord (User Settings > Advanced > Developer Mode)
  • Right-click on the channel and select "Copy ID"

Important: Never commit your .env file to version control. Add .env to your .gitignore file.

5. Run the Bot

python main.py

Usage

Command Line Interface

  1. Start the bot using python main.py
  2. Wait for the "Discord User Info Bot - Ready!" message
  3. Enter user IDs when prompted with "📝 Enter User ID:"
  4. The bot will fetch user information and send a rich embed to the configured channel
  5. Type quit, exit, or stop to terminate the bot
  6. Use Ctrl+C as an alternative way to stop the bot

Discord Commands

  • !info: Display bot information, features, support server, and creator details

Example Output

When you enter a user ID, the bot will:

  1. Validate the input
  2. Fetch user information from Discord
  3. Send a rich embed to the target channel containing:
    • Username
    • User Tag
    • User ID
    • Bot status (Yes/No)
    • Account creation date
    • Avatar thumbnail (profile picture)
    • Profile banner (if available)
    • Clickable links to view full-size avatar and banner

Configuration

The bot uses environment variables for configuration. Set these in your .env file:

BOT_TOKEN=your_actual_bot_token_here
CHANNEL_ID=your_actual_channel_id_here

Error Handling

The bot handles various error cases:

  • Invalid user IDs (non-numeric input)
  • Users not found (displays appropriate message)
  • Network errors (connection issues)
  • Permission errors (bot access issues)
  • Invalid bot token (automatically prompts for reconfiguration)
  • Channel not found (verifies channel access)
  • Missing credentials (auto-setup on first run)

Security Notes

  • Never share your bot token publicly
  • Store the bot token securely (consider using environment variables)
  • Ensure the bot has minimal required permissions
  • Only invite the bot to servers you trust

Troubleshooting

Bot won't start

  • Check that your bot token is correct
  • Ensure discord.py is installed (pip install discord.py)

Can't find channel

  • Verify the channel ID is correct
  • Make sure the bot has access to the channel
  • Check that the bot is in the same server as the channel

User not found errors

  • Ensure the user ID is valid and the user exists
  • The bot can only fetch information for users it shares servers with or public users

Invalid token errors

  • The bot will automatically detect invalid tokens
  • It will prompt you to reconfigure credentials
  • Simply restart the program to enter new credentials

Support Server

Join our Discord for help and community support: https://discord.gg/tsbBKz2k53

Creator

Created by Atif Ahmed 🖤

Requirements

  • Python 3.8+
  • discord.py 2.3.0+
  • python-dotenv 1.0.0+
  • Active internet connection
  • Valid Discord bot token
  • Discord server with bot invited

About

A Python Discord bot that fetches user information and sends it to a specified channel. The bot runs from the command line and continuously prompts for user IDs to process.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages