{"id":15653862,"url":"https://github.com/galeone/raf","last_synced_at":"2025-08-27T17:21:53.011Z","repository":{"id":46010465,"uuid":"393382813","full_name":"galeone/raf","owner":"galeone","description":"RaF is a bot for creating referral-based contests for your Telegram channels, groups, and supergroups.","archived":false,"fork":false,"pushed_at":"2025-03-22T13:42:37.000Z","size":252,"stargazers_count":28,"open_issues_count":1,"forks_count":20,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-19T18:08:44.289Z","etag":null,"topics":["rust","telegram-bot"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/galeone.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,"zenodo":null}},"created_at":"2021-08-06T13:18:16.000Z","updated_at":"2025-03-22T13:41:36.000Z","dependencies_parsed_at":"2024-10-23T03:43:02.879Z","dependency_job_id":"cc5368ad-dfce-4806-b205-4ee338a71d87","html_url":"https://github.com/galeone/raf","commit_stats":{"total_commits":38,"total_committers":1,"mean_commits":38.0,"dds":0.0,"last_synced_commit":"5103fcbace279f9b8a64fe2cc8a5433a555e5f7b"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/galeone/raf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galeone%2Fraf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galeone%2Fraf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galeone%2Fraf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galeone%2Fraf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/galeone","download_url":"https://codeload.github.com/galeone/raf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galeone%2Fraf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272356595,"owners_count":24920344,"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","status":"online","status_checked_at":"2025-08-27T02:00:09.397Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["rust","telegram-bot"],"created_at":"2024-10-03T12:47:29.457Z","updated_at":"2025-08-27T17:21:52.964Z","avatar_url":"https://github.com/galeone.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram RaF \\[Refer a Friend\\]([@RefafBot](https://t.me/RefafBot))\n\nRaF is a bot for creating referral-based contests for your Telegram channels, groups and supergroups.\n\nCreate contests, let your users share their link to your channel/group, increase your audience, and give prizes to the winners!\n\n---\n\n## Introduction\n\nThe software is written in [rust](https://github.com/rust-lang/rust). Raf depends on [a fork of telexide](https://github.com/galeone/telexide), a rust library for making telegram bots. The fork makes the original library work and solves some issues.\n\nThe storage used is SQLite: RaF creates a `raf.db` file in its run path where it saves all the relationships between:\n\n- Who owns the channels\n- The contests created\n- The invitations each participant generated\n- The users who joined the channel through an invitation\n\n## Setup\n\n1. Install RaF\n\nFor the development version:\n\n```bash\ncargo install --path .\n```\n\n\u003c!-- The stable version is not (yet) ready, especially because we depend on the fork that isn't published on crates.io but it's only a git repository. --\u003e\n\nFor the production version:\n\n```bash\ncargo install telegram-raf\n```\n\n2. Create the run path and the environment file\n\n```bash\nmkdir $HOME/.raf\n\necho 'BOT_NAME=\"\u003cyour bot name\u003e\"' \u003e $HOME/.raf/raf.env\necho 'TOKEN=\"\u003cyour bot token\u003e\"' \u003e\u003e $HOME/.raf/raf.env\n```\n\n3. Copy the systemd service file\n\n```bash\nsudo cp misc/systemd/raf@.service /lib/systemd/system/\n```\n\n4. Start and enable the service\n\n```bash\nsudo systemctl start raf@$USER.service\nsudo systemctl enable raf@$USER.service\n```\n\nThe `raf.db` (to backup or inspect) is in `$HOME/.raf/`.\n\n### Broadcast Feature\n\nThe bot supports a broadcast feature that allows the bot owner to send messages to all users and channels. To use this feature:\n\n1. Create a `broadcast.md` file in the bot's run directory (`$HOME/.raf/`) with the message you want to broadcast. The message supports Markdown formatting.\n\n2. If the bot is currently running, stop it. It requires a separate instance. Now start the bot with the `--broadcast` flag:\n```bash\nraf --broadcast\n```\n\n3. Once the bot is running, use the `/broadcast` command to send the message from `broadcast.md` to all users and channels.\n4. You can restart the bot to make it work as usual.\n\nThe `broadcast.md` file should be formatted using Markdown V2 syntax, as the bot will send the message with `ParseMode::MarkdownV2`.\n\n## Contributing\n\nAny feedback is welcome. Feel free to open issues and create pull requests!\n\n\n## License\n\n```\nCopyright 2021 Paolo Galeone \u003cnessuno@nerdz.eu\u003e\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaleone%2Fraf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaleone%2Fraf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaleone%2Fraf/lists"}