raw files

This commit is contained in:
IGlek 2025-05-19 10:17:54 +03:00
parent 3cef7ac45f
commit eb65182ee0
30 changed files with 86 additions and 0 deletions

17
src/code/bot.py Normal file
View file

@ -0,0 +1,17 @@
import asyncio, logging
from init import *
from handlers import router
async def main() -> None:
dp.include_router(router)
await bot.delete_webhook(drop_pending_updates=True)
await dp.start_polling(bot, allowed_updates=dp.resolve_used_update_types())
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
try: asyncio.run(main())
except KeyboardInterrupt: pass

1
src/code/config.py Normal file
View file

@ -0,0 +1 @@
BOT_TOKEN = "XXXXXXXXX" # @MosPoly_Helperbot

27
src/code/handlers.py Normal file
View file

@ -0,0 +1,27 @@
from aiogram import types, F, Router
from aiogram.types import (Message, InlineQuery, InlineQueryResultArticle, InputTextMessageContent, ChosenInlineResult,
ContentType, InlineKeyboardButton, InlineKeyboardMarkup, CallbackQuery, FSInputFile,
InputMediaPhoto, InlineQueryResultPhoto)
from aiogram.filters import Command, CommandStart
from aiogram.utils.keyboard import InlineKeyboardBuilder
from init import *
from scripts import *
router = Router()
@router.message(CommandStart())
async def start_handler(msg: Message) -> None:
await msg.answer("Привет мир!")
@router.message(Command("help"))
async def help_handler(msg: Message) -> None:
text = "<b>Текст</b>\n\n"
text += "<b>/dates</b> - Текст\n\n"
text += "<b>/picture</b> - Текст\n\n"
text += "<b>/gallery</b> - Текст"
await msg.answer(text)

10
src/code/init.py Normal file
View file

@ -0,0 +1,10 @@
from aiogram import Bot, Dispatcher
from aiogram.enums.parse_mode import ParseMode
from aiogram.fsm.storage.memory import MemoryStorage
from aiogram.client.bot import DefaultBotProperties
import config
bot = Bot(token=config.BOT_TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML))
dp = Dispatcher(storage=MemoryStorage())

15
src/code/scripts.py Normal file
View file

@ -0,0 +1,15 @@
from csv import reader, writer
def write_log(text):
with open("../data/database/log.txt", "a") as f:
f.writelines(text)
def view_csv(filename):
data = []
with open(f'../data/database/{filename}', 'r', encoding='utf-8') as csvfile:
csvreader = reader(csvfile)
for row in csvreader:
data.append(row)
return data

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1 @@
Это файл загулшка

View file

@ -0,0 +1 @@
Это файл загулшка

View file

@ -0,0 +1 @@
Это файл загулшка

View file

@ -0,0 +1 @@
Это файл загулшка

View file

@ -0,0 +1 @@
Это файл загулшка

View file

@ -0,0 +1 @@
Это файл загулшка

View file

@ -0,0 +1 @@
Это файл загулшка

View file

@ -0,0 +1 @@
Это файл загулшка

View file

@ -0,0 +1 @@
Это файл загулшка

View file

@ -0,0 +1 @@
Это файл загулшка

View file

@ -0,0 +1 @@
Это файл загулшка

View file

@ -0,0 +1 @@
Это файл загулшка

View file

@ -0,0 +1 @@
Это файл загулшка

View file

@ -0,0 +1 @@
Это файл загулшка

View file

@ -0,0 +1 @@
Это файл загулшка

View file

@ -0,0 +1 @@
Это файл загулшка