{"id":24772545,"url":"https://github.com/antosser/discord-p-table-bot","last_synced_at":"2026-05-10T09:39:48.001Z","repository":{"id":274530180,"uuid":"922706455","full_name":"Antosser/discord-p-table-bot","owner":"Antosser","description":"A Discord bot that checks if messages can be represented using periodic table symbols and responds with the decomposition","archived":false,"fork":false,"pushed_at":"2025-01-27T20:45:34.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T20:45:01.907Z","etag":null,"topics":["bot","chemistry","discord","docker","p-table","periodic-table","python"],"latest_commit_sha":null,"homepage":"","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/Antosser.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":"2025-01-26T22:09:32.000Z","updated_at":"2025-02-12T17:17:27.000Z","dependencies_parsed_at":"2025-01-27T21:39:40.571Z","dependency_job_id":"0c5f2174-685e-4a7b-bddd-dcf24fcf758e","html_url":"https://github.com/Antosser/discord-p-table-bot","commit_stats":null,"previous_names":["antosser/discord-p-table-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Antosser%2Fdiscord-p-table-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Antosser%2Fdiscord-p-table-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Antosser%2Fdiscord-p-table-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Antosser%2Fdiscord-p-table-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Antosser","download_url":"https://codeload.github.com/Antosser/discord-p-table-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245168813,"owners_count":20571799,"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":["bot","chemistry","discord","docker","p-table","periodic-table","python"],"created_at":"2025-01-29T04:23:18.023Z","updated_at":"2026-05-10T09:39:47.968Z","avatar_url":"https://github.com/Antosser.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discord Periodic Table Bot\n\nThis project is a Discord bot that analyzes user messages to determine if they can be represented using symbols from the periodic table of elements. If a message qualifies, the bot responds with the decomposition of the message into periodic table symbols.\n\n![image](https://github.com/user-attachments/assets/cbd9ff04-2b0f-4072-9c11-e0b3c77d18e3)\n\n## Features\n\n- Responds to messages in Discord channels.\n- Checks if a message can be represented entirely using periodic table symbols.\n- Sends a congratulatory message with the decomposition of the message if successful.\n- Logs the decomposition to the console for debugging and verification.\n\n## Requirements\n\n- Python 3.8+ (for running natively).\n- Docker and Docker Compose (for containerized usage).\n- A Discord account and bot token.\n- Required Python libraries (see `requirements.txt`).\n\n## Installation and Usage\n\n### Option 1: Running Natively\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/yourusername/discord-p-table-bot.git\n   cd discord-p-table-bot\n   ```\n\n2. Set up a virtual environment (optional but recommended):\n\n   ```bash\n   python3 -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   ```\n\n3. Install the dependencies:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. Create a `.env` file in the root directory and add your bot token:\n\n   ```env\n   TOKEN=your_discord_bot_token\n   ```\n\n5. Enable the **MESSAGE CONTENT INTENT** for your bot in the Discord Developer Portal:\n   - Go to the **Bot** section of your application settings.\n   - Enable the **MESSAGE CONTENT INTENT**.\n\n6. Run the bot:\n\n   ```bash\n   python main.py\n   ```\n\n### Option 2: Running with Docker\n\nThe bot is also ready to run in a Docker container. Ensure Docker and Docker Compose are installed on your system.\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/yourusername/discord-p-table-bot.git\n   cd discord-p-table-bot\n   ```\n\n2. Create a `.env` file in the root directory and add your bot token:\n\n   ```env\n   TOKEN=your_discord_bot_token\n   ```\n\n3. Start the bot using Docker Compose:\n\n   ```bash\n   docker compose up -d\n   ```\n\n   This command will:\n   - Build the Docker image.\n   - Start the bot container in detached mode.\n\n4. To view logs from the running container:\n\n   ```bash\n   docker logs -f \u003ccontainer_name\u003e\n   ```\n\n   Replace `\u003ccontainer_name\u003e` with the name of the container (e.g., `discord-p-table-bot_main`).\n\n5. To stop the bot:\n\n   ```bash\n   docker compose down\n   ```\n\n## File Structure\n\n- `main.py`: The main bot script.\n- `ptable.py`: Contains the `decompose_into_symbols` function to break a message into periodic table symbols.\n- `.env`: File for storing the bot token (not included in the repository for security).\n- `requirements.txt`: List of Python dependencies.\n- `Dockerfile`: Configuration for building the bot's Docker image.\n- `compose.yml`: Docker Compose file for managing the containerized bot.\n\n## Example\n\nMessage:  \n```\nNeon\n```\n\nBot Response:  \n```\nCongratulations! Your message can be written only using symbols from the periodic table! (`Ne`, `O`, `N`)\n```\n\nConsole Log:  \n```\nDecomposed message: Neon -\u003e ['Ne', 'O', 'N']\n```\n\n## Contributing\n\nContributions are welcome! Feel free to open an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantosser%2Fdiscord-p-table-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantosser%2Fdiscord-p-table-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantosser%2Fdiscord-p-table-bot/lists"}