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.
- 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
!infocommand for bot information and support
pip install -r requirements.txt- Go to Discord Developer Portal
- Click "New Application" and give it a name
- Go to "Bot" section and click "Add Bot"
- Copy the bot token
- Enable the following intents:
- Message Content Intent
- Server Members Intent
- Go to "OAuth2" > "URL Generator"
- Select scopes:
bot - Select bot permissions:
- Send Messages
- Use Slash Commands
- Read Message History
- Embed Links
- Copy the generated URL and invite the bot to your server
Automatic Setup (Recommended):
Just run the bot! It will automatically prompt you for credentials if no .env file exists:
python main.pyThe 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.
python main.py- Start the bot using
python main.py - Wait for the "Discord User Info Bot - Ready!" message
- Enter user IDs when prompted with "📝 Enter User ID:"
- The bot will fetch user information and send a rich embed to the configured channel
- Type
quit,exit, orstopto terminate the bot - Use Ctrl+C as an alternative way to stop the bot
!info: Display bot information, features, support server, and creator details
When you enter a user ID, the bot will:
- Validate the input
- Fetch user information from Discord
- 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
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_hereThe 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)
- 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
- Check that your bot token is correct
- Ensure discord.py is installed (
pip install discord.py)
- 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
- 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
- The bot will automatically detect invalid tokens
- It will prompt you to reconfigure credentials
- Simply restart the program to enter new credentials
Join our Discord for help and community support: https://discord.gg/tsbBKz2k53
Created by Atif Ahmed 🖤
- 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
