{"id":25774371,"url":"https://github.com/lhcee3/online-harms-detection","last_synced_at":"2026-05-04T20:37:31.668Z","repository":{"id":279471973,"uuid":"938925240","full_name":"lhcee3/Online-Harms-Detection","owner":"lhcee3","description":"Harms Detection/Classification Discord Bot","archived":false,"fork":false,"pushed_at":"2025-05-08T15:38:04.000Z","size":256,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T16:44:17.385Z","etag":null,"topics":["discord","discord-bot","firebase","idx","oauth2","pyhton","pyth"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lhcee3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-25T18:01:21.000Z","updated_at":"2025-05-08T15:38:07.000Z","dependencies_parsed_at":"2025-02-25T19:23:07.788Z","dependency_job_id":"780ac052-5241-4b03-a163-8178f1c54545","html_url":"https://github.com/lhcee3/Online-Harms-Detection","commit_stats":null,"previous_names":["lhcee3/online-harms-detection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lhcee3/Online-Harms-Detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhcee3%2FOnline-Harms-Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhcee3%2FOnline-Harms-Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhcee3%2FOnline-Harms-Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhcee3%2FOnline-Harms-Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lhcee3","download_url":"https://codeload.github.com/lhcee3/Online-Harms-Detection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lhcee3%2FOnline-Harms-Detection/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263940262,"owners_count":23533009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord","discord-bot","firebase","idx","oauth2","pyhton","pyth"],"created_at":"2025-02-27T05:29:43.942Z","updated_at":"2026-05-04T20:37:26.646Z","avatar_url":"https://github.com/lhcee3.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discord Text Classification Bot \n![harms bot](https://github.com/user-attachments/assets/2e82487e-b933-476f-b0d5-b5dca1916f89)\n\nThis Discord bot utilizes the Google Gemini Pro API to analyze the content of messages and classify them as \"Neutral/Acceptable\", \"Hate Speech\", or \"Offensive/Vulgar\". It provides a basic moderation tool for Discord servers by flagging messages that fall outside the \"Neutral/Acceptable\" category.\n\n## Features\n\n* **Real-time Message Classification:** The bot analyzes every message sent in the server.\n* **Gemini Pro Integration:** Leverages the powerful Google Gemini Pro model for text analysis.\n* **Classification Feedback:** Notifies the channel when a message is classified as \"Hate Speech\" or \"Offensive/Vulgar\".\n* **Extensible Moderation:** Provides a foundation for implementing more advanced moderation features.\n* **Easy Setup:** Uses environment variables for sensitive data like API keys and bot tokens.\n\n## Prerequisites\n\nBefore running the bot, ensure you have the following:\n\n1.  **Python 3.6+:** Python is required to run the bot.\n2.  **Discord Bot Token:** You'll need to create a Discord bot and obtain its token from the Discord Developer Portal.\n3.  **Google Gemini API Key:** You'll need an API key from Google AI Studio to access the Gemini Pro model.\n4.  **Required Python Libraries:** Install the necessary libraries using pip:\n\n    ```bash\n    pip install discord.py google-generativeai python-dotenv\n    ```\n\n## Setup\n\n1.  **Obtain API Keys and Tokens:**\n    * Create a Discord bot application on the Discord Developer Portal and get the bot token.\n    * Obtain a Google Gemini API key from Google AI Studio.\n2.  **Set Environment Variables:**\n    * Create a `.env` file in the same directory as your Python script.\n    * Add your Discord bot token and Google Gemini API key to the `.env` file:\n\n        ```\n        DISCORD_TOKEN=YOUR_DISCORD_BOT_TOKEN\n        GOOGLE_API_KEY=YOUR_GOOGLE_GEMINI_API_KEY\n        ```\n\n        **Important:** Never share your API keys or bot tokens publicly.\n3.  **Invite the Bot to Your Server:**\n    * Use the OAuth2 URL generator on the Discord Developer Portal to create an invite link for your bot.\n    * Invite the bot to your Discord server.\n4.  **Run the Bot:**\n    * Navigate to the directory containing your Python script and `.env` file.\n    * Run the script using Python:\n\n        ```bash\n        python your_bot_script_name.py\n        ```\n        (replace your_bot_script_name.py with the python filename)\n\n## Disclaimer\n\nThis bot provides a basic moderation tool. The accuracy of the classification depends on the capabilities of the old data that this model has been trained on. Expecting state of the art classification accuracy, from this model is simply foolish.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flhcee3%2Fonline-harms-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flhcee3%2Fonline-harms-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flhcee3%2Fonline-harms-detection/lists"}