├── .docker ├── Dockerfile ├── conf.d │ └── site.conf ├── config │ └── php │ │ └── php.ini └── log │ └── nginx │ └── .gitkeep ├── .editorconfig ├── .env.example ├── .github ├── FUNDING.yml └── workflows │ ├── php-cs-fixer.yml │ ├── phpstan.yml │ ├── setup_test.yml │ └── update-changelog.yml ├── .gitignore ├── .php-cs-fixer.dist.php ├── .scrutinizer.yml ├── .styleci.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── UPGRADING.md ├── composer.json ├── docker-compose.yml ├── docker.sh ├── index.php ├── init.php ├── phpstan.neon.dist ├── resources ├── images │ └── start.png └── views │ ├── events │ ├── github │ │ ├── issue_comment │ │ │ ├── created.php │ │ │ ├── deleted.php │ │ │ └── edited.php │ │ ├── issues │ │ │ ├── closed.php │ │ │ ├── deleted.php │ │ │ ├── edited.php │ │ │ ├── locked.php │ │ │ ├── opened.php │ │ │ ├── pinned.php │ │ │ ├── reopened.php │ │ │ ├── unlocked.php │ │ │ └── unpinned.php │ │ ├── ping │ │ │ └── default.php │ │ ├── pull_request │ │ │ ├── closed.php │ │ │ ├── opened.php │ │ │ ├── partials │ │ │ │ └── _reviewers.php │ │ │ └── reopened.php │ │ ├── pull_request_review │ │ │ ├── dismissed.php │ │ │ └── submitted.php │ │ ├── push │ │ │ └── default.php │ │ ├── watch │ │ │ └── started.php │ │ ├── workflow_job │ │ │ ├── completed.php │ │ │ ├── in_progress.php │ │ │ └── queued.php │ │ └── workflow_run │ │ │ ├── completed.php │ │ │ └── requested.php │ ├── gitlab │ │ ├── feature_flag │ │ │ └── default.php │ │ ├── issue │ │ │ ├── close.php │ │ │ ├── open.php │ │ │ ├── reopen.php │ │ │ └── update.php │ │ ├── merge_request │ │ │ ├── approved.php │ │ │ ├── close.php │ │ │ ├── merge.php │ │ │ ├── open.php │ │ │ ├── partials │ │ │ │ └── _reviewers.php │ │ │ ├── reopen.php │ │ │ ├── unapproval.php │ │ │ ├── unapproved.php │ │ │ └── update.php │ │ ├── note │ │ │ ├── commit.php │ │ │ ├── issue.php │ │ │ ├── merge_request.php │ │ │ └── snippet.php │ │ ├── push │ │ │ └── default.php │ │ ├── release │ │ │ ├── create.php │ │ │ └── update.php │ │ ├── tag_push │ │ │ └── default.php │ │ └── wiki_page │ │ │ ├── create.php │ │ │ ├── delete.php │ │ │ └── update.php │ └── shared │ │ └── partials │ │ ├── github │ │ ├── _assignees.php │ │ └── _body.php │ │ └── gitlab │ │ ├── _assignees.php │ │ └── _body.php │ ├── globals │ └── access_denied.php │ └── tools │ ├── about.php │ ├── custom_event.php │ ├── custom_event_action.php │ ├── id.php │ ├── menu.php │ ├── server.php │ ├── set_menu_cmd.php │ ├── settings.php │ ├── start.php │ ├── token.php │ └── usage.php ├── src ├── Http │ └── Actions │ │ ├── IndexAction.php │ │ └── WebhookAction.php ├── Services │ ├── CallbackService.php │ ├── CommandService.php │ └── NotificationService.php └── Traits │ └── Markup.php └── webhook ├── delete.php ├── getUpdate.php └── set.php /.docker/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION_SELECTED=8.2 2 | 3 | FROM php:${PHP_VERSION_SELECTED}-fpm 4 | 5 | RUN apt-get update && apt-get install -y --no-install-recommends \ 6 | git \ 7 | nano \ 8 | libpng-dev \ 9 | libonig-dev \ 10 | libzip-dev \ 11 | && rm -r /var/lib/apt/lists/* \ 12 | && docker-php-ext-install -j$(nproc) \ 13 | zip \ 14 | pcntl 15 | 16 | RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer 17 | COPY --from=composer/composer /usr/bin/composer /usr/local/bin/composer 18 | 19 | WORKDIR /var/www/html 20 | 21 | EXPOSE 80 22 | 23 | CMD ["php-fpm"] 24 | -------------------------------------------------------------------------------- /.docker/conf.d/site.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name telegram-git-notifier.com; 4 | 5 | error_log /var/log/nginx/telegram-git-notifier-error.log; 6 | access_log /var/log/nginx/telegram-git-notifier-access.log; 7 | 8 | root /var/www/html/; 9 | index index.php index.html index.htm; 10 | 11 | location / { 12 | try_files $uri $uri/ /index.php?$query_string; 13 | gzip_static on; 14 | } 15 | 16 | client_body_timeout 180s; 17 | client_max_body_size 16M; 18 | 19 | location ~ \.php$ { 20 | try_files $uri =404; 21 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 22 | fastcgi_pass server:9000; 23 | fastcgi_index index.php; 24 | include fastcgi_params; 25 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 26 | fastcgi_param PATH_INFO $fastcgi_path_info; 27 | 28 | fastcgi_temp_file_write_size 10m; 29 | fastcgi_intercept_errors off; 30 | fastcgi_buffer_size 16k; 31 | fastcgi_buffers 16 512k; 32 | fastcgi_connect_timeout 300; 33 | fastcgi_send_timeout 300; 34 | fastcgi_read_timeout 300; 35 | } 36 | 37 | location ~ /\.ht { 38 | deny all; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /.docker/config/php/php.ini: -------------------------------------------------------------------------------- 1 | upload_max_filesize = 8M 2 | post_max_size = 8M 3 | max_file_uploads = 10 4 | 5 | short_open_tag = Off 6 | buffer-size = 65535 7 | output_buffering = 65535 8 | log_errors = On 9 | error_log = /dev/stderr 10 | 11 | max_execution_time = 21600 12 | max_input_time = 21600 13 | max_input_vars = 10000 14 | memory_limit = -1 15 | zend.assertions = -1 16 | error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT 17 | -------------------------------------------------------------------------------- /.docker/log/nginx/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cslant/telegram-git-notifier-app/5bff9fce17d809589e76e886f072fd9823f1b744/.docker/log/nginx/.gitkeep -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | ; This is the top-most EditorConfig file, which is not inherited by any other files. 2 | ; This file is used for unify the coding style for different editors and IDEs. 3 | ; More information at https://editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | charset = utf-8 9 | end_of_line = lf 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.yml] 15 | indent_style = space 16 | 17 | [*.php] 18 | ij_php_concat_spaces = true 19 | ij_php_phpdoc_param_spaces_between_name_and_description = 1 20 | ij_php_phpdoc_param_spaces_between_tag_and_type = 1 21 | ij_php_phpdoc_param_spaces_between_type_and_name = 1 22 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | TGN_APP_NAME='Telegram Git Notify' 2 | 3 | # Set your app url here (Required for the bot to work properly) 4 | TGN_APP_URL=https://152.132.127.172:3000 5 | 6 | TELEGRAM_BOT_TOKEN="###########:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 7 | TELEGRAM_BOT_CHAT_ID="##########" 8 | 9 | # Set the chat ids that will receive notifications here. 10 | # You can add the owner bot id, group id, ... 11 | # ------------------------------------------------------- 12 | # Note: 13 | # Please use semicolon ";" to separate chat ids 14 | # And use colon ":" to separate chat id and thread id 15 | # And use comma "," if you want to add multiple thread ids 16 | # ------------------------------------------------------- 17 | # The environment variable is expected to be in the format: 18 | # "chat_id1;chat_id2:thread_id2;chat_id3:thread_id3_1,thread_id3_2;..." 19 | TELEGRAM_NOTIFY_CHAT_IDS="-###########1;-############2:######2;-############3:######1,######2" 20 | 21 | # Docker 22 | PHP_VERSION_SELECTED=8.2 23 | CONTAINER_NAME=telegram-git-notifier 24 | APP_PORT=3000 25 | 26 | 27 | # ----------------------------------------------------- 28 | # --------------------- Optional ---------------------- 29 | # Please change or comment if you want to use default. 30 | # Note: Don't set blank value 31 | # ----------------------------------------------------- 32 | 33 | #TGN_PATH_SETTING= 34 | #TGN_PATH_PLATFORM_GITLAB= 35 | #TGN_PATH_PLATFORM_GITHUB= 36 | 37 | #TGN_VIEW_PATH= 38 | #TGN_VIEW_EVENT_DEFAULT= 39 | 40 | #TGN_VIEW_GLOBALS_ACCESS_DENIED= 41 | 42 | #TGN_VIEW_TOOL_SETTING= 43 | #TGN_VIEW_TOOL_CUSTOM_EVENT_ACTION= 44 | #TGN_VIEW_TOOL_CUSTOM_EVENT= 45 | #TGN_VIEW_TOOL_SET_MENU_COMMAND= 46 | 47 | TIMEZONE=Asia/Ho_Chi_Minh 48 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [tanhongit] 4 | -------------------------------------------------------------------------------- /.github/workflows/php-cs-fixer.yml: -------------------------------------------------------------------------------- 1 | name: Check & fix styling 2 | 3 | on: [push] 4 | 5 | permissions: 6 | contents: write 7 | 8 | jobs: 9 | php-cs-fixer: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v4 15 | with: 16 | ref: ${{ github.head_ref }} 17 | 18 | - name: Run PHP CS Fixer 19 | uses: docker://oskarstark/php-cs-fixer-ga 20 | with: 21 | args: --config=.php-cs-fixer.dist.php --allow-risky=yes 22 | 23 | - name: Commit changes 24 | uses: stefanzweifel/git-auto-commit-action@v5 25 | with: 26 | commit_message: Fix styling 27 | -------------------------------------------------------------------------------- /.github/workflows/phpstan.yml: -------------------------------------------------------------------------------- 1 | name: PHPStan 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | phpstan: 7 | runs-on: ubuntu-latest 8 | name: PHPStan - P${{ matrix.php }} 9 | 10 | strategy: 11 | matrix: 12 | os: [ ubuntu-latest ] 13 | php: [ '8.1', '8.2', '8.3' ] 14 | 15 | steps: 16 | - uses: actions/checkout@v4 17 | 18 | - name: Setup PHP 19 | uses: shivammathur/setup-php@2.26.0 20 | with: 21 | php-version: ${{ matrix.php }} 22 | 23 | - name: Checkout code 24 | uses: actions/checkout@v4 25 | 26 | - name: Install dependencies 27 | run: | 28 | composer install --no-interaction --no-progress --no-suggest 29 | 30 | - name: Run PHPStan 31 | run: | 32 | composer analyse --error-format=github 33 | -------------------------------------------------------------------------------- /.github/workflows/setup_test.yml: -------------------------------------------------------------------------------- 1 | name: Setup & test 2 | 3 | on: [ push, pull_request ] 4 | 5 | jobs: 6 | tests: 7 | name: Composer P${{ matrix.php }} - ${{ matrix.os }} 8 | runs-on: ${{ matrix.os }} 9 | strategy: 10 | matrix: 11 | os: [ ubuntu-latest ] 12 | php: [ '8.1', '8.2', '8.3' ] 13 | steps: 14 | - name: Setup PHP 15 | uses: shivammathur/setup-php@v2 16 | with: 17 | php-version: ${{ matrix.php }} 18 | 19 | - name: Checkout code 20 | uses: actions/checkout@v4 21 | 22 | - name: Install dependencies 23 | run: | 24 | composer install --no-interaction --no-progress --no-suggest 25 | 26 | - name: Run tests 27 | run: | 28 | composer validate --strict 29 | -------------------------------------------------------------------------------- /.github/workflows/update-changelog.yml: -------------------------------------------------------------------------------- 1 | name: Update Changelog 2 | 3 | on: 4 | release: 5 | types: [released] 6 | 7 | permissions: 8 | contents: write 9 | 10 | jobs: 11 | update: 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Checkout code 16 | uses: actions/checkout@v4 17 | with: 18 | ref: main 19 | 20 | - name: Update Changelog 21 | uses: stefanzweifel/changelog-updater-action@v1 22 | with: 23 | latest-version: ${{ github.event.release.name }} 24 | release-notes: ${{ github.event.release.body }} 25 | 26 | - name: Commit updated CHANGELOG 27 | uses: stefanzweifel/git-auto-commit-action@v5 28 | with: 29 | branch: main 30 | commit_message: Update CHANGELOG for ${{ github.event.release.name }} 31 | file_pattern: CHANGELOG.md 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .idea 3 | 4 | vendor 5 | node_modules 6 | 7 | composer.lock 8 | .env 9 | storage 10 | 11 | .docker 12 | *.log 13 | logs 14 | 15 | build 16 | .php-cs-fixer.cache 17 | .phpunit.cache 18 | .phpunit.result.cache 19 | -------------------------------------------------------------------------------- /.php-cs-fixer.dist.php: -------------------------------------------------------------------------------- 1 | in([ 5 | __DIR__ . '/src', 6 | __DIR__ . '/webhook', 7 | ]) 8 | ->name('*.php') 9 | ->ignoreDotFiles(true) 10 | ->ignoreVCS(true); 11 | 12 | return (new PhpCsFixer\Config()) 13 | ->setRules([ 14 | '@PSR12' => true, 15 | 'array_syntax' => ['syntax' => 'short'], 16 | 'ordered_imports' => ['sort_algorithm' => 'alpha'], 17 | 'no_unused_imports' => true, 18 | 'trailing_comma_in_multiline' => true, 19 | 'phpdoc_scalar' => true, 20 | 'unary_operator_spaces' => true, 21 | 'binary_operator_spaces' => true, 22 | 'blank_line_before_statement' => [ 23 | 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], 24 | ], 25 | 'phpdoc_single_line_var_spacing' => true, 26 | 'phpdoc_var_without_name' => true, 27 | 'class_attributes_separation' => [ 28 | 'elements' => [ 29 | 'method' => 'one', 30 | ], 31 | ], 32 | 'method_argument_space' => [ 33 | 'on_multiline' => 'ensure_fully_multiline', 34 | 'keep_multiple_spaces_after_comma' => true, 35 | ], 36 | 'single_trait_insert_per_statement' => true, 37 | ]) 38 | ->setFinder($finder); 39 | -------------------------------------------------------------------------------- /.scrutinizer.yml: -------------------------------------------------------------------------------- 1 | build: 2 | nodes: 3 | analysis: 4 | project_setup: 5 | override: true 6 | tests: 7 | override: [ php-scrutinizer-run ] 8 | environment: 9 | php: 10 | version: 8.0 11 | 12 | checks: 13 | php: 14 | code_rating: true 15 | remove_extra_empty_lines: true 16 | remove_php_closing_tag: true 17 | remove_trailing_whitespace: true 18 | fix_use_statements: 19 | remove_unused: true 20 | preserve_multiple: false 21 | preserve_blanklines: true 22 | order_alphabetically: true 23 | fix_php_opening_tag: true 24 | fix_linefeed: true 25 | fix_line_ending: true 26 | fix_identation_4spaces: true 27 | fix_doc_comments: true 28 | 29 | tools: 30 | php_analyzer: true 31 | php_code_coverage: true 32 | php_code_sniffer: 33 | config: 34 | standard: PSR4 35 | filter: 36 | paths: [ 'src' ] 37 | php_loc: 38 | enabled: true 39 | excluded_dirs: [ vendor ] 40 | php_cpd: 41 | enabled: true 42 | excluded_dirs: [ vendor ] 43 | -------------------------------------------------------------------------------- /.styleci.yml: -------------------------------------------------------------------------------- 1 | preset: psr12 2 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | Here you can see the full list of changes between each Telegram Git Notifier PHP release. 4 | 5 | ## v1.3.1 - 2023-11-08 6 | 7 | ### 📝 Small Changed 8 | 9 | - Change paths and add exceptions for webhook actions. 10 | - Update the license. 11 | - Update some workflow for analytic and format code. 12 | 13 | View all at #104 14 | 15 | ## v1.3.0 - 2023-11-03 16 | 17 | ### ✨ New Release: Enhanced Features and Optimizations! 18 | 19 | We are thrilled to announce the latest release with several new features and improvements: 20 | 21 | - Codebase refactoring for cleaner, more intuitive structures. #103 22 | - Incorporated extensive testing for multiple PHP versions, ensuring increased robustness and optimal compatibility across different PHP editions. [106fffb](https://github.com/cslant/telegram-git-notifier-app/commit/106fffbbaf2055262c72bb4daaa32036c5b1466f) 23 | - Update namespaces recent branding changes #102, [UPGRADING.md](https://github.com/cslant/telegram-git-notifier-app/blob/v1.3.0/UPGRADING.md) 24 | 25 | ## v1.2.0 - 2023-10-21 26 | 27 | 🎉 Introducing the New Telegram Git Notifier App! 28 | 29 | Building upon our core's [v1.2.0 release](https://github.com/lbiltech/telegram-git-notifier/releases/tag/v1.2.0), the Telegram Git Notifier App offers an enhanced experience for receiving GitHub notifications directly on Telegram, making it more efficient and user-friendly than ever. 30 | 31 | 🔗 [Check out the details and download here](https://github.com/lbiltech/telegram-git-notifier-app) 32 | 33 | ### ✨ New Features 34 | 35 | - Sending notifications in topics (threads in supergroups). 36 | - Enhanced capability to send notifications across multiple topics simultaneously. 37 | - Sending notifications to multiple groups simultaneously. 38 | 39 | ### 🛠 Improvements and Updates: 40 | 41 | - Refactored the source code for better efficiency and readability. 42 | 43 | Thank you for your continued support. We hope you enjoy these new features and improvements! 44 | 45 | ## v1.1.0 - 2023-08-26 46 | 47 | ### Telegram Bot GitHub & GitLab Notify - Enhanced Integration 48 | 49 | We are thrilled to announce the latest release of the **Telegram Bot GitHub & GitLab Notify**, featuring significant enhancements and updates. 50 | 51 | This version not only integrates both *GitHub and GitLab* platforms but also introduces customizable notifications for both platforms, offering you a more flexible project management experience than ever before. 52 | 53 | ### 🚀 New Features 54 | 55 | #### GitHub and GitLab Integration notification 56 | 57 | You can now effortlessly manage both GitHub and GitLab simultaneously through our bot. 58 | 59 | The bot will automatically track and send notifications about important events from both platforms to you via Telegram. 60 | 61 | #### Customizable enabling events 62 | 63 | We have introduced the ability to **customize notifications for each event on GitHub and GitLab**. You can decide to receive notifications for specific event types such as push, pull request, commit, issue, and various other events. 64 | 65 | Customize notification settings by editing the configuration file. This allows you to focus on the most important events for your project. 66 | 67 | ## v1.0.5 - 2023-08-16 68 | 69 | ### New Feature - Set My Commands (Menu Button) 70 | 71 | We're excited to introduce a new feature in this release that enhances the interaction with our Telegram bot. Say hello to the "Set My Commands" feature, which allows you to create a custom menu with buttons right within your chat window! 72 | 73 | #### 📌 Set My Commands - Menu Button: 74 | 75 | With the new "Set My Commands" feature, you can now create a menu of commands that users can easily access within their chat conversation. This streamlines the interaction process and makes it more intuitive for users to interact with your bot. 76 | 77 | To set up your custom menu, simply use the /set_menu command, and a list of buttons will be displayed in your chat window. Users can click on these buttons to trigger specific actions or commands, making the bot experience more user-friendly and efficient. 78 | 79 | Happy bot building! 80 | 81 | ## v1.0.4 - 2023-08-15 82 | 83 | ### What's Changed 84 | 85 | #### Add Docker Installation Option 86 | 87 | We've added an installation option through Docker, making it easy for you to deploy our bot in any environment quickly and efficiently. Docker helps package the application along with the required environment, ensuring consistency and easy management. 88 | 89 | #### Code Refactoring and Optimization 90 | 91 | We've undertaken code restructuring and optimization to enhance performance and scalability. This results in smoother operation and easier maintenance of our bot, both now and in the future. 92 | 93 | #### Bug Fixes 94 | 95 | This new version improves your experience and ensures the bot operates more smoothly and reliably. 96 | 97 | Be sure to update your bot to the latest version to experience the fantastic enhancements we've brought. 98 | 99 | ## v1.0.3 - 2023-08-11 100 | 101 | ### New Feature: Custom Events for Notification 102 | 103 | We're excited to introduce a new feature that allows you to enable custom events for notifications. With this enhancement, you'll have the flexibility to choose specific events that trigger notifications, giving you more control over the information you receive. This feature is particularly useful if you want to focus on certain types of activities or events within your repositories. 104 | 105 | #### Key Highlights 106 | 107 | - **Granular Control:** You can now choose which events you want to be notified about. Whether it's pull requests, issues, comments, or other actions, you can tailor your notifications to match your workflow. 108 | 109 | - **Enhanced Productivity:** By enabling custom events, you can cut down on the noise and only receive notifications for activities that matter most to you. 110 | 111 | - **How to Use:** In your notification settings, you'll find a new option to customize individual events. Simply select the events you want to be notified about, and you're all set. 112 | 113 | 114 | We're excited to empower you with this new feature and provide you with even more ways to stay informed and engaged with your repositories. 115 | 116 | Feel free to explore this feature and let us know if you have any feedback or suggestions. Your input is invaluable as we continue to improve and refine our platform. 117 | 118 | Thank you for being a part of our community! 119 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 CSlant 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 | > [!WARNING] 2 | > ## ⚠️ This Project is Deprecated – Use the New Laravel Package 3 | > * This project is outdated as it is built on a pure PHP source code. 4 | > * Instead, we highly recommend using our latest **Laravel package**, which offers: 5 | > - **Better security** with built-in authentication and protection mechanisms. 6 | > - **More features** for modern web development. 7 | > - **Active maintenance** and community support. 8 | > * 👉 [Click here to explore the new **Laravel Telegram Git Notifier** package](https://github.com/cslant/laravel-telegram-git-notifier) 9 | 10 | --- 11 | 12 | # Welcome to Telegram Bot GitHub/GitLab Notify 👋 13 | 14 | This package provides the ability to integrate the Telegram messaging service and GitHub/GitLab. 15 | With this package, 16 | you can create a Telegram bot to receive notifications from GitHub or GitLab events 17 | and manage customization through messages and buttons on Telegram. 18 | 19 |

20 | GitHub and GitLab notifications to telegram php 21 |

22 | 23 | ![License](https://img.shields.io/github/license/cslant/telegram-git-notifier-app.svg?style=flat-square) 24 | [![Latest Version](https://img.shields.io/github/release/cslant/telegram-git-notifier-app.svg?style=flat-square)](https://github.com/cslant/telegram-git-notifier-app/releases) 25 | ![Test Status](https://img.shields.io/github/actions/workflow/status/cslant/telegram-git-notifier-app/setup_test.yml?label=tests&branch=main) 26 | ![Code Style Status](https://img.shields.io/github/actions/workflow/status/cslant/telegram-git-notifier-app/php-cs-fixer.yml?label=code%20style&branch=main) 27 | [![StyleCI](https://styleci.io/repos/656960426/shield)](https://styleci.io/repos/656960426) 28 | [![Quality Score](https://img.shields.io/scrutinizer/g/cslant/telegram-git-notifier-app.svg?style=flat-square)](https://scrutinizer-ci.com/g/cslant/telegram-git-notifier-app) 29 | [![Maintainability](https://api.codeclimate.com/v1/badges/7ccaccebe9cd58ff3df5/maintainability)](https://codeclimate.com/github/cslant/telegram-git-notifier-app/maintainability) 30 | 31 | ## 📝 Information 32 | 33 | - Send notifications of your GitHub/GitLab repositories to Telegram Bots, Groups, Super Groups (Multiple Topics), and Channels. 34 | - The bot must be created using the [BotFather](https://core.telegram.org/bots#6-botfather) 35 | 36 | ## 🎉 Features 37 | 38 | 1. **GitHub/GitLab Notifications to Telegram**: The package allows you to configure a Telegram bot to receive notifications from various GitHub/GitLab events, including events like **commits, pull requests, issues, releases, and many more**. 39 | 40 |

41 | GitHub/GitLab Notifications to Telegram 42 |

43 | 44 | 2. **Customize Notifications**: You can customize the types of notifications you want to receive through options on Telegram. 45 | 46 | [//]: # (features image) 47 | 48 | 3. **Interactive Buttons**: The package supports creating interactive buttons on Telegram to perform actions such as enabling or disabling notifications. 49 | 50 | [//]: # (features image) 51 | 52 | 4. **Event Management**: You can manage specific events that you want to receive notifications for, allowing you to focus on what's most important for your projects. 53 | 54 | - Support for multiple platforms: GitHub and GitLab. 55 | - Manage event notifications separately between platforms. 56 | 57 |

58 | Event Management to Telegram 59 |

60 | 61 | 5. **Easy Integration**: 62 | The package provides an API and user-friendly functions 63 | to create a Telegram bot and link it to your GitHub/GitLab account. 64 | 65 | [//]: # (features image) 66 | 67 | 6. **Support for multiple chats**: You can add multiple chat IDs to the `.env` file. 68 | These chat IDs will be the chat IDs of your groups, channels, or users. 69 | Also, you can add **the chat ID of this bot** to receive incoming notifications for itself. 70 | 71 | [//]: # (features image) 72 | 73 | 7. **For premium users, you can use the following features:** 74 | - **Support for multiple topics**: You can add multiple topics to the `.env` file. 75 | These topics will be the topics of your supergroups. 76 | 77 | [//]: # (features image) 78 | 79 | ## 📋 Requirements 80 | 81 | - PHP ^8.1 82 | - [Composer](https://getcomposer.org/) 83 | - Core: [Telegram Git Notifier](https://github.com/cslant/telegram-git-notifier) 84 | 85 | ## 🔧 Installation 86 | 87 | As for the installation and configuration, 88 | this project provides two different installation ways depending on your preference or suitability for your system. 89 | 90 | > **Way 1:** Install by composer directly on the system (Requires the system to install composer, previous PHP version) 91 | > 92 | > **Way 2:** Install by Docker (Requires the system to install Docker, Docker Compose) 93 | 94 | ### I. Installation and configuration 🛠 95 | 96 | Please choose only one of the following two ways to set up the project. 97 | 98 |
99 | 100 | Way 1: Install by composer directly on the system ⚙ 101 |
102 | 103 | First, please clone and install this project via [Composer](https://getcomposer.org/): 104 | 105 | ```bash 106 | composer create-project cslant/telegram-git-notifier-app 107 | ``` 108 | 109 | After running the command above, you will have the project installed under the `telegram-git-notifier-app` directory, 110 | and the environment file `.env` will be created automatically. 111 | 112 | Some of the JSON files will be created automatically in the `storage` directory. 113 | These files are used to store the data and serve for features in this bot. 114 | 115 | #### 1. Create a New Bot 116 | 117 | To create a new bot, you need to talk to [BotFather](https://core.telegram.org/bots#6-botfather) and follow a few simple steps. 118 | 119 | 1. Open a chat with [BotFather](https://telegram.me/botfather) and send `/newbot` command. 120 | 2. Enter a friendly name for your bot. This name will be displayed in contact details and elsewhere. 121 | 3. Enter a unique username for your bot. It must end in `bot`. Like this, for example: `TetrisBot` or `tetris_bot`. 122 | 4. Copy the HTTP API access token provided by [BotFather](https://telegram.me/botfather) and paste it into your `.env` file. 123 | 124 | ```dotenv 125 | TELEGRAM_BOT_TOKEN=123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ 126 | ``` 127 | 128 | #### 2. Set up your domain and SSL certificate 129 | 130 | **We recommend that you use HTTPS to set up your domain and webhook.** 131 | You can build your own server or use a service like [Heroku](https://www.heroku.com/). 132 | 133 | In this example, we will use localhost and [ngrok](https://ngrok.com/) to set up the domain and webhook: 134 | 1. Download and install [ngrok](https://ngrok.com/download). 135 | 2. Go to this project directory and run the command in the terminal: `php -S localhost:8000` 136 | 3. Continue to run the command in the terminal: `ngrok http 8000` 137 | 4. Copy the HTTPS URL provided by ngrok and paste it into your `.env` file. 138 | 139 | ```dotenv 140 | TGN_APP_URL=https://123456789.ngrok.io 141 | ``` 142 | 143 | #### 3. Get your Chat ID and add it to the .env file 144 | 145 | 1. Open a chat with your bot. 146 | 2. Send any message to your bot. (This handle needs to get your chat ID) 147 | 3. Go to the following URL: `/webhooks/getUpdate.php` 148 | 4. Look for the `"chat":{"id":` field and copy the number after it. This is your Chat ID. 149 | 5. Paste the Chat ID in your `.env` file. 150 | 151 | ```dotenv 152 | TELEGRAM_BOT_CHAT_ID=123456789 153 | ``` 154 | 155 | At this time, the source launch process is done, please skip way 2 and go to step [II. Set the webhook](#ii-set-the-webhook) to continue. 156 | 157 |
158 | 159 | --- 160 | 161 |
162 | 163 | Way 2: Install by Docker :whale: 164 |
165 | 166 | > **Note:** This way requires the system to install Docker and Docker Compose. 167 | > 168 | > ⚠ **If you set up the project by way one, please skip this way.** 🚸 169 | > 170 | >And go to step [II. Set the webhook](#ii-set-the-webhook) to continue. 171 | 172 | First, please clone this project and copy the environment file `.env.example` to `.env`: 173 | 174 | ```bash 175 | git clone git@github.com:cslant/telegram-git-notifier-app.git 176 | cd telegram-git-notifier-app 177 | cp .env.example .env 178 | ``` 179 | 180 | #### 1. Update the environment variables 181 | 182 | Open the `.env` file and update the following variables: 183 | 184 | ```dotenv 185 | PHP_VERSION_SELECTED=8.2 186 | APP_PORT=3180 187 | 188 | # You can customize the container name to suit your needs using GitHub and GitLab 189 | CONTAINER_NAME=tgn-app 190 | ``` 191 | 192 | > **Note:** 193 | > 194 | > - The `PHP_VERSION_SELECTED` variable is the PHP version you want to use in the container. 195 | > - The `APP_PORT` variable is the port of the container. (Please don't set the same port as the host) 196 | > - The `CONTAINER_NAME` variable is the name of the container you want to create. 197 | 198 | #### 2. Install and run the container 199 | 200 | Run the following command to install and run the container: 201 | 202 | ```shell 203 | bash ./docker.sh 204 | ``` 205 | 206 | Some of the JSON files will be created automatically in the `storage` directory. 207 | These files are used to store the data and serve for features in this bot. 208 | 209 | #### 3. Create a New Bot 210 | 211 | To create a new bot, 212 | you need to talk to [BotFather](https://core.telegram.org/bots#6-botfather) and follow a few simple steps. 213 | 214 | 1. Open a chat with [BotFather](https://telegram.me/botfather) and send `/newbot` command. 215 | 2. Enter a friendly name for your bot. This name will be displayed in contact details and elsewhere. 216 | 3. Enter a unique username for your bot. It must end in `bot`. Like this, for example: `TetrisBot` or `tetris_bot`. 217 | 4. Copy the HTTP API access token provided by [BotFather](https://telegram.me/botfather) and paste it into your `.env` file. 218 | 219 | ```dotenv 220 | TELEGRAM_BOT_TOKEN=123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ 221 | ``` 222 | 223 | 224 | #### 4. Set up your domain and SSL certificate 225 | 226 | In this way, we use the proxy in the container and [ngrok](https://ngrok.com/) to set up the domain and webhook: 227 | 1. Check the proxy of the container: `docker inspect -nginx | grep IPAddress` 228 | 229 | > **Note:** Replace `` with the name of the container in .env file. 230 | 231 | Example: 232 | 233 | ![image](https://github.com/cslant/lemp-docker/assets/35853002/8dc8ba3f-b1e9-4bff-901d-6bb7747acda4) 234 | 235 | 2. Download and install [ngrok](https://ngrok.com/download). 236 | 2. Continue to run the command in the terminal: `ngrok http ` 237 | 238 | > **Note:** Replace `` is the IP address of the container in step 1. 239 | 240 | Example: 241 | 242 | ```bash 243 | ngrok http 172.28.0.3 244 | ``` 245 | 246 | 3. Copy the HTTPS URL provided by ngrok and paste it into your `.env` file. 247 | 248 | ```dotenv 249 | TGN_APP_URL=https://123456789.ngrok-free.app 250 | ``` 251 | 252 | #### 5. Get your Chat ID and add it to the .env file 253 | 254 | 1. Open a chat with your bot. 255 | 2. Send any message to your bot. (This handle needs to get your chat ID) 256 | 3. Go to the following URL: `/webhooks/getUpdate.php` 257 | 4. Look for the `"chat":{"id":` field and copy the number after it. This is your Chat ID. 258 | 5. Paste the Chat ID in your `.env` file. 259 | 260 | ```dotenv 261 | TELEGRAM_BOT_CHAT_ID=123456789 262 | ``` 263 | 264 |
265 | 266 | ### II. Set the webhook 267 | 268 | We have two ways to set the webhook: 269 | 270 | #### 1. Set the webhook from this project 271 | 272 | After setting up your domain and SSL certificate, you need to set up the webhook for your bot. 273 | 274 | **Go to:** 275 | 276 | ```text 277 | /webhooks/set.php 278 | ``` 279 | 280 | > **Note:** Replace `` with your app URL in .env file. 281 | 282 | If you see the following message, it means that the webhook has been sent successfully. 283 | 284 | ```json 285 | {"ok":true,"result":true,"description":"Webhook was set"} 286 | ``` 287 | 288 | [//]: # (status image) 289 | 290 | #### 2. Set the webhook manually from Telegram 291 | 292 | If you want to set the webhook manually, you can use the following URL: 293 | 294 | ```url 295 | https://api.telegram.org/bot/setWebhook?url= 296 | ``` 297 | 298 | > **Note:** Replace `` with your bot token and `` with your app URL in the `.env` file. 299 | 300 | ### III. Add chat IDs you want to receive notifications to the .env file 301 | 302 | #### 1. Add multiple chat IDs to the `.env` file. 303 | 304 | **These chat IDs will be the chat IDs of your groups, channels, or users.** 305 | 306 | Also, you can add **the chat ID of this bot** to receive incoming notifications for itself. 307 | 308 | ```dotenv 309 | TELEGRAM_NOTIFY_CHAT_IDS="-978339113;-1001933979183" 310 | ``` 311 | 312 | #### 2. Add a topic for supergroups with premium users (Thread ID) 313 | 314 | You can add topic for supergroups with premium users (Thread ID). 315 | 316 | **These topics will be the topics of your supergroups.** 317 | 318 | ```dotenv 319 | TELEGRAM_NOTIFY_CHAT_IDS="-978339113;-1001933979183:topic_1;" 320 | ``` 321 | 322 | #### 3. Add multiple topics for supergroups with premium users (Thread IDs) 323 | 324 | You can add multiple topics for each supergroup with premium users (Thread IDs). 325 | 326 | ```dotenv 327 | TELEGRAM_NOTIFY_CHAT_IDS="-978339113;-1001933979183:topic_1,topic_2;" 328 | ``` 329 | 330 | > **Note:** 331 | > 332 | > - Please use semicolon ";" to separate chat ids 333 | > - And use a colon ":" to separate chat ID and topic 334 | > - And use the comma "," if you want to add multiple topics 335 | 336 | --- 337 | 338 | Now your configuration is complete. And the `.env` file will be like this: 339 | 340 | ```dotenv 341 | TGN_APP_NAME='Telegram GitHub/GitLab Notify Bot' 342 | 343 | # Set your app URL here (Required for the bot to work properly) 344 | TGN_APP_URL=https://123456789.ngrok.io 345 | 346 | TELEGRAM_BOT_TOKEN=6162840106:AAH3g20lMQIkG_wHHu8R_ngdtG541uzoq4 347 | TELEGRAM_BOT_CHAT_ID=6872320129 348 | 349 | # Set the chat IDs that will receive notifications here. 350 | # You can add the owner bot ID, group id, ... 351 | # ------------------------------------------------------- 352 | # Note: 353 | # Please use semicolon ";" to separate chat ids 354 | # And use a colon ":" to separate chat ID and thread ID 355 | # And use comma "," if you want to add multiple thread ids 356 | # ------------------------------------------------------- 357 | # The environment variable is expected to be in the format: 358 | # "chat_id1;chat_id2:thread_id2;chat_id3:thread_id3_1,thread_id3_2;..." 359 | TELEGRAM_NOTIFY_CHAT_IDS="-978339113;-1001933979183:2,13;6872320129" 360 | 361 | TIMEZONE=Asia/Ho_Chi_Minh 362 | 363 | PHP_VERSION_SELECTED=8.2 364 | CONTAINER_NAME=tgn-bot 365 | APP_PORT=3180 366 | ``` 367 | 368 | ## 🚀 Usage 369 | 370 | Now you can send a message to your bot, and you will receive a welcome message from the bot. 371 | 372 | ```text 373 | /start 374 | ``` 375 | 376 | [//]: # (image) 377 | 378 | If you want to check the menu, you can send the following message to your bot. 379 | 380 | ```text 381 | /menu 382 | ``` 383 | 384 | 🎊 At this point, the configuration process for your telegram bot is completed. 385 | You can use all the features of this bot. 386 | 🎉🎉 387 | 388 |

389 | Menu features of this bot 390 |

391 | 392 | **To increase ease of use. Let's create a menu with a list of commands listed for you.** 393 | 394 | Please send the following message to your bot to create a menu button. 395 | 396 | ```text 397 | /set_menu 398 | ``` 399 | 400 |

401 | Set menu Set menu 402 |

403 | 404 | Now you will need to add the Webhook for your GitHub and GitLab repository to receive notifications. 405 | 406 | ## 📌 Add webhook on your GitHub repository to receive notifications 407 | 408 | 1. Go to your repository settings. 409 | 2. Go to the `Webhooks` section. 410 | 3. Click on `Add webhook`. 411 | 4. Set `Payload URL` to ``. 412 | 5. Set `Content type` to `application/x-www-form-urlencoded`. 413 | 6. Which events would you like to trigger this webhook? Select `Let me select individual events.`. 414 | 7. Click on the `Active` checkbox and Add webhook button. 415 | 8. Done. You will receive a notification when your repository has a new event. 416 | 417 | Here is the first notification you will receive: 418 | 419 |

420 | Github ping event notification 421 |

422 | 423 | ## 📌 Add a webhook on your GitLab repository to receive notifications 424 | 425 | 1. Go to your repository settings. 426 | 2. Go to the `Webhooks` section. 427 | 3. Click on `Add new webhook`. 428 | 4. Set `URL` to ``. 429 | 5. Choose any `Trigger` you want. 430 | 6. Click on the `Enable SSL verification` checkbox and Add webhook button. 431 | 432 | > **Note: You can set up this webhook for different repositories. Please similarly set up the webhook for each repository.** 433 | 434 | Then every time one of those repositories appears an event, this telegram bot will immediately send you a notification. 435 | -------------------------------------------------------------------------------- /UPGRADING.md: -------------------------------------------------------------------------------- 1 | ## Upgrading 2 | 3 | ### Moving from lbiltech/telegram-git-notifier-app to cslant/telegram-git-notifier-app 4 | 5 | - Replace any reference in your application from `LbilTech\TelegramGitNotifierApp` to `CSlant\TelegramGitNotifierApp` 6 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cslant/telegram-git-notifier-app", 3 | "description": "The PHP app to send notification from Gitlab and Github events to Telegram", 4 | "keywords": [ 5 | "cslant", 6 | "telegram-bot", 7 | "notify", 8 | "git-webhook", 9 | "telegram-notifier", 10 | "telegram-git-notifier", 11 | "github-notifier", 12 | "gitlab-notifier", 13 | "github-telegram-bot", 14 | "gitlab-telegram-bot", 15 | "telegram-bot-github-notify", 16 | "telegram-bot-gitlab-notify", 17 | "telegram-git-notifier-app" 18 | ], 19 | "type": "project", 20 | "homepage": "https://github.com/cslant/telegram-git-notifier-app", 21 | "license": "MIT", 22 | "require": { 23 | "php": "^8.1", 24 | "ext-json": "*", 25 | "cslant/telegram-git-notifier": "^1.3.1" 26 | }, 27 | "require-dev": { 28 | "friendsofphp/php-cs-fixer": "^v3.37.1", 29 | "phpstan/phpstan": "^1.10.39" 30 | }, 31 | "autoload": { 32 | "psr-4": { 33 | "CSlant\\TelegramGitNotifierApp\\": "src/" 34 | } 35 | }, 36 | "authors": [ 37 | { 38 | "name": "Tan Nguyen", 39 | "email": "tannp27@gmail.com", 40 | "homepage": "https://tanhongit.com", 41 | "role": "Lead" 42 | } 43 | ], 44 | "support": { 45 | "issues": "https://github.com/cslant/telegram-git-notifier-app/issues" 46 | }, 47 | "config": { 48 | "sort-packages": true, 49 | "optimize-autoloader": true 50 | }, 51 | "scripts": { 52 | "analyse": "vendor/bin/phpstan", 53 | "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes", 54 | "post-install-cmd": [ 55 | "bash vendor/cslant/telegram-git-notifier/install.sh" 56 | ], 57 | "post-update-cmd": [ 58 | "bash vendor/cslant/telegram-git-notifier/install.sh" 59 | ] 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.9' 2 | 3 | networks: 4 | telegram-git-notifier: 5 | 6 | services: 7 | server: 8 | build: 9 | context: . 10 | args: 11 | - PHP_VERSION_SELECTED=${PHP_VERSION_SELECTED:-8.2} 12 | dockerfile: ./.docker/Dockerfile 13 | container_name: '${CONTAINER_NAME:-telegram-git-notifier}-server' 14 | volumes: 15 | - ./:/var/www/html 16 | - ./.docker/config/php/php.ini:/usr/local/etc/php/conf.d/extra-php-config.ini 17 | user: '${USER_ID:-1000}:${GROUP_ID:-1000}' 18 | networks: 19 | - telegram-git-notifier 20 | 21 | nginx: 22 | image: nginx:alpine 23 | container_name: '${CONTAINER_NAME:-telegram-git-notifier}-nginx' 24 | ports: 25 | - '${APP_PORT:-1080}:80' 26 | volumes: 27 | - ./:/var/www/html 28 | - ./.docker/conf.d/:/etc/nginx/conf.d/ 29 | - ./.docker/log/nginx:/var/log/nginx/ 30 | depends_on: 31 | - server 32 | networks: 33 | - telegram-git-notifier 34 | -------------------------------------------------------------------------------- /docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker-compose up -d 4 | docker-compose run --rm server bash -c "composer install" 5 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | getMessage()); 17 | } 18 | -------------------------------------------------------------------------------- /init.php: -------------------------------------------------------------------------------- 1 | load(); 9 | 10 | date_default_timezone_set(config('telegram-git-notifier.app.timezone')); 11 | -------------------------------------------------------------------------------- /phpstan.neon.dist: -------------------------------------------------------------------------------- 1 | parameters: 2 | level: 8 3 | paths: 4 | - src 5 | - webhook 6 | tmpDir: build/phpstan 7 | checkMissingIterableValueType: false 8 | -------------------------------------------------------------------------------- /resources/images/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cslant/telegram-git-notifier-app/5bff9fce17d809589e76e886f072fd9823f1b744/resources/images/start.png -------------------------------------------------------------------------------- /resources/views/events/github/issue_comment/created.php: -------------------------------------------------------------------------------- 1 | New Issue Comment ⚠️ to 🦑issue->html_url}\">{$payload->repository->full_name}#{$payload->issue->number} by comment->user->html_url}\">@{$payload->comment->user->login}\n\n"; 9 | 10 | $message .= "📢 {$payload->issue->title}\n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; 13 | 14 | $message .= require __DIR__ . '/../../shared/partials/github/_body.php'; 15 | 16 | echo $message; 17 | -------------------------------------------------------------------------------- /resources/views/events/github/issue_comment/deleted.php: -------------------------------------------------------------------------------- 1 | Issue Comment Deleted 💬 from 🦑repository->html_url}\">{$payload->repository->full_name} by sender->html_url}\">@{$payload->sender->login}\n\n"; 9 | 10 | $message .= "📢 {$payload->issue->title}\n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; 13 | 14 | $message .= require __DIR__ . '/../../shared/partials/github/_body.php'; 15 | 16 | echo $message; 17 | -------------------------------------------------------------------------------- /resources/views/events/github/issue_comment/edited.php: -------------------------------------------------------------------------------- 1 | Issue Comment Edited 💬 in 🦑issue->html_url}\">{$payload->repository->full_name}#{$payload->issue->number} by comment->user->html_url}\">@{$payload->comment->user->login}\n\n"; 9 | 10 | $message .= "📢 {$payload->issue->title}\n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; 13 | 14 | $message .= require __DIR__ . '/../../shared/partials/github/_body.php'; 15 | 16 | echo $message; 17 | -------------------------------------------------------------------------------- /resources/views/events/github/issues/closed.php: -------------------------------------------------------------------------------- 1 | Issue Closed to 🦑issue->html_url}\">{$payload->repository->full_name}#{$payload->issue->number} by issue->user->html_url}\">@{$payload->issue->user->login}\n\n"; 7 | 8 | $message .= "📢 {$payload->issue->title}\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/github/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/github/issues/deleted.php: -------------------------------------------------------------------------------- 1 | Issue Deleted form 🦑repository->html_url}\">{$payload->repository->full_name} by sender->html_url}\">@{$payload->sender->login}\n\n"; 7 | 8 | $message .= "📢 {$payload->issue->title}\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; 11 | 12 | echo $message; 13 | -------------------------------------------------------------------------------- /resources/views/events/github/issues/edited.php: -------------------------------------------------------------------------------- 1 | Issue has been edited to 🦑issue->html_url}\">{$payload->repository->full_name}#{$payload->issue->number} by issue->user->html_url}\">@{$payload->issue->user->login}\n\n"; 7 | 8 | $message .= "📢 {$payload->issue->title}\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; 11 | 12 | if (isset($payload->changes->title)) { 13 | $message .= "📖 Title has been changed\n"; 14 | $message .= " 📝 From: {$payload->changes->title->from}\n"; 15 | $message .= " 🏷 To: {$payload->issue->title}\n"; 16 | } elseif (isset($payload->changes->body)) { 17 | $message .= "📖 Body has been changed\n"; 18 | $message .= "Please check the issue for more details\n"; 19 | } 20 | 21 | echo $message; 22 | -------------------------------------------------------------------------------- /resources/views/events/github/issues/locked.php: -------------------------------------------------------------------------------- 1 | Issue Locked form 🦑repository->html_url}\">{$payload->repository->full_name} by sender->html_url}\">@{$payload->sender->login}\n\n"; 7 | 8 | $message .= "📢 {$payload->issue->title}\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/github/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/github/issues/opened.php: -------------------------------------------------------------------------------- 1 | New Issue to 🦑issue->html_url}\">{$payload->repository->full_name}#{$payload->issue->number} by issue->user->html_url}\">@{$payload->issue->user->login}\n\n"; 7 | 8 | $message .= "📢 {$payload->issue->title}\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/github/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/github/issues/pinned.php: -------------------------------------------------------------------------------- 1 | Issue Pinned form 🦑repository->html_url}\">{$payload->repository->full_name} by sender->html_url}\">@{$payload->sender->login}\n\n"; 7 | 8 | $message .= "📢 {$payload->issue->title}\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/github/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/github/issues/reopened.php: -------------------------------------------------------------------------------- 1 | Issue has been reopened ⚠️ to 🦑issue->html_url}\">{$payload->repository->full_name}#{$payload->issue->number} by issue->user->html_url}\">@{$payload->issue->user->login}\n\n"; 7 | 8 | $message .= "📢 {$payload->issue->title}\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/github/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/github/issues/unlocked.php: -------------------------------------------------------------------------------- 1 | Issue Unlocked form 🦑repository->html_url}\">{$payload->repository->full_name} by sender->html_url}\">@{$payload->sender->login}\n\n"; 7 | 8 | $message .= "📢 {$payload->issue->title}\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/github/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/github/issues/unpinned.php: -------------------------------------------------------------------------------- 1 | Issue Unpinned form 🦑repository->html_url}\">{$payload->repository->full_name} by sender->html_url}\">@{$payload->sender->login}\n\n"; 7 | 8 | $message .= "📢 {$payload->issue->title}\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/github/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/github/ping/default.php: -------------------------------------------------------------------------------- 1 | Connection Successful\n\n"; 7 | 8 | if (isset($payload->organization)) { 9 | $message .= "🏢 Organization: {$payload->organization->login}\n"; 10 | } 11 | 12 | if (isset($payload->repository)) { 13 | $message .= "📦 Repository: 🦑{$payload->repository->full_name}\n"; 14 | } 15 | 16 | if (isset($payload->sender)) { 17 | $message .= "👤 Sender (triggered the event): {$payload->sender->login}\n"; 18 | } 19 | 20 | echo $message; 21 | -------------------------------------------------------------------------------- /resources/views/events/github/pull_request/closed.php: -------------------------------------------------------------------------------- 1 | Pull Request Merged'; 7 | if (!isset($payload->pull_request->merged) || $payload->pull_request->merged !== true) { 8 | $message = '❌ Pull Request Closed'; 9 | } 10 | 11 | $message = $message . " - 🦑pull_request->html_url}\">{$payload->repository->full_name}#{$payload->pull_request->number} by pull_request->user->html_url}\">@{$payload->pull_request->user->login}\n\n"; 12 | 13 | $message .= "🛠 {$payload->pull_request->title} \n\n"; 14 | 15 | $message .= "🌳 {$payload->pull_request->head->ref} -> {$payload->pull_request->base->ref} 🎯 \n"; 16 | 17 | $message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; 18 | 19 | $message .= require __DIR__ . '/partials/_reviewers.php'; 20 | 21 | $message .= require __DIR__ . '/../../shared/partials/github/_body.php'; 22 | 23 | echo $message; 24 | -------------------------------------------------------------------------------- /resources/views/events/github/pull_request/opened.php: -------------------------------------------------------------------------------- 1 | New Pull Request - 🦑pull_request->html_url}\">{$payload->repository->full_name}#{$payload->pull_request->number} create by pull_request->user->html_url}\">@{$payload->pull_request->user->login}\n\n"; 7 | 8 | $message .= "🛠 {$payload->pull_request->title} \n\n"; 9 | 10 | $message .= "🌳 {$payload->pull_request->head->ref} -> {$payload->pull_request->base->ref} 🎯 \n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; 13 | 14 | $message .= require __DIR__ . '/partials/_reviewers.php'; 15 | 16 | $message .= require __DIR__ . '/../../shared/partials/github/_body.php'; 17 | 18 | echo $message; 19 | -------------------------------------------------------------------------------- /resources/views/events/github/pull_request/partials/_reviewers.php: -------------------------------------------------------------------------------- 1 | pull_request->requested_reviewers) && count($payload->pull_request->requested_reviewers) > 0) { 8 | $reviewers = []; 9 | foreach ($payload->pull_request->requested_reviewers as $reviewer) { 10 | $reviewers[] = "{$reviewer->login}"; 11 | } 12 | 13 | $textReviewers .= "👥 Reviewers: " . implode(', ', $reviewers) . "\n"; 14 | } 15 | 16 | return $textReviewers; 17 | -------------------------------------------------------------------------------- /resources/views/events/github/pull_request/reopened.php: -------------------------------------------------------------------------------- 1 | Reopened Pull Request - 🦑pull_request->html_url}\">{$payload->repository->full_name}#{$payload->pull_request->number} by pull_request->user->html_url}\">@{$payload->pull_request->user->login}\n\n"; 7 | 8 | $message .= "🛠 {$payload->pull_request->title} \n\n"; 9 | 10 | $message .= "🌳 {$payload->pull_request->head->ref} -> {$payload->pull_request->base->ref} 🎯 \n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/github/_assignees.php'; 13 | 14 | $message .= require __DIR__ . '/partials/_reviewers.php'; 15 | 16 | $message .= require __DIR__ . '/../../shared/partials/github/_body.php'; 17 | 18 | echo $message; 19 | -------------------------------------------------------------------------------- /resources/views/events/github/pull_request_review/dismissed.php: -------------------------------------------------------------------------------- 1 | Dismissed Pull Request Review Comment 💬 - 🦑pull_request->html_url}\">{$payload->repository->full_name}#{$payload->pull_request->number} by review->user->html_url}\">@{$payload->review->user->login}\n\n"; 7 | 8 | $message .= "🛠 {$payload->pull_request->title} \n\n"; 9 | 10 | $message .= "🔗 Link: review->html_url}\">{$payload->review->html_url}\n\n"; 11 | 12 | echo $message; 13 | -------------------------------------------------------------------------------- /resources/views/events/github/pull_request_review/submitted.php: -------------------------------------------------------------------------------- 1 | New Pull Request Review Comment 💬 - 🦑pull_request->html_url}\">{$payload->repository->full_name}#{$payload->pull_request->number} by review->user->html_url}\">@{$payload->review->user->login}\n\n"; 7 | 8 | $message .= "🛠 {$payload->pull_request->title} \n\n"; 9 | 10 | $message .= "🔗 Link: review->html_url}\">{$payload->review->html_url}\n\n"; 11 | 12 | echo $message; 13 | -------------------------------------------------------------------------------- /resources/views/events/github/push/default.php: -------------------------------------------------------------------------------- 1 | commits); 7 | $noun = ($count > 1) ? "commits" : "commit"; 8 | 9 | $ref = explode('/', $payload->ref); 10 | $branch = implode('/', array_slice($ref, 2)); 11 | 12 | $message = "⚙️ {$count} new {$noun} to 🦑{$payload->repository->full_name}:{$branch}\n\n"; 13 | 14 | foreach ($payload->commits as $commit) { 15 | $commitId = substr($commit->id, -7); 16 | $message .= "url}\">{$commitId}: {$commit->message} - by {$commit->author->name}\n"; 17 | } 18 | 19 | $message .= "\n👤 Pushed by : {$payload->pusher->name}\n"; 20 | 21 | echo $message; 22 | -------------------------------------------------------------------------------- /resources/views/events/github/watch/started.php: -------------------------------------------------------------------------------- 1 | Watch Started form 🦑repository->html_url}\">{$payload->repository->full_name}\n\n"; 7 | 8 | $message .= "👤 Watcher: {$payload->sender->login} 👀\n\n"; 9 | 10 | echo $message; 11 | -------------------------------------------------------------------------------- /resources/views/events/github/workflow_job/completed.php: -------------------------------------------------------------------------------- 1 | workflow_job->conclusion === 'success') { 7 | $message = "🎉 Action Completed form 🦑repository->html_url}\">{$payload->repository->full_name}\n\n"; 8 | 9 | $message .= "Done action: 🎉 {$payload->workflow_job->runner_name} ✨ \n\n"; 10 | } else { 11 | $message = "🚫 Canceled Action form 🦑repository->html_url}\">{$payload->repository->full_name}\n\n"; 12 | 13 | $message .= "Failed action: 🚫 {$payload->workflow_job->runner_name} ❌ \n\n"; 14 | } 15 | 16 | $message .= "🔗 Link: workflow_job->html_url}\">{$payload->workflow_job->html_url}\n\n"; 17 | 18 | echo $message; 19 | -------------------------------------------------------------------------------- /resources/views/events/github/workflow_job/in_progress.php: -------------------------------------------------------------------------------- 1 | Action in progress form 🦑repository->html_url}\">{$payload->repository->full_name} \n\n"; 7 | 8 | $message .= "Running action: 💥 {$payload->workflow_job->runner_name} ⏳\n\n"; 9 | 10 | $message .= "🔗 Link: workflow_job->html_url}\">{$payload->workflow_job->html_url}\n\n"; 11 | 12 | echo $message; 13 | -------------------------------------------------------------------------------- /resources/views/events/github/workflow_job/queued.php: -------------------------------------------------------------------------------- 1 | Action Queued form 🦑repository->html_url}\">{$payload->repository->full_name}\n\n"; 7 | 8 | $message .= "Queued action: 💥 {$payload->workflow_job->runner_name} ⏰\n\n"; 9 | 10 | $message .= "🔗 Link: workflow_job->html_url}\">{$payload->workflow_job->html_url}\n\n"; 11 | -------------------------------------------------------------------------------- /resources/views/events/github/workflow_run/completed.php: -------------------------------------------------------------------------------- 1 | workflow_run->conclusion) { 7 | case 'success': 8 | $message = "🎉 Workflow Completed form 🦑repository->html_url}\">{$payload->repository->full_name}\n\n"; 9 | 10 | $message .= "Done workflow: 🎉 {$payload->workflow_run->name} ✨ \n\n"; 11 | break; 12 | case 'failure': 13 | $message = "🚫 Workflow Failed form 🦑repository->html_url}\">{$payload->repository->full_name}\n\n"; 14 | 15 | $message .= "Failed workflow: 🚫 {$payload->workflow_run->name} ❌ \n\n"; 16 | break; 17 | case 'cancelled': 18 | $message = "❌ Workflow Cancelled form 🦑repository->html_url}\">{$payload->repository->full_name}\n\n"; 19 | 20 | $message .= "Cancelled workflow: 🚨 {$payload->workflow_run->name} ❌ \n\n"; 21 | break; 22 | default: 23 | $message = "🚨 Workflow Can't Success form 🦑repository->html_url}\">{$payload->repository->full_name}\n\n"; 24 | 25 | $message .= "Can't Success workflow: 🚨 {$payload->workflow_run->name} ❌ \n\n"; 26 | break; 27 | } 28 | 29 | // $message .= "📤 Commit: {$payload->workflow_run->head_commit->message}\n\n"; 30 | 31 | $message .= "🔗 Link: workflow_run->html_url}\">{$payload->workflow_run->html_url}\n\n"; 32 | 33 | echo $message; 34 | -------------------------------------------------------------------------------- /resources/views/events/github/workflow_run/requested.php: -------------------------------------------------------------------------------- 1 | Workflow Requested form 🦑repository->html_url}\">{$payload->repository->full_name}\n\n"; 7 | 8 | $message .= "Running workflow: 💥 {$payload->workflow_run->name} ⏳\n\n"; 9 | 10 | // $message .= "📤 Commit: {$payload->workflow_run->head_commit->message}\n\n"; 11 | 12 | $message .= "🔗 Link: workflow_run->html_url}\">{$payload->workflow_run->html_url}\n\n"; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/feature_flag/default.php: -------------------------------------------------------------------------------- 1 | object_attributes->active) { 7 | $active = "Enabled"; 8 | $icon = "🚩"; 9 | } else { 10 | $active = "Disabled"; 11 | $icon = "🏴"; 12 | } 13 | 14 | $flagUrl = $payload->project->web_url . "/-/feature_flags/" . $payload->object_attributes->id; 15 | 16 | $message = "{$icon} Feature Flag {$active} - 🦊{$payload->project->path_with_namespace}#{$payload->object_attributes->name} by user_url}\">{$payload->user->name}\n\n"; 17 | 18 | $message .= "{$icon} Name: {$payload->object_attributes->name} \n\n"; 19 | 20 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 21 | 22 | echo $message; 23 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/issue/close.php: -------------------------------------------------------------------------------- 1 | Issue Closed to 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->id} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "📢 {$payload->object_attributes->title}\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/issue/open.php: -------------------------------------------------------------------------------- 1 | New Issue to 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->id} created by {$payload->user->name}\n\n"; 7 | 8 | $message .= "📢 {$payload->object_attributes->title}\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/issue/reopen.php: -------------------------------------------------------------------------------- 1 | Issue has been reopened ⚠️ to 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->id} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "📢 {$payload->object_attributes->title}\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/issue/update.php: -------------------------------------------------------------------------------- 1 | Issue has been edited to 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->id} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "📢 {$payload->object_attributes->title}\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/merge_request/approved.php: -------------------------------------------------------------------------------- 1 | Merge Request Approved to 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "🛠 {$payload->object_attributes->title} \n\n"; 9 | 10 | $message .= "🌳 {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} 🎯 \n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; 13 | 14 | $message .= require __DIR__ . '/partials/_reviewers.php'; 15 | 16 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 17 | 18 | echo $message; 19 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/merge_request/close.php: -------------------------------------------------------------------------------- 1 | Close Merge Request - 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "🛠 {$payload->object_attributes->title} \n\n"; 9 | 10 | $message .= "🌳 {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} 🎯 \n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; 13 | 14 | $message .= require __DIR__ . '/partials/_reviewers.php'; 15 | 16 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 17 | 18 | echo $message; 19 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/merge_request/merge.php: -------------------------------------------------------------------------------- 1 | Merge Request Merged to 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "🛠 {$payload->object_attributes->title} \n\n"; 9 | 10 | $message .= "🌳 {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} 🎯 \n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; 13 | 14 | $message .= require __DIR__ . '/partials/_reviewers.php'; 15 | 16 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 17 | 18 | echo $message; 19 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/merge_request/open.php: -------------------------------------------------------------------------------- 1 | Merge Request Opened to 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "🛠 {$payload->object_attributes->title} \n\n"; 9 | 10 | $message .= "🌳 {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} 🎯 \n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; 13 | 14 | $message .= require __DIR__ . '/partials/_reviewers.php'; 15 | 16 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 17 | 18 | echo $message; 19 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/merge_request/partials/_reviewers.php: -------------------------------------------------------------------------------- 1 | reviewers) && count($payload->reviewers) > 0) { 8 | $reviewers = []; 9 | foreach ($payload->reviewers as $reviewer) { 10 | $reviewers[] = "{$reviewer->name}"; 11 | } 12 | 13 | $textReviewers .= "👥 Reviewers: " . implode(', ', $reviewers) . "\n"; 14 | } 15 | 16 | return $textReviewers; 17 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/merge_request/reopen.php: -------------------------------------------------------------------------------- 1 | Merge Request Reopened to 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "🛠 {$payload->object_attributes->title} \n\n"; 9 | 10 | $message .= "🌳 {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} 🎯 \n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; 13 | 14 | $message .= require __DIR__ . '/partials/_reviewers.php'; 15 | 16 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 17 | 18 | echo $message; 19 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/merge_request/unapproval.php: -------------------------------------------------------------------------------- 1 | Merge Request Unapproved to 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "🛠 {$payload->object_attributes->title} \n\n"; 9 | 10 | $message .= "🌳 {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} 🎯 \n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; 13 | 14 | $message .= require __DIR__ . '/partials/_reviewers.php'; 15 | 16 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 17 | 18 | echo $message; 19 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/merge_request/unapproved.php: -------------------------------------------------------------------------------- 1 | Close Merge Request - 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "🛠 {$payload->object_attributes->title} \n\n"; 9 | 10 | $message .= "🌳 {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} 🎯 \n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; 13 | 14 | $message .= require __DIR__ . '/partials/_reviewers.php'; 15 | 16 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 17 | 18 | echo $message; 19 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/merge_request/update.php: -------------------------------------------------------------------------------- 1 | Merge Request Updated to 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->iid} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "🛠 {$payload->object_attributes->title} \n\n"; 9 | 10 | $message .= "🌳 {$payload->object_attributes->source_branch} -> {$payload->object_attributes->target_branch} 🎯 \n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_assignees.php'; 13 | 14 | $message .= require __DIR__ . '/partials/_reviewers.php'; 15 | 16 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 17 | 18 | echo $message; 19 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/note/commit.php: -------------------------------------------------------------------------------- 1 | New Comment on Commit - 🦊object_attributes->url}\">{$payload->project->path_with_namespace} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "⚙️ {$payload->commit->message} \n\n"; 9 | 10 | $message .= "🔗 View Comment: object_attributes->url}\">{$payload->commit->id} \n\n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/note/issue.php: -------------------------------------------------------------------------------- 1 | New Comment on Issue - 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->issue->iid} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "📢 {$payload->issue->title} \n\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 11 | 12 | echo $message; 13 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/note/merge_request.php: -------------------------------------------------------------------------------- 1 | New Comment on Merge Request - 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->merge_request->iid} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "🛠 {$payload->merge_request->title} \n"; 9 | 10 | $message .= "🌳 {$payload->merge_request->source_branch} -> {$payload->merge_request->target_branch} 🎯 \n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/note/snippet.php: -------------------------------------------------------------------------------- 1 | New Comment on Snippet - 🦊object_attributes->url}\">{$payload->project->path_with_namespace} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "📝 {$payload->snippet->title} \n\n"; 9 | 10 | $message .= "🔗 object_attributes->url}\">View Comment \n\n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/push/default.php: -------------------------------------------------------------------------------- 1 | commits); 7 | $noun = ($count > 1) ? "commits" : "commit"; 8 | 9 | $ref = explode('/', $payload->ref); 10 | $branch = implode('/', array_slice($ref, 2)); 11 | 12 | $message = "⚙️ {$count} new {$noun} to 🦊{$payload->project->path_with_namespace}:{$branch}\n\n"; 13 | 14 | foreach ($payload->commits as $commit) { 15 | $commitId = substr($commit->id, -7); 16 | $message .= "url}\">{$commitId}: {$commit->message} - by {$commit->author->name}\n"; 17 | } 18 | 19 | $message .= "\n👤 Pushed by : {$payload->user_name}\n"; 20 | 21 | echo $message; 22 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/release/create.php: -------------------------------------------------------------------------------- 1 | Release Created - 🦊url}\">{$payload->project->path_with_namespace}#{$payload->tag} by {$payload->commit->author->name}\n\n"; 7 | 8 | $message .= "🔖 {$payload->tag} \n"; 9 | 10 | $message .= "🗞 {$payload->name} \n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/release/update.php: -------------------------------------------------------------------------------- 1 | Release Updated - 🦊url}\">{$payload->project->path_with_namespace}#{$payload->tag} by {$payload->commit->author->name}\n\n"; 7 | 8 | $message .= "🔖 {$payload->tag} \n"; 9 | 10 | $message .= "🗞 {$payload->name} \n"; 11 | 12 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/tag_push/default.php: -------------------------------------------------------------------------------- 1 | ref); 7 | $tag = implode('/', array_slice($ref, 2)); 8 | 9 | $tagUrl = $payload->project->web_url . '/tags/' . $tag; 10 | 11 | $message = "⚙️ A new tag has been pushed to the project 🦊project->web_url}\">{$payload->project->path_with_namespace}\n\n"; 12 | 13 | $message .= "🔖 Tag: {$tag}\n\n"; 14 | 15 | $message .= "👤 Pushed by : {$payload->user_name}\n"; 16 | 17 | echo $message; 18 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/wiki_page/create.php: -------------------------------------------------------------------------------- 1 | Wiki Page Created - 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->slug} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "🏷 Title: {$payload->object_attributes->title} \n\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 11 | 12 | echo $message; 13 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/wiki_page/delete.php: -------------------------------------------------------------------------------- 1 | Wiki Page Deleted - 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->slug} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "🏷 Title: {$payload->object_attributes->title} \n\n"; 9 | 10 | echo $message; 11 | -------------------------------------------------------------------------------- /resources/views/events/gitlab/wiki_page/update.php: -------------------------------------------------------------------------------- 1 | Wiki Page Updated - 🦊object_attributes->url}\">{$payload->project->path_with_namespace}#{$payload->object_attributes->slug} by {$payload->user->name}\n\n"; 7 | 8 | $message .= "🏷 Title: {$payload->object_attributes->title} \n\n"; 9 | 10 | $message .= require __DIR__ . '/../../shared/partials/gitlab/_body.php'; 11 | 12 | echo $message; 13 | -------------------------------------------------------------------------------- /resources/views/events/shared/partials/github/_assignees.php: -------------------------------------------------------------------------------- 1 | {$event}->assignees)) { 8 | $assigneeText = "🙋 Assignee: "; 9 | $assigneeArray = []; 10 | foreach ($payload->{$event}->assignees as $assignee) { 11 | $assigneeArray[] = "html_url}\">@{$assignee->login} "; 12 | } 13 | $assigneeText .= implode(', ', $assigneeArray) . "\n"; 14 | } 15 | 16 | return $assigneeText ?? ''; 17 | -------------------------------------------------------------------------------- /resources/views/events/shared/partials/github/_body.php: -------------------------------------------------------------------------------- 1 | {$event}->body)) { 8 | $body = $payload->{$event}->body; 9 | if (strlen($body) > 50) { 10 | $body = substr($body, 0, 50) . '...'; 11 | } 12 | return "📖 Content:\n{$body}"; 13 | } 14 | 15 | return ''; 16 | -------------------------------------------------------------------------------- /resources/views/events/shared/partials/gitlab/_assignees.php: -------------------------------------------------------------------------------- 1 | assignees)) { 8 | $assigneeText = "🙋 Assignee: "; 9 | $assigneeArray = []; 10 | foreach ($payload->assignees as $assignee) { 11 | $assigneeArray[] = "{$assignee->name}"; 12 | } 13 | $assigneeText .= implode(', ', $assigneeArray) . "\n"; 14 | } 15 | 16 | return $assigneeText ?? ''; 17 | -------------------------------------------------------------------------------- /resources/views/events/shared/partials/gitlab/_body.php: -------------------------------------------------------------------------------- 1 | object_attributes->description)) { 8 | $body = $payload->object_attributes->description; 9 | } elseif (!empty($payload->object_attributes->content)) { 10 | $body = $payload->object_attributes->content; 11 | } elseif (!empty($payload->object_attributes->note)) { 12 | $body = $payload->object_attributes->note; 13 | } elseif (!empty($payload->object_attributes->body)) { 14 | $body = $payload->object_attributes->body; 15 | } elseif (!empty($payload->description)) { 16 | $body = $payload->description; 17 | } else { 18 | return ''; 19 | } 20 | if (strlen($body) > 50) { 21 | $body = substr($body, 0, 50) . '...'; 22 | } 23 | return "📖 Content:\n{$body}"; 24 | } 25 | 26 | return ''; 27 | -------------------------------------------------------------------------------- /resources/views/globals/access_denied.php: -------------------------------------------------------------------------------- 1 | Access Denied to Bot 🚫'; 7 | 8 | if (!empty($chatId)) { 9 | $message .= "\n\n🛑 Chat ID: {$chatId} \n"; 10 | } 11 | 12 | $message .= 'Please contact the administrator for further information, Thank You..'; 13 | 14 | echo $message; 15 | -------------------------------------------------------------------------------- /resources/views/tools/about.php: -------------------------------------------------------------------------------- 1 | Thanks for using our bot. 2 | 3 | The bot is designed to send notifications based on GitHub and GitLab events from your repo instantly to your Telegram account. 4 | -------------------------------------------------------------------------------- /resources/views/tools/custom_event.php: -------------------------------------------------------------------------------- 1 | 11 | Go to check the documentation for more information about events. 12 | --- 13 | Click and configure child events if the option has the ⚙ icon. 14 | And select an event to enable or disable notifications: 15 | -------------------------------------------------------------------------------- /resources/views/tools/custom_event_action.php: -------------------------------------------------------------------------------- 1 | 12 | Setting actions for the event . 13 | Please select an action of this event to enable or disable notifications: 14 | -------------------------------------------------------------------------------- /resources/views/tools/id.php: -------------------------------------------------------------------------------- 1 | Your id is 2 | -------------------------------------------------------------------------------- /resources/views/tools/menu.php: -------------------------------------------------------------------------------- 1 | 7 | 8 | BOT MENU 🤖 9 | 10 | 11 | - 12 | 13 | 14 | -------------------------------------------------------------------------------- /resources/views/tools/server.php: -------------------------------------------------------------------------------- 1 | Server Address : 2 | Server Name : 3 | Server Port : 4 | Server Software : 5 | -------------------------------------------------------------------------------- /resources/views/tools/set_menu_cmd.php: -------------------------------------------------------------------------------- 1 | ✅ Menu button set successfully! 2 | 3 | Please restart the bot to apply the changes. 4 | -------------------------------------------------------------------------------- /resources/views/tools/settings.php: -------------------------------------------------------------------------------- 1 | Settings for your bot 🤖 2 | -------------------------------------------------------------------------------- /resources/views/tools/start.php: -------------------------------------------------------------------------------- 1 | 7 | 🙋🏻 🤓 8 | 9 | Hey , 10 | 11 | I can send you notifications from your 🦑GitHub or 🦊GitLab Repository instantly to your Telegram. 12 | Use /menu for more options. 13 | -------------------------------------------------------------------------------- /resources/views/tools/token.php: -------------------------------------------------------------------------------- 1 | This bot token is: 2 | -------------------------------------------------------------------------------- /resources/views/tools/usage.php: -------------------------------------------------------------------------------- 1 | Adding webhook (Web Address) to GitHub repositories 🦑 2 | 3 | 1) Redirect to Repository Settings->Webhooks->Add Webhook. 4 | 2) Set your Payload URL. 5 | 3) Set content type to "application/x-www-form-urlencoded". 6 | 4) Choose events would you like to trigger in this webhook. 7 | (Recommended: Let me select individual events, and choose any events you want). 8 | 5) Check Active checkbox. And click Add Webhook. 9 | 10 | ---------- 11 | Adding webhook (Web Address) to GitLab repositories 🦊 12 | 13 | 1) Redirect to Repository Settings->Webhooks->Add new webhook. 14 | 2) Set your Payload URL. 15 | 3) Choose events would you like to trigger in this webhook. 16 | 4) Check Enable SSL verification if you are using SSL. And click Add Webhook. 17 | 18 | That it. you will receive all notifications through me 🤗 19 | -------------------------------------------------------------------------------- /src/Http/Actions/IndexAction.php: -------------------------------------------------------------------------------- 1 | client = new Client(); 37 | 38 | $telegram = new Telegram(config('telegram-git-notifier.bot.token')); 39 | $this->bot = new Bot($telegram); 40 | $this->notifier = new Notifier(); 41 | } 42 | 43 | /** 44 | * Handle telegram git notifier app 45 | * 46 | * @return void 47 | * @throws EntryNotFoundException 48 | * @throws InvalidViewTemplateException 49 | * @throws MessageIsEmptyException 50 | * @throws SendNotificationException 51 | * @throws BotException 52 | * @throws CallbackException 53 | */ 54 | public function __invoke(): void 55 | { 56 | if ($this->bot->isCallback()) { 57 | $callbackAction = new CallbackService($this->bot); 58 | $callbackAction->handle(); 59 | 60 | return; 61 | } 62 | 63 | if ($this->bot->isMessage() && $this->bot->isOwner()) { 64 | $commandAction = new CommandService($this->bot); 65 | $commandAction->handle(); 66 | 67 | return; 68 | } 69 | 70 | $sendNotification = new NotificationService($this->notifier, $this->bot->setting); 71 | $sendNotification->handle(); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/Http/Actions/WebhookAction.php: -------------------------------------------------------------------------------- 1 | webhook = new Webhook(); 17 | $this->webhook->setToken(config('telegram-git-notifier.bot.token')); 18 | $this->webhook->setUrl(config('telegram-git-notifier.app.url')); 19 | } 20 | 21 | /** 22 | * Set webhook for telegram bot 23 | * 24 | * @return string 25 | * @throws WebhookException 26 | */ 27 | public function set(): string 28 | { 29 | return $this->webhook->setWebhook(); 30 | } 31 | 32 | /** 33 | * Delete webhook for telegram bot 34 | * 35 | * @return string 36 | * @throws WebhookException 37 | */ 38 | public function delete(): string 39 | { 40 | return $this->webhook->deleteWebHook(); 41 | } 42 | 43 | /** 44 | * Get webhook update 45 | * 46 | * @return string 47 | * @throws WebhookException 48 | */ 49 | public function getUpdates(): string 50 | { 51 | return $this->webhook->getUpdates(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/Services/CallbackService.php: -------------------------------------------------------------------------------- 1 | bot = $bot; 22 | } 23 | 24 | /** 25 | * Answer the back button 26 | * 27 | * @param string $callback 28 | * 29 | * @return void 30 | * @throws MessageIsEmptyException 31 | * @throws BotException 32 | * @throws CallbackException 33 | */ 34 | public function answerBackButton(string $callback): void 35 | { 36 | $callback = str_replace(SettingConstant::SETTING_BACK, '', $callback); 37 | 38 | switch ($callback) { 39 | case 'settings': 40 | $view = view('tools.settings'); 41 | $markup = $this->bot->settingMarkup(); 42 | 43 | break; 44 | case 'settings.custom_events.github': 45 | $view = view('tools.custom_event', ['platform' => 'github']); 46 | $markup = $this->bot->eventMarkup(); 47 | 48 | break; 49 | case 'settings.custom_events.gitlab': 50 | $view = view('tools.custom_event', ['platform' => 'gitlab']); 51 | $markup = $this->bot->eventMarkup(null, 'gitlab'); 52 | 53 | break; 54 | case 'menu': 55 | $view = view('tools.menu'); 56 | $markup = $this->menuMarkup($this->bot->telegram); 57 | 58 | break; 59 | default: 60 | $this->bot->answerCallbackQuery('Unknown callback'); 61 | 62 | return; 63 | } 64 | 65 | $this->bot->editMessageText($view, [ 66 | 'reply_markup' => $markup, 67 | ]); 68 | } 69 | 70 | /** 71 | * @return void 72 | * @throws MessageIsEmptyException 73 | * @throws InvalidViewTemplateException 74 | * @throws BotException|CallbackException 75 | */ 76 | public function handle(): void 77 | { 78 | $callback = $this->bot->telegram->Callback_Data(); 79 | 80 | if (str_contains($callback, SettingConstant::SETTING_CUSTOM_EVENTS)) { 81 | $this->bot->eventHandle($callback); 82 | 83 | return; 84 | } 85 | 86 | if (str_contains($callback, SettingConstant::SETTING_BACK)) { 87 | $this->answerBackButton($callback); 88 | 89 | return; 90 | } 91 | 92 | $callback = str_replace(SettingConstant::SETTING_PREFIX, '', $callback); 93 | 94 | $settings = $this->bot->setting->getSettings(); 95 | if (array_key_exists($callback, $settings) 96 | && $this->bot->setting->updateSetting( 97 | $callback, 98 | !$settings[$callback] 99 | ) 100 | ) { 101 | $this->bot->editMessageReplyMarkup([ 102 | 'reply_markup' => $this->bot->settingMarkup(), 103 | ]); 104 | } else { 105 | $this->bot->answerCallbackQuery('Something went wrong!'); 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /src/Services/CommandService.php: -------------------------------------------------------------------------------- 1 | '/start', 18 | 'description' => 'Welcome to the bot', 19 | ], [ 20 | 'command' => '/menu', 21 | 'description' => 'Show menu of the bot', 22 | ], [ 23 | 'command' => '/token', 24 | 'description' => 'Show token of the bot', 25 | ], [ 26 | 'command' => '/id', 27 | 'description' => 'Show the ID of the current chat', 28 | ], [ 29 | 'command' => '/usage', 30 | 'description' => 'Show step by step usage', 31 | ], [ 32 | 'command' => '/server', 33 | 'description' => 'To get Server Information', 34 | ], [ 35 | 'command' => '/settings', 36 | 'description' => 'Go to settings of the bot', 37 | ], 38 | ]; 39 | 40 | private Bot $bot; 41 | 42 | public function __construct(Bot $bot) 43 | { 44 | $this->bot = $bot; 45 | } 46 | 47 | /** 48 | * @param Bot $bot 49 | * 50 | * @return void 51 | * @throws EntryNotFoundException 52 | */ 53 | public function sendStartMessage(Bot $bot): void 54 | { 55 | $reply = view( 56 | 'tools.start', 57 | ['first_name' => $bot->telegram->FirstName()] 58 | ); 59 | $bot->sendPhoto( 60 | __DIR__ . '/../../resources/images/start.png', 61 | ['caption' => $reply] 62 | ); 63 | } 64 | 65 | /** 66 | * @return void 67 | * @throws EntryNotFoundException 68 | * @throws MessageIsEmptyException 69 | */ 70 | public function handle(): void 71 | { 72 | $text = $this->bot->telegram->Text(); 73 | 74 | switch ($text) { 75 | case '/start': 76 | $this->sendStartMessage($this->bot); 77 | 78 | break; 79 | case '/menu': 80 | $this->bot->sendMessage( 81 | view('tools.menu'), 82 | ['reply_markup' => $this->menuMarkup($this->bot->telegram)] 83 | ); 84 | 85 | break; 86 | case '/token': 87 | case '/id': 88 | case '/usage': 89 | case '/server': 90 | $this->bot->sendMessage(view('tools.' . trim($text, '/'))); 91 | 92 | break; 93 | case '/settings': 94 | $this->bot->settingHandle(); 95 | 96 | break; 97 | case '/set_menu': 98 | $this->bot->setMyCommands(CommandService::MENU_COMMANDS); 99 | 100 | break; 101 | default: 102 | $this->bot->sendMessage('🤨 Invalid Request!'); 103 | } 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/Services/NotificationService.php: -------------------------------------------------------------------------------- 1 | request = Request::createFromGlobals(); 28 | $this->notifier = $notifier; 29 | $this->chatIds = $this->notifier->parseNotifyChatIds(); 30 | 31 | $this->setting = $setting; 32 | } 33 | 34 | /** 35 | * Handle to send notification from webhook event to telegram 36 | * 37 | * @return void 38 | * @throws InvalidViewTemplateException 39 | * @throws SendNotificationException 40 | * @throws MessageIsEmptyException 41 | */ 42 | public function handle(): void 43 | { 44 | $eventName = $this->notifier->handleEventFromRequest($this->request); 45 | if (!empty($eventName)) { 46 | $this->sendNotification($eventName); 47 | } 48 | } 49 | 50 | /** 51 | * @param string $event 52 | * 53 | * @return void 54 | * @throws InvalidViewTemplateException 55 | * @throws SendNotificationException 56 | * @throws MessageIsEmptyException 57 | */ 58 | private function sendNotification(string $event): void 59 | { 60 | if (!$this->validateAccessEvent($event)) { 61 | return; 62 | } 63 | 64 | foreach ($this->chatIds as $chatId => $thread) { 65 | if (empty($chatId)) { 66 | continue; 67 | } 68 | 69 | if (empty($thread)) { 70 | $this->notifier->sendNotify(null, ['chat_id' => $chatId]); 71 | 72 | continue; 73 | } 74 | 75 | foreach ($thread as $threadId) { 76 | $this->notifier->sendNotify(null, [ 77 | 'chat_id' => $chatId, 'message_thread_id' => $threadId, 78 | ]); 79 | } 80 | } 81 | } 82 | 83 | /** 84 | * Validate access event 85 | * 86 | * @param string $event 87 | * 88 | * @return bool 89 | * @throws InvalidViewTemplateException|MessageIsEmptyException 90 | */ 91 | private function validateAccessEvent(string $event): bool 92 | { 93 | $payload = $this->notifier->setPayload($this->request, $event); 94 | $validator = new Validator($this->setting, $this->notifier->event); 95 | 96 | if (empty($payload) 97 | || !$validator->isAccessEvent( 98 | $this->notifier->event->platform, 99 | $event, 100 | $payload 101 | ) 102 | ) { 103 | return false; 104 | } 105 | 106 | return true; 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /src/Traits/Markup.php: -------------------------------------------------------------------------------- 1 | buildInlineKeyBoardButton('🗨 Discussion', config('telegram-git-notifier.author.discussion')), 19 | ], [ 20 | $telegram->buildInlineKeyBoardButton('💠 Source Code', config('telegram-git-notifier.author.source_code')), 21 | ], 22 | ]; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /webhook/delete.php: -------------------------------------------------------------------------------- 1 | delete(); 12 | } catch (WebhookException $e) { 13 | echo $e->getMessage(); 14 | } 15 | -------------------------------------------------------------------------------- /webhook/getUpdate.php: -------------------------------------------------------------------------------- 1 | getUpdates(); 12 | } catch (WebhookException $e) { 13 | echo $e->getMessage(); 14 | } 15 | -------------------------------------------------------------------------------- /webhook/set.php: -------------------------------------------------------------------------------- 1 | set(); 12 | } catch (WebhookException $e) { 13 | echo $e->getMessage(); 14 | } 15 | --------------------------------------------------------------------------------