{"id":13871963,"url":"https://github.com/SwiftcordApp/DiscordKit","last_synced_at":"2025-07-16T01:32:23.774Z","repository":{"id":37911803,"uuid":"492889216","full_name":"SwiftcordApp/DiscordKit","owner":"SwiftcordApp","description":"The Discord API implementation behind Swiftcord, implemented completely from scratch in Swift","archived":false,"fork":false,"pushed_at":"2024-05-29T08:52:25.000Z","size":7163,"stargazers_count":344,"open_issues_count":11,"forks_count":38,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-21T18:04:48.428Z","etag":null,"topics":["bot","discord","discord-bot","framework","library","swift"],"latest_commit_sha":null,"homepage":"https://swiftcord.gitbook.io/discordkit-guide/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SwiftcordApp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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},"funding":{"github":"cryptoAlgorithm","patreon":"cryptoAlgo","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2022-05-16T15:15:07.000Z","updated_at":"2024-11-17T22:25:08.000Z","dependencies_parsed_at":"2023-02-15T14:16:14.530Z","dependency_job_id":"5baed105-eecd-4d40-918e-8689a63648f8","html_url":"https://github.com/SwiftcordApp/DiscordKit","commit_stats":{"total_commits":150,"total_committers":9,"mean_commits":"16.666666666666668","dds":"0.33333333333333337","last_synced_commit":"b141678cc571d971a83b9acdabb3f8f3cfcf34f6"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftcordApp%2FDiscordKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftcordApp%2FDiscordKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftcordApp%2FDiscordKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwiftcordApp%2FDiscordKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SwiftcordApp","download_url":"https://codeload.github.com/SwiftcordApp/DiscordKit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225778867,"owners_count":17522709,"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","discord","discord-bot","framework","library","swift"],"created_at":"2024-08-05T23:00:31.315Z","updated_at":"2024-11-23T19:31:28.408Z","avatar_url":"https://github.com/SwiftcordApp.png","language":"Swift","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/64193267/208341700-75fb1d63-f044-4b60-9c86-ed945916b65c.png\" height=\"128\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eDiscordKit\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca aria-label=\"Join the community on Discord\" href=\"https://discord.gg/he7n6MGDXS\" target=\"_blank\"\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/discord/964741354112577557?style=for-the-badge\u0026labelColor=black\u0026label=Join%20Server\u0026logo=Discord\"\u003e\n  \u003c/a\u003e\n\n  \u003c!-- Self-hosted tokei_rs instance, only works for repos in the SwiftcordApp org --\u003e\n  \u003cimg alt=\"\" src=\"http://vinkwok.mywire.org/tokei/github/SwiftcordApp/DiscordKit?style=for-the-badge\u0026branch=bot-support\u0026category=code\"\u003e\n\n  \u003ca aria-label=\"DiscordKit Guide\" href=\"https://swiftcord.gitbook.io/discordkit-guide/\" target=\"_blank\"\u003e\n    \u003cimg alt=\"\" src=\"https://img.shields.io/badge/guide-gitbook-important?style=for-the-badge\u0026labelColor=black\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003ePackage for interacting with Discord's API to build Swift bots\u003c/p\u003e\n\n\u003e DiscordKit for Bots is now released! Use DiscordKit to create that bot you've been\n\u003e looking to make, in the Swift that you know and love!\n\n## About\n\nDiscordKit is a Swift package for creating Discord bots in Swift.\n\n**If DiscordKit has helped you, please give it a ⭐ star and consider sponsoring! It\nkeeps me motivated to continue developing this and other projects.**\n\n## Installation\n\n### Swift Package Manager (SPM):\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ccode\u003ePackage.swift\u003c/code\u003e\u003c/summary\u003e\n\n  Add the following to your `Package.swift`:\n  ```swift\n  .package(url: \"https://github.com/SwiftcordApp/DiscordKit\", branch: \"main\")\n  ```\n\u003c/details\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eXcode Project\u003c/summary\u003e\n\n  Add a package dependancy in your Xcode project with the following parameters:\n\n  **Package URL:**\n  ```\n  https://github.com/SwiftcordApp/DiscordKit\n  ```\n\n  **Branch:**\n  ```\n  main\n  ```\n\n  **Product:**\n  - [x] DiscordKitBot\n\u003c/details\u003e\n\nFor more detailed instructions, refer to [this page](https://app.gitbook.com/o/bq2pyf3PEDPf2CURHt4z/s/WJuHiYLW9jKqPb7h8D7t/getting-started/installation)\nin the DiscordKit guide.\n\n## Example Usage\n\nCreate a simple bot with a **/ping** command:\n\n```swift\nimport DiscordKitBot\n\nlet bot = Client(intents: .unprivileged)\n\n// Guild to register commands in. If the COMMAND_GUILD_ID environment variable is set, commands are scoped\n// to that server and update instantly, useful for debugging. Otherwise, they are registered globally.\nlet commandGuildID = ProcessInfo.processInfo.environment[\"COMMAND_GUILD_ID\"]\n\nbot.ready.listen {\n    print(\"Logged in as \\(bot.user!.username)#\\(bot.user!.discriminator)!\")\n\n    try? await bot.registerApplicationCommands(guild: commandGuildID) {\n        NewAppCommand(\"ping\", description: \"Ping me!\") { interaction in\n            try? await interaction.reply(\"Pong!\")\n        }\n    }\n}\n\nbot.login() // Reads the bot token from the DISCORD_TOKEN environment variable and logs in with the token\n\n// Run the main RunLoop to prevent the program from exiting\nRunLoop.main.run()\n```\n_(Yes, that's really the whole code, no messing with registering commands with the REST\nAPI or anything!)_\n\nNot sure what to do next? Check out the guide below, which walks you through\nall the steps to create your own Discord bot!\n\n## Resources\n\nHere are some (WIP) resources that might be useful while developing with DiscordKit.\n\n* [DiscordKit Guide](https://swiftcord.gitbook.io/discordkit-guide/)\n* [Developer Documentation](https://swiftcordapp.github.io/DiscordKit/documentation/discordkitbot/) (Built with DocC)\n\n## Platform Support\n\nCurrently, DiscordKit only offically supports macOS versions 11 and up. Theoretically, you should be able to compile and use DiscordKit on any Apple platform with equivalent APIs, however this has not been tested and is considered an unsupported setup.\n\nDiscordKitBot and DiscordKitCore is supported on Linux, but not DiscordKit itself. However, you are able to develop and host bots made with DiscordKit on Linux. \n\nWindows is not supported natively at the moment. The recommended method is to use Windows Subsystem for Linux to do any development/hosting of DiscordKit bots on Windows. Native support may come in the future.\n","funding_links":["https://github.com/sponsors/cryptoAlgorithm","https://patreon.com/cryptoAlgo"],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSwiftcordApp%2FDiscordKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSwiftcordApp%2FDiscordKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSwiftcordApp%2FDiscordKit/lists"}