telegem 3.0.0 โ†’ 3.0.2

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.
data/public/index.html ADDED
@@ -0,0 +1,481 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Telegem Docs - Telegram Bot Framework for Ruby</title>
7
+ <style>
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ body {
15
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
16
+ line-height: 1.6;
17
+ color: #1a1a1a;
18
+ background: #fafafa;
19
+ padding: 0;
20
+ }
21
+
22
+ .container {
23
+ max-width: 900px;
24
+ margin: 0 auto;
25
+ padding: 2rem 1.5rem;
26
+ }
27
+
28
+ .header {
29
+ padding-bottom: 2rem;
30
+ margin-bottom: 2rem;
31
+ border-bottom: 1px solid #eaeaea;
32
+ }
33
+
34
+ .header h1 {
35
+ font-size: 2.2rem;
36
+ color: #2c3e50;
37
+ margin-bottom: 0.25rem;
38
+ }
39
+
40
+ .tagline {
41
+ font-size: 1.1rem;
42
+ color: #7f8c8d;
43
+ margin-bottom: 1.5rem;
44
+ }
45
+
46
+ .stats {
47
+ display: flex;
48
+ gap: 1.5rem;
49
+ margin-top: 1rem;
50
+ }
51
+
52
+ .stat {
53
+ background: white;
54
+ padding: 0.75rem 1rem;
55
+ border-radius: 6px;
56
+ border: 1px solid #eaeaea;
57
+ min-width: 120px;
58
+ }
59
+
60
+ .stat-label {
61
+ font-size: 0.8rem;
62
+ color: #95a5a6;
63
+ text-transform: uppercase;
64
+ letter-spacing: 0.5px;
65
+ margin-bottom: 0.25rem;
66
+ }
67
+
68
+ .stat-value {
69
+ font-size: 1.1rem;
70
+ font-weight: 600;
71
+ color: #2c3e50;
72
+ }
73
+
74
+ .doc-nav {
75
+ display: flex;
76
+ gap: 0.5rem;
77
+ margin: 2rem 0;
78
+ flex-wrap: wrap;
79
+ }
80
+
81
+ .nav-btn {
82
+ background: white;
83
+ border: 1px solid #ddd;
84
+ padding: 0.5rem 1rem;
85
+ border-radius: 4px;
86
+ font-size: 0.9rem;
87
+ color: #555;
88
+ cursor: pointer;
89
+ transition: all 0.2s;
90
+ }
91
+
92
+ .nav-btn:hover {
93
+ border-color: #3498db;
94
+ color: #3498db;
95
+ }
96
+
97
+ .nav-btn.active {
98
+ background: #3498db;
99
+ border-color: #3498db;
100
+ color: white;
101
+ }
102
+
103
+ .doc-section {
104
+ background: white;
105
+ border-radius: 8px;
106
+ padding: 2rem;
107
+ margin-bottom: 1.5rem;
108
+ border: 1px solid #eaeaea;
109
+ }
110
+
111
+ .doc-section h2 {
112
+ font-size: 1.5rem;
113
+ color: #2c3e50;
114
+ margin-bottom: 1rem;
115
+ padding-bottom: 0.5rem;
116
+ border-bottom: 2px solid #f0f0f0;
117
+ }
118
+
119
+ .doc-section h3 {
120
+ font-size: 1.1rem;
121
+ color: #34495e;
122
+ margin: 1.5rem 0 0.75rem;
123
+ }
124
+
125
+ .doc-section p {
126
+ margin-bottom: 1rem;
127
+ color: #555;
128
+ }
129
+
130
+ .method-list {
131
+ list-style: none;
132
+ margin: 1rem 0;
133
+ }
134
+
135
+ .method-item {
136
+ margin-bottom: 0.75rem;
137
+ padding: 0.75rem;
138
+ background: #f8f9fa;
139
+ border-radius: 4px;
140
+ border-left: 3px solid #3498db;
141
+ }
142
+
143
+ .method-name {
144
+ font-family: 'SF Mono', Monaco, Consolas, monospace;
145
+ font-weight: 600;
146
+ color: #2c3e50;
147
+ margin-bottom: 0.25rem;
148
+ }
149
+
150
+ .method-desc {
151
+ color: #7f8c8d;
152
+ font-size: 0.9rem;
153
+ }
154
+
155
+ .code-block {
156
+ background: #2c3e50;
157
+ color: #ecf0f1;
158
+ padding: 1.25rem;
159
+ border-radius: 6px;
160
+ margin: 1rem 0;
161
+ font-family: 'SF Mono', Monaco, Consolas, monospace;
162
+ font-size: 0.9rem;
163
+ line-height: 1.5;
164
+ overflow-x: auto;
165
+ }
166
+
167
+ .code-block::selection {
168
+ background: #3498db;
169
+ }
170
+
171
+ .links {
172
+ display: flex;
173
+ gap: 1rem;
174
+ margin-top: 2rem;
175
+ padding-top: 1.5rem;
176
+ border-top: 1px solid #eaeaea;
177
+ flex-wrap: wrap;
178
+ }
179
+
180
+ .link-btn {
181
+ display: inline-flex;
182
+ align-items: center;
183
+ gap: 0.5rem;
184
+ padding: 0.6rem 1.2rem;
185
+ background: #3498db;
186
+ color: white;
187
+ text-decoration: none;
188
+ border-radius: 4px;
189
+ font-size: 0.9rem;
190
+ transition: background 0.2s;
191
+ }
192
+
193
+ .link-btn:hover {
194
+ background: #2980b9;
195
+ }
196
+
197
+ .link-btn.secondary {
198
+ background: white;
199
+ color: #555;
200
+ border: 1px solid #ddd;
201
+ }
202
+
203
+ .link-btn.secondary:hover {
204
+ background: #f8f9fa;
205
+ }
206
+
207
+ .note {
208
+ background: #f8f9fa;
209
+ padding: 1rem;
210
+ border-left: 3px solid #3498db;
211
+ margin: 1rem 0;
212
+ border-radius: 0 4px 4px 0;
213
+ }
214
+
215
+ @media (max-width: 768px) {
216
+ .container {
217
+ padding: 1rem;
218
+ }
219
+
220
+ .doc-section {
221
+ padding: 1.5rem;
222
+ }
223
+
224
+ .stats {
225
+ flex-direction: column;
226
+ gap: 0.75rem;
227
+ }
228
+
229
+ .stat {
230
+ min-width: auto;
231
+ }
232
+ }
233
+ </style>
234
+ </head>
235
+ <body>
236
+ <div class="container">
237
+ <header class="header">
238
+ <div>
239
+ <h1>Telegem</h1>
240
+ <p class="tagline">Telegram Bot Framework for Ruby</p>
241
+ </div>
242
+
243
+ <div class="stats">
244
+ <div class="stat">
245
+ <div class="stat-label">Version</div>
246
+ <div class="stat-value" id="gem-version">Loading...</div>
247
+ </div>
248
+ <div class="stat">
249
+ <div class="stat-label">Downloads</div>
250
+ <div class="stat-value" id="gem-downloads">Loading...</div>
251
+ </div>
252
+ </div>
253
+
254
+ <div class="doc-nav">
255
+ <button class="nav-btn active" onclick="showDoc('quickstart')">Quick Start</button>
256
+ <button class="nav-btn" onclick="showDoc('ctx')">Context API</button>
257
+ <button class="nav-btn" onclick="showDoc('bot')">Bot API</button>
258
+ <button class="nav-btn" onclick="showDoc('scenes')">Scenes</button>
259
+ <button class="nav-btn" onclick="showDoc('webhook')">Webhook</button>
260
+ </div>
261
+ </header>
262
+
263
+ <!-- Quick Start -->
264
+ <section id="quickstart-doc" class="doc-section">
265
+ <h2>Quick Start</h2>
266
+
267
+ <h3>Installation</h3>
268
+ <div class="code-block">
269
+ # Add to Gemfile
270
+ gem 'telegem'
271
+
272
+ # Or install directly
273
+ $ gem install telegem
274
+ </div>
275
+
276
+ <h3>Basic Usage</h3>
277
+ <div class="code-block">
278
+ require 'telegem'
279
+
280
+ bot = Telegem.new("YOUR_BOT_TOKEN")
281
+
282
+ bot.command('start') do |ctx|
283
+ ctx.reply("Welcome to Telegem!")
284
+ end
285
+
286
+ bot.command('help') do |ctx|
287
+ ctx.reply("Available commands: /start, /help")
288
+ end
289
+
290
+ # Start the bot
291
+ bot.start_polling
292
+ </div>
293
+
294
+ <div class="note">
295
+ Replace <code>YOUR_BOT_TOKEN</code> with your actual Telegram Bot token from @BotFather
296
+ </div>
297
+
298
+ <div class="links">
299
+ <a href="https://rubygems.org/gems/telegem" class="link-btn">๐Ÿ“ฆ View on RubyGems</a>
300
+ <a href="https://gitlab.com/ruby-telegem/telegem" class="link-btn secondary">๐Ÿฑ GitLab Repository</a>
301
+ </div>
302
+ </section>
303
+
304
+ <!-- ctx API -->
305
+ <section id="ctx-doc" class="doc-section" style="display: none;">
306
+ <h2>Context API</h2>
307
+ <p>The context object provides access to the current update and response methods.</p>
308
+
309
+ <h3>Properties</h3>
310
+ <ul class="method-list">
311
+ <li class="method-item">
312
+ <div class="method-name">ctx.message</div>
313
+ <div class="method-desc">Current message object</div>
314
+ </li>
315
+ <li class="method-item">
316
+ <div class="method-name">ctx.from</div>
317
+ <div class="method-desc">User who sent the message</div>
318
+ </li>
319
+ <li class="method-item">
320
+ <div class="method-name">ctx.chat</div>
321
+ <div class="method-desc">Chat information</div>
322
+ </li>
323
+ <li class="method-item">
324
+ <div class="method-name">ctx.session</div>
325
+ <div class="method-desc">Persistent user storage</div>
326
+ </li>
327
+ </ul>
328
+
329
+ <h3>Methods</h3>
330
+ <div class="code-block">
331
+ # Send message
332
+ ctx.reply("Hello!")
333
+
334
+ # Send photo
335
+ ctx.photo("photo.jpg", caption: "My photo")
336
+
337
+ # Edit message
338
+ ctx.edit_message_text("Updated text")
339
+
340
+ # Delete message
341
+ ctx.delete_message(message_id)
342
+ </div>
343
+
344
+ <div class="links">
345
+ <a href="https://gitlab.com/ruby-telegem/telegem/-/tree/main/docs/context.md" class="link-btn">๐Ÿ“„ Full Context Docs</a>
346
+ </div>
347
+ </section>
348
+
349
+ <!-- Bot API -->
350
+ <section id="bot-doc" class="doc-section" style="display: none;">
351
+ <h2>Bot API</h2>
352
+ <p>Configure handlers and control bot lifecycle.</p>
353
+
354
+ <div class="code-block">
355
+ # Handle commands
356
+ bot.command('start') { |ctx| ctx.reply("Welcome") }
357
+
358
+ # Handle text patterns
359
+ bot.hears(/hello/i) { |ctx| ctx.reply("Hi there!") }
360
+
361
+ # Handle specific update types
362
+ bot.on(:photo) { |ctx| ctx.reply("Nice photo!") }
363
+ bot.on(:callback_query) { |ctx| ctx.answer_callback_query }
364
+
365
+ # Start bot
366
+ bot.start_polling
367
+ # or
368
+ bot.webhook.run
369
+ </div>
370
+
371
+ <div class="links">
372
+ <a href="https://gitlab.com/ruby-telegem/telegem/-/tree/main/docs/bot.md" class="link-btn">๐Ÿ“„ Bot API Reference</a>
373
+ </div>
374
+ </section>
375
+
376
+ <!-- Scenes -->
377
+ <section id="scenes-doc" class="doc-section" style="display: none;">
378
+ <h2>Scenes</h2>
379
+ <p>Multi-step conversations for complex interactions.</p>
380
+
381
+ <div class="code-block">
382
+ bot.scene :registration do
383
+ step :ask_name do |ctx|
384
+ ctx.reply("What is your name?")
385
+ end
386
+
387
+ step :save_name do |ctx|
388
+ ctx.session[:name] = ctx.message.text
389
+ ctx.reply("Hello #{ctx.session[:name]}!")
390
+ ctx.leave_scene
391
+ end
392
+ end
393
+
394
+ # Enter scene
395
+ bot.command('register') { |ctx| ctx.enter_scene(:registration) }
396
+ </div>
397
+
398
+ <div class="links">
399
+ <a href="https://gitlab.com/ruby-telegem/telegem/-/tree/main/docs/scenes.md" class="link-btn">๐Ÿ“„ Scenes Guide</a>
400
+ </div>
401
+ </section>
402
+
403
+ <!-- Webhook -->
404
+ <section id="webhook-doc" class="doc-section" style="display: none;">
405
+ <h2>Webhook Deployment</h2>
406
+ <p>Production deployment with webhooks.</p>
407
+
408
+ <div class="code-block">
409
+ # Production setup
410
+ bot = Telegem.new("TOKEN")
411
+
412
+ # Configure webhook
413
+ bot.webhook(
414
+ url: 'https://your-domain.com/webhook',
415
+ port: 3000
416
+ ).run
417
+
418
+ # For cloud platforms
419
+ bot.webhook.run # Auto-detects platform
420
+ </div>
421
+
422
+ <div class="note">
423
+ Webhook mode is recommended for production. Uses less resources than polling.
424
+ </div>
425
+
426
+ <div class="links">
427
+ <a href="https://gitlab.com/ruby-telegem/telegem/-/tree/main/docs/deployment.md" class="link-btn">๐Ÿ“„ Deployment Guide</a>
428
+ </div>
429
+ </section>
430
+
431
+ <!-- Footer -->
432
+ <div class="doc-section">
433
+ <div class="links">
434
+ <a href="https://gitlab.com/ruby-telegem/telegem" class="link-btn">๐Ÿ  Main Repository</a>
435
+ <a href="https://rubygems.org/gems/telegem" class="link-btn secondary">๐Ÿ’Ž RubyGems</a>
436
+ <a href="https://gitlab.com/ruby-telegem/telegem/-/issues" class="link-btn secondary">๐Ÿ› Issue Tracker</a>
437
+ </div>
438
+ </div>
439
+ </div>
440
+
441
+ <script>
442
+ async function fetchGemStats() {
443
+ try {
444
+ const response = await fetch('https://rubygems.org/api/v1/gems/telegem.json');
445
+ const data = await response.json();
446
+
447
+ if (data.version) {
448
+ document.getElementById('gem-version').textContent = `v${data.version}`;
449
+ }
450
+
451
+ if (data.downloads) {
452
+ document.getElementById('gem-downloads').textContent =
453
+ data.downloads.toLocaleString();
454
+ }
455
+ } catch (error) {
456
+ document.getElementById('gem-version').textContent = 'v3.0.0';
457
+ document.getElementById('gem-downloads').textContent = 'N/A';
458
+ }
459
+ }
460
+
461
+ function showDoc(section) {
462
+ document.querySelectorAll('.doc-section').forEach(el => {
463
+ el.style.display = 'none';
464
+ });
465
+
466
+ document.getElementById(`${section}-doc`).style.display = 'block';
467
+
468
+ document.querySelectorAll('.nav-btn').forEach(btn => {
469
+ btn.classList.remove('active');
470
+ });
471
+ event.target.classList.add('active');
472
+
473
+ window.scrollTo(0, 0);
474
+ }
475
+
476
+ document.addEventListener('DOMContentLoaded', () => {
477
+ fetchGemStats();
478
+ });
479
+ </script>
480
+ </body>
481
+ </html>
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegem
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sick_phantom
8
- bindir: exe
8
+ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: '0.20'
18
+ version: 1.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
- version: '0.20'
25
+ version: 1.7.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: concurrent-ruby
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -167,7 +167,8 @@ description: |
167
167
  and a clean DSL. Perfect for building scalable Telegram bots.
168
168
  email:
169
169
  - ynwghosted@icloud.com
170
- executables: []
170
+ executables:
171
+ - telegem-ssl
171
172
  extensions: []
172
173
  extra_rdoc_files: []
173
174
  files:
@@ -180,6 +181,8 @@ files:
180
181
  - Starts_HallofFame.md
181
182
  - Test-Projects/bot.md
182
183
  - Test-Projects/bot1.rb
184
+ - bin/.gitkeep
185
+ - bin/telegem-ssl
183
186
  - docs-src/.gitkeep
184
187
  - docs-src/Bot-registration_.PNG
185
188
  - docs-src/bot.md
@@ -188,6 +191,7 @@ files:
188
191
  - docs-src/getting-started.md
189
192
  - docs-src/keyboard_inline.md
190
193
  - docs-src/scene.md
194
+ - docs-src/webhook.md
191
195
  - lib/api/client.rb
192
196
  - lib/api/types.rb
193
197
  - lib/core/bot.rb
@@ -201,7 +205,8 @@ files:
201
205
  - lib/telegem.rb
202
206
  - lib/webhook/.gitkeep
203
207
  - lib/webhook/server.rb
204
- - setup.sh
208
+ - public/.gitkeep
209
+ - public/index.html
205
210
  homepage: https://gitlab.com/ruby-telegem/telegem
206
211
  licenses:
207
212
  - MIT
@@ -212,8 +217,10 @@ metadata:
212
217
  bug_tracker_uri: https://gitlab.com/ruby-telegem/telegem/-/issues
213
218
  documentation_uri: https://gitlab.com/ruby-telegem/telegem/-/tree/main/docs-src?ref_type=heads
214
219
  rubygems_mfa_required: 'false'
215
- post_install_message: "Thanks for installing Telegem 3.0.0!\nDocumentation: https://gitlab.com/ruby-telegem/telegem\nHappy
216
- bot building! \U0001F916\n"
220
+ post_install_message: "Thanks for installing Telegem 3.0.2!\n\n\U0001F4DA Documentation:
221
+ https://gitlab.com/ruby-telegem/telegem\n\n\U0001F510 For SSL Webhooks:\nRun: telegem-ssl
222
+ your-domain.com\nThis sets up Let's Encrypt certificates automatically.\n\n\U0001F916
223
+ Happy bot building!\n"
217
224
  rdoc_options: []
218
225
  require_paths:
219
226
  - lib
@@ -228,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
235
  - !ruby/object:Gem::Version
229
236
  version: '0'
230
237
  requirements: []
231
- rubygems_version: 3.6.9
238
+ rubygems_version: 3.6.7
232
239
  specification_version: 4
233
240
  summary: Modern, fast Telegram Bot Framework for Ruby
234
241
  test_files: []
data/setup.sh DELETED
@@ -1,30 +0,0 @@
1
- #!/bin/bash
2
- # Clean Git history and push fresh
3
-
4
- echo "๐Ÿงน Cleaning Git history..."
5
- echo "โš ๏ธ This removes ALL Git history but keeps your code"
6
-
7
- # Remove .git directory
8
- rm -rf .git
9
-
10
- # Reinitialize fresh Git
11
- git init
12
-
13
- # Add your files
14
- git add .
15
-
16
- # Commit
17
- git commit -m "Telegem v3.0.0
18
- - Major rewrite
19
- -introduced async
20
- - removed thread_poll
21
- "
22
-
23
- # Set GitLab remote
24
- git remote add origin https://oauth2:glpat-31Bznn8ioRy85WZ5lDwGJ286MQp1Omd5aHc5Cw.01.1217avfnk@gitlab.com/ruby-telegem/telegem.git
25
-
26
- # Force push (since new repo)
27
- git push -u origin main --force
28
-
29
- echo "โœ… Fresh push complete!"
30
- echo "๐ŸŒ View at: https://gitlab.com/ruby-telegem/telegem.git"