{"id":15069170,"url":"https://github.com/vyfor/kpresence","last_synced_at":"2025-04-10T16:52:13.059Z","repository":{"id":227075096,"uuid":"770371275","full_name":"vyfor/KPresence","owner":"vyfor","description":"📦 Lightweight Kotlin Multiplatform library for Discord Rich Presence","archived":false,"fork":false,"pushed_at":"2025-03-10T15:59:38.000Z","size":253,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T14:44:33.928Z","etag":null,"topics":["discord","discord-presence","discord-rpc","java","jvm","kotlin","kotlin-native","presence","rich","rich-presence","rpc"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/vyfor.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-03-11T12:44:01.000Z","updated_at":"2025-03-10T15:59:08.000Z","dependencies_parsed_at":"2024-03-17T14:25:06.822Z","dependency_job_id":"45ae36ac-21a1-417e-92f3-8554105a5275","html_url":"https://github.com/vyfor/KPresence","commit_stats":null,"previous_names":["reblast/kpresence","vyfor/kpresence"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyfor%2FKPresence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyfor%2FKPresence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyfor%2FKPresence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vyfor%2FKPresence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vyfor","download_url":"https://codeload.github.com/vyfor/KPresence/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248256217,"owners_count":21073484,"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-presence","discord-rpc","java","jvm","kotlin","kotlin-native","presence","rich","rich-presence","rpc"],"created_at":"2024-09-25T01:40:52.423Z","updated_at":"2025-04-10T16:52:13.052Z","avatar_url":"https://github.com/vyfor.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧩 KPresence\n\n**📦 A lightweight, cross-platform [Kotlin Multiplatform](https://kotlinlang.org/docs/multiplatform.html) library for interacting with Discord Rich Presence.**\n\n## 💎 Features\n- Cross-platform compatibility (Windows, Linux, macOS)\n- Fast and user-friendly\n- Offers DSL support\n- Provides both JVM and Native implementations\n- Validates the activity fields before sending them\n- Supports Flatpak and Snap installations on Linux\n- Ability to extend and override the default search paths\n\n## 🔌 Requirements\n- **Java**: `16 or later` (only for use within the JVM environment)\n\n## ⚙️ Installation\n\n```gradle\ndependencies {\n    implementation(\"io.github.vyfor:kpresence:0.6.5\")\n}\n```\n\n## ✨ Examples\n\n### Initial connection and presence updates\n```kt\nval client = RichClient(CLIENT_ID)\n  \nclient.connect()\n\nclient.update {\n    type = ActivityType.GAME\n    details = \"Exploring Kotlin Native\"\n    state = \"Writing code\"\n    \n    timestamps {\n        start = now() - 3600_000\n        end = now() + 3600_000\n    }\n    \n    party {\n      id = \"myParty\"\n      size(current = 1, max = 5)\n    }\n    \n    assets {\n        largeImage = \"kotlin_logo\"\n        largeText = \"Kotlin\"\n        smallImage = \"jetbrains_logo\"\n        smallText = \"JetBrains\"\n    }\n    \n    secrets {\n        join = \"joinSecret\"\n        spectate = \"spectateSecret\"\n        match = \"matchSecret\"\n    }\n    \n    button(\"Learn more\", \"https://kotlinlang.org/\")\n    button(\"Try it yourself\", \"https://play.kotlinlang.org/\")\n}\n```\n\n### Event handling\n```kt\nval client = RichClient(CLIENT_ID)\n\nclient.on\u003cReadyEvent\u003e {\n  update(activity)\n}\n\nclient.on\u003cActivityUpdateEvent\u003e {\n  logger?.info(\"Updated rich presence\")\n}\n\nclient.on\u003cDisconnectEvent\u003e {\n  connect(shouldBlock = true) // Attempt to reconnect\n}\n\nclient.connect(shouldBlock = false)\n```\n\n### Logging\n```kt\nval client = RichClient(CLIENT_ID)\nclient.logger = ILogger.default()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvyfor%2Fkpresence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvyfor%2Fkpresence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvyfor%2Fkpresence/lists"}