Files
Tg-bot/bot.0.1/create_bot.py
2024-10-29 16:09:13 +03:00

12 lines
726 B
Python
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from aiogram import Bot, Dispatcher
from aiogram.contrib.fsm_storage.memory import MemoryStorage
import os
# РАСКОМЕНТИРУЙ, ЕСЛИ ЗАПУСКАЕШЬ НЕ ЧЕРЕЗ ФАЙЛ "bot_run.bat", НО В ТАКОМ СЛУЧАЕ НЕ ЗАБУДЬ ЗАКОМЕНТИРОВАТЬ "bot = Bot(token=os.getenv("BOT_TOKEN"))" ЭТУ СТРОЧКУ
# Уже пофиксил, это можно просто создать переменную окружения (если, что это делается там, где выбираешь интерпретатор)
from config import BOT_TOKEN
bot = Bot(token=BOT_TOKEN)
# bot = Bot(token=os.getenv("BOT_TOKEN"))
dp = Dispatcher(bot, storage=MemoryStorage())