From eca5758972be8de3ac101747c20828467a3d32af Mon Sep 17 00:00:00 2001 From: Stadnik Andrii Date: Sat, 4 May 2024 22:56:52 +0300 Subject: [PATCH 1/2] Remove notify --- .github/workflows/CD.yml | 82 ++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 0362476f..37ddea68 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -71,44 +71,44 @@ jobs: table.csv first_aid_bot - notify: - runs-on: ubuntu-latest - needs: deploy - if: github.base_ref == 'main' - - steps: - - uses: dawidd6/action-download-artifact@v2 - with: - pr: ${{github.event.pull_request.number}} - workflow: CI.yml - name: apk - - - name: send telegram message on push - uses: appleboy/telegram-action@master - if: always() && github.base_ref == 'main' && !contains(needs.*.result, 'failure') - with: - to: ${{ secrets.TELEGRAM_TO }} - token: ${{ secrets.TELEGRAM_TOKEN }} - document: app-release.apk - message: | - ${{ github.actor }} created commit: - Commit message: ${{ github.event.commits[0].message }} - - See changes: https://github.com/${{ github.repository }}/actions/runs/${{github.sha}} - See error: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - Successfully deployed! 🙆 - - - name: send telegram message on push - uses: appleboy/telegram-action@master - if: always() && github.base_ref == 'main' && contains(needs.*.result, 'failure') - with: - to: ${{ secrets.TELEGRAM_TO }} - token: ${{ secrets.TELEGRAM_TOKEN }} - document: table.csv - message: | - ${{ github.actor }} created commit: - Commit message: ${{ github.event.commits[0].message }} - - See changes: https://github.com/${{ github.repository }}/actions/runs/${{github.sha}} - See error: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - The commit fails to build or tests have failed! 💣 + # notify: + # runs-on: ubuntu-latest + # needs: deploy + # if: github.base_ref == 'main' + # + # steps: + # - uses: dawidd6/action-download-artifact@v2 + # with: + # pr: ${{github.event.pull_request.number}} + # workflow: CI.yml + # name: apk + # + # - name: send telegram message on push + # uses: appleboy/telegram-action@master + # if: always() && github.base_ref == 'main' && !contains(needs.*.result, 'failure') + # with: + # to: ${{ secrets.TELEGRAM_TO }} + # token: ${{ secrets.TELEGRAM_TOKEN }} + # document: app-release.apk + # message: | + # ${{ github.actor }} created commit: + # Commit message: ${{ github.event.commits[0].message }} + # + # See changes: https://github.com/${{ github.repository }}/actions/runs/${{github.sha}} + # See error: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + # Successfully deployed! 🙆 + # + # - name: send telegram message on push + # uses: appleboy/telegram-action@master + # if: always() && github.base_ref == 'main' && contains(needs.*.result, 'failure') + # with: + # to: ${{ secrets.TELEGRAM_TO }} + # token: ${{ secrets.TELEGRAM_TOKEN }} + # document: table.csv + # message: | + # ${{ github.actor }} created commit: + # Commit message: ${{ github.event.commits[0].message }} + # + # See changes: https://github.com/${{ github.repository }}/actions/runs/${{github.sha}} + # See error: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + # The commit fails to build or tests have failed! 💣 From 9376f755704ccfbcb861c4d588e00972c565c5fe Mon Sep 17 00:00:00 2001 From: Stadnik Andrii Date: Sat, 4 May 2024 23:06:21 +0300 Subject: [PATCH 2/2] Fix an error --- bot/src/bot/dialogue/commands.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/bot/src/bot/dialogue/commands.rs b/bot/src/bot/dialogue/commands.rs index 0bf268b9..36cefa52 100644 --- a/bot/src/bot/dialogue/commands.rs +++ b/bot/src/bot/dialogue/commands.rs @@ -6,7 +6,7 @@ use crate::bot::{FABot, FADialogue}; use crate::{DataGetState, DATA, REDIS_CONN, REDIS_USERS_SET_KEY}; use anyhow::{anyhow, Context, Error}; use first_aid_bot_core::prelude::*; -use redis::{aio::MultiplexedConnection, AsyncCommands}; +use redis::AsyncCommands; use teloxide::dispatching::DpHandlerDescription; use teloxide::prelude::*; use teloxide::types::ParseMode::Html; @@ -109,11 +109,7 @@ pub fn get_commands_branch() -> FAHandler { } pub fn get_maintainer_commands_branch() -> FAHandler { - dptree::filter( - |msg: Message, _bot: FABot, _data: &'static Data, _conn: MultiplexedConnection| { - cfg!(debug_assertions) || is_admin(&msg) - }, - ) - .filter_command::() - .endpoint(maintainer_commands_handler) + dptree::filter(|msg: Message, _bot: FABot| cfg!(debug_assertions) || is_admin(&msg)) + .filter_command::() + .endpoint(maintainer_commands_handler) }