Skip to content

Commit fb37e16

Browse files
committed
First commit
0 parents  commit fb37e16

File tree

8 files changed

+676
-0
lines changed

8 files changed

+676
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.venv/
2+
.vscode/
3+
.idea/
4+
.env

.python-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10.5

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
install:
2+
pip install poetry && \
3+
poetry install
4+
5+
start:
6+
poetry run python example_bot/main.py

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# okpon
2+
okpon okpon
636 Bytes
Binary file not shown.

example_bot/main.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from aiogram import Bot, Dispatcher, executor, types
2+
from dotenv import load_dotenv
3+
import os
4+
5+
6+
load_dotenv()
7+
8+
bot = Bot(token=os.environ.get('TOKEN'))
9+
dp = Dispatcher(bot)
10+
11+
12+
@dp.message_handler(commands=['start', 'help'])
13+
async def send_welcome(message: types.Message):
14+
"""
15+
This handler will be called when user sends `/start` or `/help` command
16+
"""
17+
await message.reply("Hi!\nI'm EchoBot!\nPowered by aiogram.")
18+
19+
20+
21+
@dp.message_handler()
22+
async def echo(message: types.Message):
23+
# old style:
24+
# await bot.send_message(message.chat.id, message.text)
25+
26+
await message.answer(message.text)
27+
28+
29+
if __name__ == '__main__':
30+
executor.start_polling(dp, skip_updates=True)

poetry.lock

+616
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[tool.poetry]
2+
name = "telegram-schudle-student"
3+
version = "0.1.0"
4+
description = ""
5+
authors = ["Ilia Kaziamov <[email protected]>"]
6+
readme = "README.md"
7+
packages = [{include = "schudule_bot"}]
8+
9+
[tool.poetry.dependencies]
10+
python = "^3.8"
11+
aiogram = "^2.25.1"
12+
python-dotenv = "^1.0.0"
13+
14+
15+
[build-system]
16+
requires = ["poetry-core"]
17+
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)