Compare commits
No commits in common. "5462214fbbba0fdd74813919c181ce8d23c7f1ba" and "4da25709c0f3549904a6838080609370edcf4dbc" have entirely different histories.
5462214fbb
...
4da25709c0
10 changed files with 7 additions and 3463 deletions
|
|
@ -4,10 +4,15 @@ from telebot.handler_backends import ContinueHandling
|
||||||
|
|
||||||
from models.bot import bot, send
|
from models.bot import bot, send
|
||||||
from models.user import validate
|
from models.user import validate
|
||||||
|
from models import logger
|
||||||
|
|
||||||
|
# @bot.message_handler(content_types = ['text'])
|
||||||
|
# def handleAll(message):
|
||||||
|
# logger.log('Bot', f'{message.from_user.id}: {message.text}')
|
||||||
|
# return ContinueHandling()
|
||||||
|
|
||||||
|
|
||||||
#! Root Handlers
|
#! Root Handlers
|
||||||
from .debug import *
|
|
||||||
from .main.register_user import *
|
from .main.register_user import *
|
||||||
# @bot.message_handler(content_types = ['text'], func = lambda m: not validate(m))
|
# @bot.message_handler(content_types = ['text'], func = lambda m: not validate(m))
|
||||||
# def cantValidateHandler(message): ...
|
# def cantValidateHandler(message): ...
|
||||||
|
|
|
||||||
31
bot/debug.py
31
bot/debug.py
|
|
@ -1,31 +0,0 @@
|
||||||
import os
|
|
||||||
import config
|
|
||||||
from pprint import pprint
|
|
||||||
from telebot.handler_backends import ContinueHandling
|
|
||||||
from models.bot import bot, Markup, Strings, send, WebAppInfo, KeyboardButton, ReplyKeyboardMarkup, Message
|
|
||||||
from models import logger
|
|
||||||
|
|
||||||
if os.getenv('ZATUPS_DEBUG'):
|
|
||||||
@bot.message_handler(content_types=['text', 'audio', 'document', 'animation', 'game', 'photo', 'sticker', 'video', 'video_note', 'voice', 'location', 'contact', 'venue', 'dice', 'new_chat_members', 'left_chat_member', 'new_chat_title', 'new_chat_photo', 'delete_chat_photo', 'group_chat_created', 'supergroup_chat_created', 'channel_chat_created', 'migrate_to_chat_id', 'migrate_from_chat_id', 'pinned_message', 'invoice', 'successful_payment', 'connected_website', 'poll', 'passport_data', 'proximity_alert_triggered', 'video_chat_scheduled', 'video_chat_started', 'video_chat_ended', 'video_chat_participants_invited', 'web_app_data', 'message_auto_delete_timer_changed', 'forum_topic_created', 'forum_topic_closed', 'forum_topic_reopened', 'forum_topic_edited', 'general_forum_topic_hidden', 'general_forum_topic_unhidden', 'write_access_allowed', 'user_shared', 'chat_shared', 'story'])
|
|
||||||
def handleAll(message: Message):
|
|
||||||
logger.log('Input', f'[{message.from_user.id if message.from_user else "??"}]: {message.content_type}')
|
|
||||||
pprint(message.json)
|
|
||||||
return ContinueHandling()
|
|
||||||
|
|
||||||
|
|
||||||
@bot.message_handler(
|
|
||||||
content_types = ['text'],
|
|
||||||
func = lambda m: '/web_' in m.text
|
|
||||||
)
|
|
||||||
def web(message: Message):
|
|
||||||
message.text = str(message.text) #! typechecker error fix
|
|
||||||
markup = ReplyKeyboardMarkup(resize_keyboard=True)
|
|
||||||
markup.add(
|
|
||||||
Strings.back_to_home,
|
|
||||||
KeyboardButton(
|
|
||||||
text=message.text,
|
|
||||||
web_app=WebAppInfo(url=config.WEB_BASE_URL+message.text)
|
|
||||||
),
|
|
||||||
row_width=1
|
|
||||||
)
|
|
||||||
send(message, message.text, markup)
|
|
||||||
0
modules/__init__.py
Normal file
0
modules/__init__.py
Normal file
0
modules/ics_generator/bot.py
Normal file
0
modules/ics_generator/bot.py
Normal file
0
modules/ics_generator/event.py
Normal file
0
modules/ics_generator/event.py
Normal file
|
|
@ -5,7 +5,6 @@ description = "Add your description here"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"colorama>=0.4.6",
|
|
||||||
"ics>=0.7.3",
|
"ics>=0.7.3",
|
||||||
"pytelegrambotapi>=4.36.1",
|
"pytelegrambotapi>=4.36.1",
|
||||||
"python-dotenv>=1.2.3",
|
"python-dotenv>=1.2.3",
|
||||||
|
|
|
||||||
11
uv.lock
generated
11
uv.lock
generated
|
|
@ -151,7 +151,6 @@ name = "bot-legacy"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = { virtual = "." }
|
source = { virtual = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "colorama" },
|
|
||||||
{ name = "ics" },
|
{ name = "ics" },
|
||||||
{ name = "pytelegrambotapi" },
|
{ name = "pytelegrambotapi" },
|
||||||
{ name = "python-dotenv" },
|
{ name = "python-dotenv" },
|
||||||
|
|
@ -161,7 +160,6 @@ dependencies = [
|
||||||
|
|
||||||
[package.metadata]
|
[package.metadata]
|
||||||
requires-dist = [
|
requires-dist = [
|
||||||
{ name = "colorama", specifier = ">=0.4.6" },
|
|
||||||
{ name = "ics", specifier = ">=0.7.3" },
|
{ name = "ics", specifier = ">=0.7.3" },
|
||||||
{ name = "pytelegrambotapi", specifier = ">=4.36.1" },
|
{ name = "pytelegrambotapi", specifier = ">=4.36.1" },
|
||||||
{ name = "python-dotenv", specifier = ">=1.2.3" },
|
{ name = "python-dotenv", specifier = ">=1.2.3" },
|
||||||
|
|
@ -309,15 +307,6 @@ wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/cc/61/d01fc49b8dea277640b55a9e15960dbca9fdc8c9fde18e572d39c59f4019/charset_normalizer-3.5.1-py3-none-any.whl", hash = "sha256:6df0ec430f9a831772c23ca5a224cba36517a58a84bb32c32bb59a9fa67c47f6", size = 68658, upload-time = "2026-08-15T08:20:43.306Z" },
|
{ url = "https://files.pythonhosted.org/packages/cc/61/d01fc49b8dea277640b55a9e15960dbca9fdc8c9fde18e572d39c59f4019/charset_normalizer-3.5.1-py3-none-any.whl", hash = "sha256:6df0ec430f9a831772c23ca5a224cba36517a58a84bb32c32bb59a9fa67c47f6", size = 68658, upload-time = "2026-08-15T08:20:43.306Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "colorama"
|
|
||||||
version = "0.4.6"
|
|
||||||
source = { registry = "https://pypi.org/simple" }
|
|
||||||
sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" }
|
|
||||||
wheels = [
|
|
||||||
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "frozenlist"
|
name = "frozenlist"
|
||||||
version = "1.8.0"
|
version = "1.8.0"
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -4,7 +4,7 @@
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Карта</title>
|
<title>Карта</title>
|
||||||
<script src="../common/telegram.js"></script>
|
<script src="https://telegram.org/js/telegram-web-app.js?59"></script>
|
||||||
<link rel="stylesheet" href="./styles/main.css?v12">
|
<link rel="stylesheet" href="./styles/main.css?v12">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Document</title>
|
|
||||||
<script src="../common/telegram.js"></script>
|
|
||||||
</head>
|
|
||||||
<body style="filter: invert(1)">
|
|
||||||
<h1>/web_callback_test</h1>
|
|
||||||
<textarea id="data" style="width: 100%; height: 200px"></textarea>
|
|
||||||
<button style="font-size: 20px;" onclick="sendData()">Send Data</button>
|
|
||||||
<script>
|
|
||||||
const tg = window.Telegram.WebApp
|
|
||||||
const sendData = () => {
|
|
||||||
tg.sendData(document.getElementById('data').value)
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Loading…
Add table
Reference in a new issue