{"id":16254579,"url":"https://github.com/tim-smart/dfx","last_synced_at":"2026-04-02T12:34:33.460Z","repository":{"id":64236459,"uuid":"469915562","full_name":"tim-smart/dfx","owner":"tim-smart","description":"A Discord library for effect-ts","archived":false,"fork":false,"pushed_at":"2026-02-20T03:26:00.000Z","size":6401,"stargazers_count":111,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-02-20T07:36:35.817Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/tim-smart.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2022-03-14T21:49:27.000Z","updated_at":"2026-02-20T03:26:04.000Z","dependencies_parsed_at":"2023-12-18T04:31:10.737Z","dependency_job_id":"b26f530a-c291-4638-ab1a-4dbd9718d97f","html_url":"https://github.com/tim-smart/dfx","commit_stats":{"total_commits":400,"total_committers":2,"mean_commits":200.0,"dds":"0.22250000000000003","last_synced_commit":"6d9121029f020f09839475fabffa3bfa402f99b5"},"previous_names":[],"tags_count":333,"template":false,"template_full_name":null,"purl":"pkg:github/tim-smart/dfx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tim-smart%2Fdfx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tim-smart%2Fdfx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tim-smart%2Fdfx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tim-smart%2Fdfx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tim-smart","download_url":"https://codeload.github.com/tim-smart/dfx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tim-smart%2Fdfx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29965419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T06:55:38.174Z","status":"ssl_error","status_checked_at":"2026-03-01T06:53:04.810Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2024-10-10T15:22:59.852Z","updated_at":"2026-03-01T09:02:24.278Z","avatar_url":"https://github.com/tim-smart.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dfx\n\n[![Discord](https://img.shields.io/discord/887189613389705256?style=for-the-badge)](https://discord.gg/dtR2Mtu66Q)\n\nA Discord library built on top of effect\n\n- Supports both the gateway and webhooks\n- Simple yet powerful abstractions to build Discord bots\n\n## Example\n\n```typescript\nimport { NodeHttpClient, NodeRuntime, NodeSocket } from \"@effect/platform-node\"\nimport { DiscordConfig, Ix } from \"dfx\"\nimport { DiscordIxLive, InteractionsRegistry } from \"dfx/gateway\"\nimport { Config, Effect, Layer } from \"effect\"\n\n// Create a layer for the discord services\nconst DiscordLayer = DiscordIxLive.pipe(\n  Layer.provide([\n    DiscordConfig.layerConfig({\n      token: Config.redacted(\"DISCORD_BOT_TOKEN\"),\n    }),\n    NodeHttpClient.layerUndici,\n    NodeSocket.layerWebSocketConstructor,\n  ]),\n)\n\n// Create hello service\nconst HelloLayer = Layer.effectDiscard(\n  Effect.gen(function* () {\n    const registry = yield* InteractionsRegistry\n\n    // Create hello command that responds with \"Hello!\"\n    const hello = Ix.global(\n      {\n        name: \"hello\",\n        description: \"A basic command\",\n      },\n      Effect.succeed({\n        type: 4,\n        data: {\n          content: \"Hello!\",\n        },\n      }),\n    )\n\n    // register the command(s) and handle errors\n    yield* registry.register(\n      Ix.builder.add(hello).catchAllCause(Effect.logError),\n    )\n  }),\n).pipe(\n  // provide discord layer\n  Layer.provide(DiscordLayer),\n)\n\n// Construct the main layer\nconst MainLive = Layer.mergeAll(\n  // add your other services here\n  HelloLayer,\n)\n\n// run it\nNodeRuntime.runMain(Layer.launch(MainLive))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftim-smart%2Fdfx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftim-smart%2Fdfx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftim-smart%2Fdfx/lists"}