telegram-python 0.3.0__tar.gz → 0.3.2__tar.gz
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.
- telegram_python-0.3.2/PKG-INFO +20 -0
- telegram_python-0.3.2/README.md +4 -0
- {telegram_python-0.3.0 → telegram_python-0.3.2}/pyproject.toml +6 -7
- {telegram_python-0.3.0/telegram_send → telegram_python-0.3.2/telegram_python}/telegram_send.py +4 -3
- telegram_python-0.3.0/PKG-INFO +0 -11
- telegram_python-0.3.0/README.md +0 -3
- telegram_python-0.3.0/setup.cfg +0 -4
- telegram_python-0.3.0/setup.py +0 -19
- telegram_python-0.3.0/telegram_python.egg-info/PKG-INFO +0 -11
- telegram_python-0.3.0/telegram_python.egg-info/SOURCES.txt +0 -9
- telegram_python-0.3.0/telegram_python.egg-info/dependency_links.txt +0 -1
- telegram_python-0.3.0/telegram_python.egg-info/top_level.txt +0 -1
- {telegram_python-0.3.0/telegram_send → telegram_python-0.3.2/telegram_python}/__init__.py +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: telegram-python
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: A Python package for sending Telegram messages
|
|
5
|
+
Author: Tatiana
|
|
6
|
+
Author-email: durachevska@ukr.net
|
|
7
|
+
Requires-Python: >=3.10,<4.0
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
poetry add telegram_python
|
|
17
|
+
|
|
18
|
+
cd demo
|
|
19
|
+
poe demo
|
|
20
|
+
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
[
|
|
1
|
+
[tool.poetry]
|
|
2
2
|
name = "telegram-python"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.2"
|
|
4
4
|
description = "A Python package for sending Telegram messages"
|
|
5
|
-
authors = [
|
|
6
|
-
{name = "Tatiana", email = "durachevska@ukr.net"}
|
|
7
|
-
]
|
|
5
|
+
authors = ["Tatiana <durachevska@ukr.net>"]
|
|
8
6
|
readme = "README.md"
|
|
9
7
|
|
|
10
8
|
[tool.poetry.dependencies]
|
|
@@ -15,7 +13,8 @@ requests = "^2.32.3"
|
|
|
15
13
|
requires = ["poetry-core"]
|
|
16
14
|
build-backend = "poetry.core.masonry.api"
|
|
17
15
|
|
|
18
|
-
packages = [{include = "
|
|
16
|
+
packages = [{include = "telegram_python"}]
|
|
19
17
|
|
|
20
18
|
[tool.setuptools.packages]
|
|
21
|
-
find = {exclude = ["demo"
|
|
19
|
+
find = {exclude = ["demo"]}
|
|
20
|
+
|
{telegram_python-0.3.0/telegram_send → telegram_python-0.3.2/telegram_python}/telegram_send.py
RENAMED
|
@@ -2,7 +2,10 @@ import requests
|
|
|
2
2
|
from datetime import datetime
|
|
3
3
|
import os
|
|
4
4
|
import logging
|
|
5
|
+
from dotenv import load_dotenv
|
|
5
6
|
|
|
7
|
+
# Завантаження змінних середовища з .env файлу
|
|
8
|
+
load_dotenv()
|
|
6
9
|
start_hour = int(os.getenv("TELEGRAM_START_HOUR", 0))
|
|
7
10
|
end_hour = int(os.getenv("TELEGRAM_END_HOUR", 24))
|
|
8
11
|
bot_token = os.getenv("TELEGRAM_BOT_TOKEN")
|
|
@@ -22,15 +25,13 @@ def send(message: str) -> None:
|
|
|
22
25
|
try:
|
|
23
26
|
if len(message) > telegram_max_symbol:
|
|
24
27
|
message = message[:telegram_max_symbol]
|
|
25
|
-
|
|
26
28
|
url = f"https://api.telegram.org/bot{bot_token}/sendMessage"
|
|
27
29
|
payload = {
|
|
28
30
|
"chat_id": chat_id,
|
|
29
31
|
"text": message
|
|
30
32
|
}
|
|
31
33
|
my_rez=requests.post(url, json=payload, timeout=10)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
|
|
34
35
|
if my_rez.status_code == 200:
|
|
35
36
|
logging.info(f"Message sent successfully to chat_id={chat_id}")
|
|
36
37
|
else:
|
telegram_python-0.3.0/PKG-INFO
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: telegram-python
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: A Python package for sending Telegram messages
|
|
5
|
-
Author: Tetiana
|
|
6
|
-
Author-email: Tatiana <durachevska@ukr.net>
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
|
|
9
|
-
poetry add telegram_send
|
|
10
|
-
|
|
11
|
-
poetry run python demo/demo.py
|
telegram_python-0.3.0/README.md
DELETED
telegram_python-0.3.0/setup.cfg
DELETED
telegram_python-0.3.0/setup.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from setuptools import setup, find_packages
|
|
2
|
-
|
|
3
|
-
# Завантаження вмісту README.md
|
|
4
|
-
with open("README.md", "r", encoding="utf-8") as fh:
|
|
5
|
-
long_description = fh.read()
|
|
6
|
-
|
|
7
|
-
setup(
|
|
8
|
-
name="telegram_send",
|
|
9
|
-
version="0.3.0",
|
|
10
|
-
packages=find_packages(),
|
|
11
|
-
description="sending notifications to telegram", # Короткий опис
|
|
12
|
-
install_requires=[
|
|
13
|
-
"requests"
|
|
14
|
-
],
|
|
15
|
-
author="Tetiana",
|
|
16
|
-
author_email="tetyana.d@nitra.dev",
|
|
17
|
-
long_description=long_description, # Детальний опис
|
|
18
|
-
long_description_content_type="text/markdown", # Формат README
|
|
19
|
-
)
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: telegram-python
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: A Python package for sending Telegram messages
|
|
5
|
-
Author: Tetiana
|
|
6
|
-
Author-email: Tatiana <durachevska@ukr.net>
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
|
|
9
|
-
poetry add telegram_send
|
|
10
|
-
|
|
11
|
-
poetry run python demo/demo.py
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
telegram_send
|
|
File without changes
|