{"id":28340901,"url":"https://github.com/natuworkguy/discord-bot","last_synced_at":"2025-06-12T05:07:43.888Z","repository":{"id":293799553,"uuid":"985163243","full_name":"Natuworkguy/Discord-Bot","owner":"Natuworkguy","description":"A customizable discord bot to fit your server","archived":false,"fork":false,"pushed_at":"2025-05-19T22:11:47.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T15:08:40.649Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Natuworkguy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-05-17T07:31:17.000Z","updated_at":"2025-05-19T22:11:50.000Z","dependencies_parsed_at":"2025-05-17T08:39:44.693Z","dependency_job_id":null,"html_url":"https://github.com/Natuworkguy/Discord-Bot","commit_stats":null,"previous_names":["natuworkguy/discord-bot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Natuworkguy/Discord-Bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natuworkguy%2FDiscord-Bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natuworkguy%2FDiscord-Bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natuworkguy%2FDiscord-Bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natuworkguy%2FDiscord-Bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Natuworkguy","download_url":"https://codeload.github.com/Natuworkguy/Discord-Bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Natuworkguy%2FDiscord-Bot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259402145,"owners_count":22851877,"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":[],"created_at":"2025-05-27T03:51:45.561Z","updated_at":"2025-06-12T05:07:43.869Z","avatar_url":"https://github.com/Natuworkguy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Customizable Discord Bot\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Python](https://img.shields.io/badge/Python-3.8%2B-blue.svg)](https://www.python.org/)\n[![Maintained by](https://img.shields.io/badge/Maintained%20by-Natuworkguy-blueviolet)](https://github.com/Natuworkguy)\n\nA simple, highly customizable Discord bot designed to give developers total control over response behavior through a single file: `responses.py`.\n\n---\n\n## ✨ Features\n\n- 🧩 **Fully Customizable**: Tailor the bot's behavior by editing `responses.py`.\n- ⚡ **Fast \u0026 Lightweight**: Minimal dependencies for quick deployment.\n- 🧪 **Modular Design**: Easy to extend and maintain.\n- 🔒 **.env Support**: Secure your token and sensitive configuration.\n\n---\n\n## 📁 Project Structure\n\n```bash\ndbot/\n├── .env               # Store your Discord bot token here\n├── banner.py          # Banner display on startup\n├── main.py            # Main bot logic\n├── responses.py       # Edit this file to define custom bot responses\n├── requirements.txt   # Python package dependencies\n└── startup.sh         # Shell script to launch the bot\n````\n\n---\n\n## 🛠️ Setup Instructions\n\n1. **Clone the repository**:\n\n   ```bash\n   git clone https://github.com/Natuworkguy/dbot.git\n   cd dbot\n   ```\n\n2. **Create your `.env` file** (if not present):\n\n   ```\n   DISCORD_TOKEN=your_discord_bot_token_here\n   ```\n\n3. **Install dependencies**:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. **Customize the bot**:\n\n   Open `responses.py` and start customizing your bot’s response logic.\n\n5. **Run the bot**:\n\n   ```bash\n   python main.py\n   ```\n\n   Or use the provided shell script:\n\n   ```bash\n   ./startup.sh\n   ```\n\n---\n\n## 🧠 How to Customize\n\nOpen `responses.py`. This is where you define how your bot responds to different messages. You can define any number of conditions and customize replies however you want.\n\nDefault logic:\n\n```python\nclass Responses:\n    def __init__(self):\n        self.mute = False\n        self.API_KEY = os.getenv(\"GCLOUD_API_KEY\")\n        if self.API_KEY == None or self.API_KEY == '':\n            raise BotResponseError(\"Google Cloud API key in .env is empty.\")\n        self.url = f\"https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key={self.API_KEY}\"\n    def get_response(self, user_input: str) -\u003e str:\n        if user_input == \"?mute\" and self.mute == False:\n            self.mute = True\n            return \"Ok! I will no longer respond. Unmute me with ?unmute.\"\n        if user_input == \"?unmute\" and self.mute == True:\n            self.mute = False\n            return \"I am no longer muted. Re-mute me with ?mute\"\n        if self.mute:\n            return None\n        payload: dict[str: list[dict[str: list[dict[str: str|int|None]]]]] = {\"contents\": [{\"parts\":[{\"text\": user_input}]}]}\n        response = requests.post(self.url, headers={\"Content-Type\": \"application/json\"}, data=json.dumps(payload))\n        if response.status_code == 200:\n            return response.json()['candidates'][0]['content']['parts'][0]['text']\n        else:\n            raise BotResponseError(f\"Request failed with status code {response.status_code}: {response.text}\")\n```\n\n---\n\n## 📜 License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n\n## 👤 Maintainer\n\nMade with ❤️ by [Natuworkguy](https://github.com/Natuworkguy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatuworkguy%2Fdiscord-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatuworkguy%2Fdiscord-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatuworkguy%2Fdiscord-bot/lists"}