├── .github ├── actions │ └── tgcf-past │ │ ├── Dockerfile │ │ └── action.yml └── workflows │ └── tgcf-past.yml ├── LICENSE ├── README.md └── tgcf.config.yml /.github/actions/tgcf-past/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM aahnik/tgcf 2 | 3 | CMD tgcf --loud 4 | -------------------------------------------------------------------------------- /.github/actions/tgcf-past/action.yml: -------------------------------------------------------------------------------- 1 | name: tgcf past 2 | 3 | description: Forward Telegram messages from source to destination using tgcf periodically. 4 | 5 | runs: 6 | using: docker 7 | image: Dockerfile 8 | env: 9 | TGCF_MODE: past 10 | -------------------------------------------------------------------------------- /.github/workflows/tgcf-past.yml: -------------------------------------------------------------------------------- 1 | name: tgcf-past 2 | 3 | on: 4 | workflow_dispatch: # run when triggered manually 5 | # schedule: 6 | # - cron: 0 0 1 * * 7 | # run on the first day of every month 8 | # change the cron expression in the above line to change the schedule 9 | # for cron syntax see https://crontab.guru/ 10 | 11 | 12 | jobs: 13 | tgcf: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v2 17 | with: 18 | fetch-depth: 0 19 | 20 | - uses: ./.github/actions/tgcf-past 21 | env: 22 | API_ID: ${{ secrets.API_ID }} 23 | API_HASH: ${{ secrets.API_HASH }} 24 | SESSION_STRING: ${{ secrets.SESSION_STRING }} 25 | 26 | - name: Commit & Push changes 27 | uses: actions-js/push@master 28 | with: 29 | github_token: ${{ secrets.GITHUB_TOKEN }} 30 | branch: main 31 | message: push files changed 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Aahnik Daw 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tgcf-on-gh-action 2 | 3 | 4 | 5 | Warning: this is no longer supported with the latest version of tgcf 6 | --- 7 | 8 | Running [tgcf](https://github.com/aahnik/tgcf) periodically in past mode for free using GitHub Actions. 9 | 10 | - Link to tgcf repository: [aahnik/tgcf](https://github.com/aahnik/tgcf) 11 | - How to use this: 12 | - Article: [wiki/Run-tgcf-in-past-mode-periodically](https://github.com/aahnik/tgcf/wiki/Run-tgcf-in-past-mode-periodically) 13 | - Video: Coming soon! 14 | 15 | 16 | - To change the forwarding configuration edit [tgcf.config.yml](/tgcf.config.yml) 17 | - To change the schedule edit [workflow file](.github/workflows/tgcf-past.yml) 18 | -------------------------------------------------------------------------------- /tgcf.config.yml: -------------------------------------------------------------------------------- 1 | # this is sample configuration file 2 | # change this to suit your needs 3 | # link to tgcf original repo https://github.com/aahnik/tgcf 4 | # learn how to configure tgcf https://git.io/J3NuZ 5 | # learn how to run on github actions https://git.io/J3NuY 6 | # this is a yaml file, learn about yaml syntax here https://git.io/J3NuL 7 | # MIT LICENSE 8 | # AAHNIK 2021 9 | 10 | ######################################## 11 | 12 | forwards: 13 | # this section defines all the sources and destinations 14 | - source: tg_cf # username/link/chatid of the source 15 | dest: [me] # list of chat ids of the destinations 16 | # me means, the messages will be saved in your Saved Messages in telegram 17 | offset: 0 # from where to start (0 means from the first message of source) 18 | # offset will automatically be updated when the program runs 19 | # - source: -1001 20 | # dest: [] 21 | # offset: 0 22 | # add more sources if you wish 23 | 24 | past: 25 | delay: 3 # wait for 3s after forwarding each message 26 | 27 | plugins: 28 | # specify the plugins you want to use 29 | filter: 30 | text: 31 | blacklist: ["badword"] 32 | 33 | # read full documentation of plugins here https://git.io/J3NuC 34 | 35 | ########################## 36 | 37 | # make sure you understand the configuration before you run 38 | # edit this file to suit your needs 39 | # read more here https://github.com/aahnik/tgcf --------------------------------------------------------------------------------