diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 7ca8f55..38248ed 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -11,14 +11,15 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 with: otp-version: "27.0" gleam-version: "1.2.1" - rebar3-version: "3" + rebar3-version: "3.23.0" + - name: Install Dependencies + run: gleam deps download + - name: Test + run: gleam test - name: Check Format run: gleam format --check src test - - run: gleam deps download - - run: gleam test - - run: gleam format --check src test diff --git a/src/telega/bot.gleam b/src/telega/bot.gleam index b48954f..2048cc5 100644 --- a/src/telega/bot.gleam +++ b/src/telega/bot.gleam @@ -373,7 +373,8 @@ fn do_handle( True -> Some(handle(new_context(bot, update), update_command)) False -> None } - HandleCommands(commands, handle), CommandUpdate(command: update_command, ..) -> { + HandleCommands(commands, handle), CommandUpdate(command: update_command, ..) + -> { case list.contains(commands, update_command.command) { True -> Some(handle(new_context(bot, update), update_command)) False -> None diff --git a/src/telega/model.gleam b/src/telega/model.gleam index 6ac5a83..4b87d3a 100644 --- a/src/telega/model.gleam +++ b/src/telega/model.gleam @@ -381,7 +381,8 @@ pub fn decode_message(json: Dynamic) -> Result(Message, dynamic.DecodeErrors) { connected_website, inline_keyboard_markup, web_app_data, - is_from_offline -> + is_from_offline + -> Error( list.concat([ all_errors(message_id),