/fetch-discord-guild-members-selfbot

Python Discord selfbot that fetches and saves guild member data into a .csv file. It includes commands for interaction and customization.

Primary LanguagePythonMIT LicenseMIT

Guild Members Fetcher

Guild Members Fetcher is a Discord selfbot that fetches all the members from a specified guild and saves the data into a .csv file. The bot is built using Python and the discord.py-self library.

Features

  • Fetches all members from a specified guild.
  • Save the fetched data into a .csv file (currently, only the member's ID, username, display name, joined date, account creation date, mutual guilds and servers — count and comma-separated list (name (id)) for both)
  • Interface with the bot in Discord using "commands."

Installation

  1. Clone the repository:
git clone https://github.com/your-repo/guild-members-fetcher.git
  1. Install the required dependencies (you can create a virtual environment first):
pip install -r requirements.txt
  1. Replace the TOKEN in constants.py with your Discord bot token.

Usage

Run the bot:

python main.py

Use the following commands in any Discord channel (strongly recommended to use private channels):

  • membersfetcher help - Display the help message.
  • mf run <guild_id> [<file_name>] - Fetch members from guild and save them into a .csv file.
  • mf shutdown - Kills the bot instance.

Customization

You can customize the bot to better suit your needs by modifying the following parameters in the constants.py file:

  • OUTPUT_PATH: This is the directory where the .csv files will be saved. By default, it's the relative out directory.

  • MEMBER_SIDEBAR_SCRAPING_DELAY: This is the delay (in seconds) between each page scraping of the member sidebar in Discord. Default value (0.1) should avoid you getting rate-limited.

  • MEMBER_SCRAPING_DELAY: This is the delay (in seconds) between each retrieval of a member's data. Default value (0.5) should avoid you getting rate-limited.

Contributing

Pull requests are welcome. :)
For major changes, please open an issue first to discuss what you would like to change.

Credits

License

MIT