{"id":15382408,"url":"https://github.com/h0rn0chse/onedrivegitbot","last_synced_at":"2025-07-08T11:36:04.518Z","repository":{"id":105063552,"uuid":"356353303","full_name":"H0rn0chse/OneDriveGitBot","owner":"H0rn0chse","description":"A discord bot, which syncs a OneDrive folder into a git repository.","archived":false,"fork":false,"pushed_at":"2021-05-22T10:06:28.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T00:49:15.386Z","etag":null,"topics":["bot","discord-js","game-development","gamedev","git","onedrive","sync"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/H0rn0chse.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-09T17:41:18.000Z","updated_at":"2021-05-22T10:06:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"4f24ffe4-a300-4d1e-921f-d83e65153155","html_url":"https://github.com/H0rn0chse/OneDriveGitBot","commit_stats":{"total_commits":26,"total_committers":2,"mean_commits":13.0,"dds":"0.038461538461538436","last_synced_commit":"1f36ddb4e0d5dcc98300b65a2f9414907b040eb9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/H0rn0chse%2FOneDriveGitBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/H0rn0chse%2FOneDriveGitBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/H0rn0chse%2FOneDriveGitBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/H0rn0chse%2FOneDriveGitBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/H0rn0chse","download_url":"https://codeload.github.com/H0rn0chse/OneDriveGitBot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245937896,"owners_count":20696985,"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-js","game-development","gamedev","git","onedrive","sync"],"created_at":"2024-10-01T14:31:54.483Z","updated_at":"2025-03-27T22:41:52.180Z","avatar_url":"https://github.com/H0rn0chse.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OneDriveGitBot\n\n * [Commands](#commands)\n * [Bot Setup](#bot-setup)\n * [Libraries](#libraries)\n\nThis discord bot syncs a OneDrive folder with a git repository. This is useful for projects with users, which don't have a technical background and have issues with using git. The bot is limited to a one directional sync. This limits the use cases: e.g game dev projects, where each artists works on its own artworks and no sync from git to OneDrive is required.\n\n## Commands\nThe commands need to start with !gj. Due to concurrency issues only one command can run at once.\n\n### addAlert (DM only)\nAdds you to the alert notification list. As soon an error is triggered all channels in the list are notified.\n\n### addDebug (channel only)\nAdds the channel to the debug notification list. As soon any debug output (log, warning, error) is triggered all channels in the list are notified.\n\n### checkToken (DM only)\nUses the microsoft token by fetching the (toplevel) folders and files of the OneDrive folder.\n\n### removeAlert (DM only)\nRemoves you from the alert notification list. [see addAlert](#addalert-dm-only)\n\n### removeDebug (channel only)\nRemoves you from the debug notification list. [see addDebug](#adddebug-channel-only)\n\n### setToken \u003crefresh_token\u003e (DM only)\nSets and refreshes the microsoft token with a refresh_token.\n\n### sync (channel only)\nFetches the current stat of the OneDrive folder and pushes new files into the git repository.\n\n## Bot Setup\n\nThe bot is configured via the [config](/config.js) and the local .env. You can find here an example of the required names: [.env.example](/.env.example).\n\n### Discord\nThe [discord.js guide](https://www.discordjs.guide) contains a very good documentation on [how to create a bot](https://discordjs.guide/preparations/setting-up-a-bot-application.html) and [how to add one to a server](https://discordjs.guide/preparations/adding-your-bot-to-servers.html). It also explains [where to get your token](https://discordjs.guide/preparations/setting-up-a-bot-application.html#your-token) and how to handle it properly.\n\n### Microsoft\nFollow the [documentation](https://docs.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/msa-oauth?view=odsp-graph-online) and create your application. You can create a secret/apptoken in the \"Certificates \u0026 secrets\" tab. You can easily fetch your OneDrive folderId from the url parameters when viewing it in the browser. The driveId is typically the part before the `!` or `%21` in the folderId. You can check your íds via the [graph explorer](https://developer.microsoft.com/en-us/graph/graph-explorer) and the GET request `https://graph.microsoft.com/v1.0/drives/\u003cDRIVE_ID\u003e/items/\u003cFOLDER_ID\u003e`.\n\n### Git\nPlease ensure you use [ssh on your system](https://docs.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account). You might need to change some parts in case you want to use http/ OAuth instead.\n\n## Libraries\n * discord.js: [github.com/discordjs/discord.js](https://github.com/discordjs/discord.js)\n * Simpel Git: [github.com/steveukx/git-js](https://github.com/steveukx/git-js)\n * Simple OAuth2: [github.com/lelylan/simple-oauth2](https://github.com/lelylan/simple-oauth2)\n * onedrive-api: [github.com/dkatavic/onedrive-api](https://github.com/dkatavic/onedrive-api)\n * express: [github.com/expressjs/express](https://github.com/expressjs/express)\n * dotenv: [github.com/motdotla/dotenv](https://github.com/motdotla/dotenv)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh0rn0chse%2Fonedrivegitbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh0rn0chse%2Fonedrivegitbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh0rn0chse%2Fonedrivegitbot/lists"}