{"id":20670099,"url":"https://github.com/gitpod-io/optimus","last_synced_at":"2025-04-19T18:13:44.390Z","repository":{"id":40302796,"uuid":"362179005","full_name":"gitpod-io/optimus","owner":"gitpod-io","description":"An ordinary discord bot that empowers the @gitpod-io and @supremegamers Discord servers","archived":false,"fork":false,"pushed_at":"2025-02-05T01:39:08.000Z","size":2875,"stargazers_count":27,"open_issues_count":9,"forks_count":11,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-29T11:34:33.198Z","etag":null,"topics":["discord","discord-bot"],"latest_commit_sha":null,"homepage":"https://top.gg/bot/648118759105757185","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gitpod-io.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":"2021-04-27T16:26:11.000Z","updated_at":"2025-03-18T10:20:28.000Z","dependencies_parsed_at":"2025-02-05T02:32:02.573Z","dependency_job_id":"f49d7673-cb17-4185-b381-9b5e09463657","html_url":"https://github.com/gitpod-io/optimus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitpod-io%2Foptimus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitpod-io%2Foptimus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitpod-io%2Foptimus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gitpod-io%2Foptimus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gitpod-io","download_url":"https://codeload.github.com/gitpod-io/optimus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249760336,"owners_count":21321844,"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"],"created_at":"2024-11-16T20:18:00.953Z","updated_at":"2025-04-19T18:13:44.354Z","avatar_url":"https://github.com/gitpod-io.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Optimus - Gitpod Community Discord Bot\n\nThis repo contains the code that runs the Gitpod Community Discord Bot.\n\nCommunity contribuitions are welcome! 🧡 Please create an issue and open a Gitpod workspace from that context.\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/gitpod-io/optimus)\n\n## Contributing\n\nYou wanna contribute!? That sounds awesome! Thank you for taking the step to contribute towards this project :)\n\n## Getting started\n\n### Creating a Bot application on Discord's dev portal\n\n- Login on https://discord.com/developers/applications\n- Create a new app by clicking on `New Application` on the top right\n- Inside your bot page, click on 🧩 `Bot` from the left sidebar and then `Add Bot` button\n  - In the same page, toggle on the following options: `Presence Intent`, `Server Members Intent` and `Message Content Intent`\n- Go to **OAuth2 \u003e URL Generator** from your left sidebar\n  - Tick `Scopes: bot, application.commands` and `Bot permissions: Adminstrator`. It should look like below:\n    ![OAuth2 example](https://user-images.githubusercontent.com/39482679/232367860-f7342e8e-84aa-44e1-9a5c-d1f935d43d45.png)\n\n  - Scroll to the bottom of this page and copy paste the **GENERATED-URL** into your browser tab to add the bot to a discord server. I recommend creating a new Discord server for bot development purposes.\n\n### Running the BOT from Gitpod for development\n\n- If you don't have `./BotConfig.toml` file, create it by copying [./ExampleBotConfig.toml](./ExampleBotConfig.toml). So, you could run: `cp ExampleBotConfig.toml BotConfig.toml`\n\n- Update/fill-up `./BotConfig.toml` with the token from your 🧩 `Bot` page on discord dev portal. You might need to reset it to see.\n    ![bot token](https://user-images.githubusercontent.com/39482679/232367937-8767dbb4-d11e-4de0-ba6a-d8dbdd01c422.png)\n\n- To persist the config changes accross development Gitpod workspaces:\n\n```bash\n# Run this every time after making changes to ./BotConfig.toml\ngp env DISCORD_BOT_CONFIG_ENCODED=\"$(base64 -w0 BotConfig.toml)\"\n```\n\n- In Gitpod terminal, run the BOT in the following manner:\n\n```bash\ncargo run\n```\n\n\u003e **Note**\n\u003e You can also explicitly specify a path for your config.\n\u003e For example:\n\n```bash\n# From cargo\ncargo run -- BotConfig.toml\n\n# From a release binary\n./target/release/optimus /some/arbitrary/path/to/your_config.toml\n```\n\n## Meilisearch, GitHub and OpenAI integration\n\nSome (optional) features use Meilisearch, GitHub and OpenAI API.\n\nNote: This part is undocumented, will be done soon.\n\n## Deploying a release build to production server\n\nMinimal resource requirements:\n\n- optimus bot: 13-20MB RAM\n- [optional] meilisearch: 100MB RAM (for indexing)\n\nIn conclusion, a server with 128MB RAM (+SWAP), shared CPU and 1GB storage will do.\n\n### barebones\n\n- WIP (will be written soon)\n\n### systemd\n\n- WIP (will be written soon)\n\n### Docker\n\nDocker would come handy in case you want something that JustWorks™️.\n\n**Preparing the config:**\n\n```bash\n# Get the sample config\ncurl -o BotConfig.toml -L https://raw.githubusercontent.com/gitpod-io/optimus/main/ExampleBotConfig.toml\n\n# Update the config with your bot token and application ID\nvim BotConfig.toml # or nano, or any other editor\n```\n\n**Starting the container:**\n\n```bash\n# You can also start in detached mode by passing `-d` to `run` subcommand\ndocker run --init --name optimus -v $(pwd)/BotConfig.toml:/app/BotConfig.toml -t ghcr.io/gitpod-io/optimus:main\n# You can press Ctrl+c to stop\n# If using meilisearch, its database will be stored at `/app/data.ms` inside the `optimus` container\n```\n\n**Restarting the container:**\n\n```bash\n# Ensure it's stopped\ndocker container stop -t 2 optimus\n\n# Starts and attach to it\ndocker container start -a optimus\n# Press Ctrl+c to detach\n\n# To attach back\ndocker attach optimus\n\n# In case you want to stop again:\ndocker container stop -t 2 optimus\n```\n\nIf you are hardware resource constrained, you can use the [barebones](#barebones) or [systemd](#systemd) method instead.\n\n### Docker compose\n\nThe [docker](#docker) method is enough, using docker-compose for this would be overkill in terms of hardware resources 🌳\n\n### GCP\n\n- Create a **f1-micro** (~600MB RAM) Linux VM from **Compute Engine \u003e VM Instances**. For example, with `gcloud` CLI:\n\n```bash\ngcloud compute instances create discord-optimus-bot \\\n    --zone=us-central1-a \\\n    --machine-type=f1-micro \\\n    --network-interface=network-tier=PREMIUM,subnet=default \\\n    --maintenance-policy=MIGRATE \\\n    --provisioning-model=STANDARD \\\n    --create-disk=auto-delete=no,boot=yes,device-name=discord-optimus-bot,image=projects/ubuntu-os-cloud/global/images/ubuntu-minimal-2204-jammy-v20230302,mode=rw,size=10 \\\n    --no-shielded-secure-boot \\\n    --no-shielded-vtpm \\\n    --no-shielded-integrity-monitoring \\\n    --labels=ec-src=vm_add-gcloud \\\n    --reservation-affinity=any\n```\n\n- WIP (will be written soon)\n\n## Also see\n\n- https://github.com/gitpod-io/gitpod-qa (AI powered chatbot)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitpod-io%2Foptimus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgitpod-io%2Foptimus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgitpod-io%2Foptimus/lists"}