Skip to content

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.

Notifications You must be signed in to change notification settings

NathanKong06/Discord-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Bot

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.

Installation

  1. Clone the repository:

    git clone https://github.com/NathanKong06/Discord-Bot.git
    cd Discord-Bot
  2. Create and activate a virtual environment (optional but recommended):

    python3 -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the required dependencies:

    pip install -r requirements.txt
  4. Create a .env file in the root directory and add your Discord bot token:

    DISCORD_TOKEN=your_discord_bot_token_here

Usage

Run the bot with:

python bot.py

Make sure your bot is invited to your Discord server with the appropriate permissions.

Commands

Use / in your Discord chat to see available commands.

/gender

Predict gender from a name.

  • Parameters:
    • name: The name to analyze (string)
    • country (optional): 2-letter country code (e.g., US, GB)

/age

Predict age from a name.

  • Parameters:
    • name: The name to analyze (string)
    • country (optional): 2-letter country code (e.g., US, GB)

/nationality

Predict nationality from a name.

  • Parameters:
    • name: The name to analyze (string)

/allinfo

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

/countryinfo

Get detailed information about a country.

  • Parameters:
    • country_code: Only accepts 2-letter ISO country codes (e.g., US, GB, FR)

/catfact

Get a random cat fact.

/help

Show all available commands.

  • Notes:
    • Displays a list of commands and brief descriptions in an embed.

Notes

  • 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.commands scope 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.

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages