{"id":15687303,"url":"https://github.com/timolins/coinbot","last_synced_at":"2025-06-21T23:04:25.491Z","repository":{"id":66106483,"uuid":"71368808","full_name":"timolins/coinbot","owner":"timolins","description":"A decision maker for Telegram","archived":false,"fork":false,"pushed_at":"2024-12-14T18:05:54.000Z","size":193,"stargazers_count":10,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-19T07:17:39.579Z","etag":null,"topics":["random-decisions","telegram"],"latest_commit_sha":null,"homepage":"https://coinbot.timo.sh","language":"JavaScript","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/timolins.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,"zenodo":null}},"created_at":"2016-10-19T14:59:28.000Z","updated_at":"2025-06-12T02:37:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"1281d0dd-8f32-46a4-88a9-58d8c054afcd","html_url":"https://github.com/timolins/coinbot","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/timolins/coinbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timolins%2Fcoinbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timolins%2Fcoinbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timolins%2Fcoinbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timolins%2Fcoinbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timolins","download_url":"https://codeload.github.com/timolins/coinbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timolins%2Fcoinbot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261206110,"owners_count":23124837,"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":["random-decisions","telegram"],"created_at":"2024-10-03T17:46:52.848Z","updated_at":"2025-06-21T23:04:20.477Z","avatar_url":"https://github.com/timolins.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](static/header.png)](https://telegram.me/coinbot)\n\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n\n[CoinBot](https://telegram.me/coinbot) is a tiny bot for Telegram, that helps you with random decisions. It works inline and inside the chat.\n\n## Usage\n\n\n| Name | Command | Parameter |\n| --- | --- | --- |\n| Flip a coin | `/coin` | - |\n| Roll a dice | `/dice` | _[Sides of the dice]_ |\n| Choose from list | `/list` | Item1, Item2, ... |\n\n#### Examples\n\n`/coin` ⇒ **Tails**\n\n`/dice` ⇒ **5**\n\n`/dice 26` ⇒ **24**\n\n`/list Pizza, Sushi, Burger` ⇒ **Sushi**\n\n_Inline:_\n\n`@coinbot npm, yarn`  ⇒ **yarn**\n\n\n## Development\n\nCoinBot was built with extensibility in mind. That's why it's based on the following principles and technologies:\n\n* Based on [Telegraf](https://github.com/telegraf/telegraf) – A **modern** framework for Telegram bots.\n* Commands are **modular** – They are split into individual files and work inside the chat \u0026 inline on the fly.\n* [Website](https://coinbot.timo.sh) **updates automatically** – It's built with [Next.js](https://github.com/zeit/next.js) and reads the same files the bot is using. If you add command to the bot, it will also be on the website.\n\n#### Run it locally\n\nAfter you cloned the repository to your computer, you can **run it** with `npm run dev`\\*.\n\nThis command will start the bot itself AND the website on port 3000. It's also possible to start only one of them with either `npm run dev:bot` or `npm run dev:web`.\n\n_\\* You have to set the environment variable `TOKEN` to your Telgram Bot Token in order for it to work. You can obtain it from the [BotFather](https://telegram.me/BotFather)._\n\n#### Run it in production\n\nSame rules apply as above, but for a production environment I suggest to use `npm run build` and `npm start`. `:bot` and `:web` can also be applied on those two commands.\n\n\n### Writing a new command\n\nTo get started, I would suggest to take a look at the files in the `commands/` directory. Every command is described with a `function` that returns an `Object`.\n\n\n#### Example\n\n```js\nexport default query =\u003e ({\n  title: 'Demo',\n  trigger: 'demo',\n  enabled: true,\n  message: `This is a demo. Given query: ${query}`,\n  description: `Random item`,\n  parameter: 'Example',\n  thumb: 'list.png'\n})\n```\n\n#### Options\n\n| Key | Type | Required | Description |\n| --- | --- | --- | --- |\n| `title` | `String` | YES | Title/Name of the command. |\n| `trigger` | `String` | YES | The actual command to trigger it. (Without the `/`) |\n| `enabled` | `Boolean` | YES | If `false` the command will be hidden from inline mode and return an error in chat mode. This is useful if your command only works with a certain `query`. |\n| `message` | `String` | YES | The result of the command. This will be returned when it runs. |\n| `description` | `String` | YES | Description for the website, `/start` and inline mode. |\n| `parameter` | `String` | - | Example parameter. Should be in brackets if it's optional. Will be displayed if `enabled` is set to false |\n| `thumb` | `String` | - | Thumbnail for inline mode and website. Image should be placed inside `static/thumbs/` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimolins%2Fcoinbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimolins%2Fcoinbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimolins%2Fcoinbot/lists"}