{"id":15283929,"url":"https://github.com/hedarikun/donjs","last_synced_at":"2025-08-08T17:07:19.856Z","repository":{"id":57215132,"uuid":"151831609","full_name":"HedariKun/DonJS","owner":"HedariKun","description":"a library to create mastodon's bots in js","archived":false,"fork":false,"pushed_at":"2019-01-29T14:00:00.000Z","size":101,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-12T09:17:15.224Z","etag":null,"topics":["bot","js","library","mastodon"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/HedariKun.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}},"created_at":"2018-10-06T11:05:04.000Z","updated_at":"2024-05-31T01:17:22.000Z","dependencies_parsed_at":"2022-08-24T22:31:18.041Z","dependency_job_id":null,"html_url":"https://github.com/HedariKun/DonJS","commit_stats":null,"previous_names":["hedarikun/tootjs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HedariKun%2FDonJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HedariKun%2FDonJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HedariKun%2FDonJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HedariKun%2FDonJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HedariKun","download_url":"https://codeload.github.com/HedariKun/DonJS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643880,"owners_count":21138521,"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","js","library","mastodon"],"created_at":"2024-09-30T14:48:16.791Z","updated_at":"2025-04-12T23:20:22.914Z","avatar_url":"https://github.com/HedariKun.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DonJS ![CodeFactor](https://www.codefactor.io/repository/github/hedarikun/donjs/badge) [![npm version](https://badge.fury.io/js/donjs.svg)](https://badge.fury.io/js/donjs)\nDonJS is a javascript library to create Mastodon bots\n\n# How to start\n1. to start using DonJS you need to create a new folder for your bot\n2. then you need to run terminal or CMD in that directory \n3. then run ```npm init -y``` command. \n4. after that you need to install the library by running ```npm install donjs```\n\nto visit the documentation [click here](https://www.github.com/hedarikun/donjs/wiki)\n\n# Examples\nOne of the basic examples on how to use this library is\n```js\nconst donjs = require(\"donjs\");\nconst client = new donjs(\"your bot token\", \"your mastodon instance base url\");\n\nclient.sendStatus(\"hello world\");\n```\nThis example is to show, how to send hello world status using donjs. \nyou can get the token from\nSettings -\u003e Development -\u003e create a new application then choose whatever name you want then press Submit -\u003e copy the applications access token.\n\nanother example that explains how you can listen for the public statuses that people create or delete\n```js\nconst donjs = require(\"donjs\");\nconst client = new donjs(\"your bot token\", \"your mastodon instance base url\");\n\nclient.listenForStatuses();\nclient.on(\"onStatus\", status =\u003e {\n\tconsole.log(\"status created!\");\n});\n\nclient.on(\"onStatusDelete\", id =\u003e {\n\tconsole.log(\"status deleted!\");\n});\n```\n\nyou can also listen for notifications.\n```js\nconst donjs = require(\"donjs\");\nconst client = new donjs(\"your bot token\", \"your mastodon instance base url\");\n\nclient.listenForNotifications();\nclient.on(\"onNotification\", notification =\u003e {\n        console.log(\"there is a new notification!\");\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhedarikun%2Fdonjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhedarikun%2Fdonjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhedarikun%2Fdonjs/lists"}