telegram_bot_engine 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af763975364e2ffbf61bfd7ed15371e69f8cc54ec8fe2d612a67470d8444ac36
4
- data.tar.gz: e7a870197a5f72b7426ec4faea82bd565316ebfdb5da31111f49421b43d333ff
3
+ metadata.gz: c3d331110ead0fd92e4fee373b4fa5429479116cd9e518a367aea45cdda067df
4
+ data.tar.gz: cb35bb73052d715549a8146cde0ab25d5d990f7b20840ae28859633ab6265609
5
5
  SHA512:
6
- metadata.gz: e76e6c41b0a9025658c04aa1159d65c262fe3165792a005b996314b586e6f5b39b5e3f6e04aee9783147ee7020af4fc6ef7b756f1270db59d0c570368d75b19c
7
- data.tar.gz: dcf2016a6af934331c347dbe3c09163b1f18d461725f036a5609d80bb1a13a3fc12a42c5f1a24c4f7421d0b469c566d65212ebc13a460d415563e49cc3fa5cd5
6
+ metadata.gz: 7b02b7c338ee4dbd4db036e32e2f77fb909aabe9a64e7ed19e9bb2a82b87ee4c8f3dd321e79772aa52d99dc637f986c02d3d7273d2279be1f6be69e22c638e30
7
+ data.tar.gz: d0d8c3bc21441fe79c1e7dd14cfd2ca9a452e2733f6fc0d08b478fadb9322a74968b3d0c0f974189bd20803339020409489f8ae960b70bf93b0381923cde285c
data/README.md CHANGED
@@ -89,8 +89,34 @@ end
89
89
 
90
90
  ### Set webhook
91
91
 
92
+ These rake tasks come from the `telegram-bot` gem:
93
+
94
+ ```bash
95
+ # Register your app's URL with Telegram so it sends updates to your server
96
+ bin/rails telegram:bot:set_webhook RAILS_ENV=production
97
+
98
+ # Remove the webhook (e.g. before switching to polling)
99
+ bin/rails telegram:bot:delete_webhook
100
+
101
+ # Run a local poller for development (no webhook needed)
102
+ bin/rails telegram:bot:poller
103
+ ```
104
+
105
+ The webhook URL is derived from your Rails routes (`telegram_webhook` route helper). Make sure your production server is accessible via HTTPS before setting the webhook.
106
+
107
+ For local development with ngrok, configure `default_url_options` in `config/environments/development.rb`:
108
+
109
+ ```ruby
110
+ if ENV['HOST'].present?
111
+ routes.default_url_options[:host] = ENV.fetch("HOST", "localhost:3000")
112
+ routes.default_url_options[:protocol] = ENV.fetch("PROTOCOL", "https")
113
+ end
114
+ ```
115
+
116
+ Then run:
117
+
92
118
  ```bash
93
- bin/rails telegram:bot:set_webhook
119
+ HOST=your-subdomain.ngrok-free.app bin/rails telegram:bot:set_webhook
94
120
  ```
95
121
 
96
122
  ## Usage
@@ -5,6 +5,7 @@ module TelegramBotEngine
5
5
  extend ActiveSupport::Concern
6
6
 
7
7
  included do
8
+ skip_forgery_protection if respond_to?(:skip_forgery_protection)
8
9
  before_action :authorize_user!
9
10
  end
10
11
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TelegramBotEngine
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegram_bot_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - TelegramBotEngine Contributors
@@ -13,14 +13,14 @@ dependencies:
13
13
  name: rails
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ">="
17
17
  - !ruby/object:Gem::Version
18
18
  version: '7.0'
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - "~>"
23
+ - - ">="
24
24
  - !ruby/object:Gem::Version
25
25
  version: '7.0'
26
26
  - !ruby/object:Gem::Dependency