A Discord bot that predicts gender, age, and nationality based on a given name using external APIs, and provides additional information such as country details and random cat facts.
-
Clone the repository:
git clone https://github.com/NathanKong06/Discord-Bot.git cd Discord-Bot -
Create and activate a virtual environment (optional but recommended):
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Create a
.envfile in the root directory and add your Discord bot token:DISCORD_TOKEN=your_discord_bot_token_here
Run the bot with:
python bot.pyMake sure your bot is invited to your Discord server with the appropriate permissions.
Use / in your Discord chat to see available commands.
Predict gender from a name.
- Parameters:
name: The name to analyze (string)country(optional): 2-letter country code (e.g., US, GB)
Predict age from a name.
- Parameters:
name: The name to analyze (string)country(optional): 2-letter country code (e.g., US, GB)
Predict nationality from a name.
- Parameters:
name: The name to analyze (string)
Predict age, gender, and nationality from a name.
- Parameters:
name: The name to analyze (string)country(optional): 2-letter country code for age/gender predictions
Get detailed information about a country.
- Parameters:
country_code: Only accepts 2-letter ISO country codes (e.g., US, GB, FR)
Get a random cat fact.
Show all available commands.
- Notes:
- Displays a list of commands and brief descriptions in an embed.
-
The bot uses external APIs:
-
Accuracy depends on the data available in these APIs.
-
Country codes should be provided as two-letter ISO codes (e.g., US, GB).
-
Make sure your bot has the
applications.commandsscope enabled in the Discord Developer Portal to use slash commands. -
All command responses are now displayed in Discord embeds for enhanced readability and user experience.