{"id":26984136,"url":"https://github.com/keshon/purge-bot","last_synced_at":"2025-04-03T17:34:49.187Z","repository":{"id":251319023,"uuid":"837052304","full_name":"keshon/purge-bot","owner":"keshon","description":"Discord bot for purging old messages ","archived":false,"fork":false,"pushed_at":"2025-03-28T06:19:26.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T07:22:45.289Z","etag":null,"topics":["auto-delete","auto-deletion","discord-bot"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keshon.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}},"created_at":"2024-08-02T05:43:38.000Z","updated_at":"2025-03-28T06:19:29.000Z","dependencies_parsed_at":"2024-11-16T08:15:45.062Z","dependency_job_id":null,"html_url":"https://github.com/keshon/purge-bot","commit_stats":null,"previous_names":["keshon/purge-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keshon%2Fpurge-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keshon%2Fpurge-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keshon%2Fpurge-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keshon%2Fpurge-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keshon","download_url":"https://codeload.github.com/keshon/purge-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247048704,"owners_count":20875097,"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":["auto-delete","auto-deletion","discord-bot"],"created_at":"2025-04-03T17:34:48.671Z","updated_at":"2025-04-03T17:34:49.185Z","avatar_url":"https://github.com/keshon.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🗑️ PurgeBot 🗑️\n\nWelcome to **PurgeBot**! This bot helps manage and clean up your Discord server by automatically purging old messages from channels based on your specified duration. Whether you need to clear out outdated messages or keep your channels tidy, PurgeBot has you covered.\n\n## 🚀 Features\n\n- **Purge Old Messages**: Automatically delete messages older than a specified duration.\n- **Stop Purging**: Easily stop the purging task for a channel.\n- **List Purge Tasks**: Get a list of all active purge tasks in your guild.\n- **Add or Remove Users/Roles**: Grant or revoke permission for specific users or roles to manage purge tasks.\n\n## 🛠️ Setup\n\n### 1. Prerequisites\n\n- **Go**: Ensure you have Go installed on your system.\n- **Discord Bot Token**: Create a bot on [Discord Developer Portal](https://discord.com/developers/applications) and get your token.\n- **SQLite**: The bot uses SQLite for database storage.\n\n### 2. Installation\n\n1. **Clone the repository:**\n\n    ```bash\n    git clone https://github.com/keshon/purge-bot.git\n    cd purge-bot\n    ```\n\n2. **Install dependencies:**\n\n    ```bash\n    go mod tidy\n    ```\n\n3. **Set up your environment:**\n\n    Create a `.env` file in the root directory with the following content:\n\n    ```env\n    DISCORD_KEY=your-discord-bot-token\n    ```\n\n4. **Run the bot:**\n\n    ```bash\n    go run main.go\n    ```\n\n## 📜 Commands\n\n### Purge Old Messages\n\nAutomatically purge old messages in the channel.\n\n- **Usage:** `@PurgeBot \u003cduration\u003e`\n- **Example:** `@PurgeBot 30s` (purges messages older than 30 seconds)\n- **Note:** `@PurgeBot` is just an example. The actual bot mention may vary based on the bot's name or configuration.\n\n### Stop Purge Task\n\nStop the active purge task in the channel.\n\n- **Usage:** `@PurgeBot stop`\n\n### List Purge Tasks\n\nGet a list of all channels with active purge tasks in the guild.\n\n- **Usage:** `@PurgeBot list`\n\n### Add User\n\nGrant a user permission to manage purge tasks. You can use either username or user ID.\n\n- **Usage:** `@PurgeBot adduser \u003cusername\u003e` or `@PurgeBot adduserid \u003cuserID\u003e`\n- **Example:** `@PurgeBot adduser JohnDoe` or `@PurgeBot adduserid 339767128292982785`\n\n### Remove User\n\nRevoke a user's permission to manage purge tasks. You can use either username or user ID.\n\n- **Usage:** `@PurgeBot removeuser \u003cusername\u003e` or `@PurgeBot removeuserid \u003cuserID\u003e`\n- **Example:** `@PurgeBot removeuser JohnDoe` or `@PurgeBot removeuserid 339767128292982785`\n\n### Add Role\n\nGrant a role permission to manage purge tasks. You can use either role name or role ID.\n\n- **Usage:** `@PurgeBot addrole \u003croleName\u003e` or `@PurgeBot addroleid \u003croleID\u003e`\n- **Example:** `@PurgeBot addrole Admin` or `@PurgeBot addroleid 1274017921756172403`\n\n### Remove Role\n\nRevoke a role's permission to manage purge tasks. You can use either role name or role ID.\n\n- **Usage:** `@PurgeBot removerole \u003croleName\u003e` or `@PurgeBot removeroleid \u003croleID\u003e`\n- **Example:** `@PurgeBot removerole Admin` or `@PurgeBot removeroleid 1274017921756172403`\n\n### List Permissions\n\nGet a list of all users and roles registered to manage purge tasks, including their names.\n\n- **Usage:** `@PurgeBot listpermissions`\n\n### Help\n\nGet detailed usage instructions and a list of available commands.\n\n- **Usage:** `@PurgeBot help`\n\n## ⚙️ Configuration\n\n- **Purge Interval**: The interval at which the bot checks for messages to purge (default: 33 seconds).\n- **Minimum Duration**: The minimum duration for purging tasks (default: 30 seconds).\n- **Maximum Duration**: The maximum duration for purging tasks (default: 3333 days).\n\n## 🗳️ Invite the Bot\n\nTo invite **PurgeBot** to your server, use the following invite link format:\n\n`https://discord.com/oauth2/authorize?client_id=YOUR_APPLICATION_ID\u0026scope=bot\u0026permissions=75776`\n\n**Required Permissions:**\n- **Read Messages**\n- **Send Messages**\n- **Manage Messages** (for purging messages)\n- **Read Message History**\n\nReplace `YOUR_APPLICATION_ID` in the URL with your bot's actual application ID from the Discord Developer Portal.\n\n## 📝 Example\n\nHere's how you can use PurgeBot in your server:\n\n1. **Start purging messages older than 1 hour:**\n\n    ```markdown\n    @PurgeBot 1h\n    ```\n\n2. **Stop purging in a channel:**\n\n    ```markdown\n    @PurgeBot stop\n    ```\n\n3. **Get a list of all purge tasks:**\n\n    ```markdown\n    @PurgeBot list\n    ```\n\n4. **Add a user to manage purge tasks:**\n\n    ```markdown\n    @PurgeBot adduser JohnDoe\n    ```\n\n5. **Remove a user from managing purge tasks:**\n\n    ```markdown\n    @PurgeBot removeuser JohnDoe\n    ```\n\n6. **Add a role to manage purge tasks:**\n\n    ```markdown\n    @PurgeBot addrole Admin\n    ```\n\n7. **Remove a role from managing purge tasks:**\n\n    ```markdown\n    @PurgeBot removerole Admin\n    ```\n\n8. **Get a list of all registered users and roles:**\n\n    ```markdown\n    @PurgeBot listpermissions\n    ```\n\n9. **Get help:**\n\n    ```markdown\n    @PurgeBot help\n    ```\n\n## 🙏 Acknowledgements\n\n**PurgeBot** was inspired by the original [KMS Bot](https://github.com/internetisgone/kms-bot) project. The original bot, written in Python, provided the foundational concept for this Go implementation. A special thanks to the creator of that project!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeshon%2Fpurge-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeshon%2Fpurge-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeshon%2Fpurge-bot/lists"}