Answer the question
In order to leave comments, you need to log in
The program does not start, I do not understand why it knocks out errors?
I've tried everything but I don't understand why I get these shells
Unresolved reference 'main'
Unresolved reference 'collect_data'
from aiogram import Bot, Dispatcher, executor, types
from aiogram.dispatcher.filters import Text
from aiogram.utils.markdown import hbold, hlink
from main import collect_data
import json
bot = Bot(token="zzzzzzzzzzzzzzzzzz", parse_mode=types.ParseMode.HTML)
dp = Dispatcher(bot)
@dp.message_handler(commands="start")
async def start(message: types.Message):
start_buttons = ["перша кнопка1", "друга кнопака2", "третя кнопка3"]
keyboard = types.ReplyKeyboardMarkup(resize_keyboard=True)
keyboard.add(*start_buttons)
await message.answer("Привіт!", reply_markup=keyboard)
@dp.message_handler(Text(equals="перша кнопка1"))
async def get_discout_sneaker(message: types.Message):
await message.answer("Please waiting....")
collect_data()
with open("304.json") as file:
data = json.load(file)
for item in data:
card = f"{hbold(' ')} {item.get('judge')}\n" \
f"{hbold('08.11.2021 09:20')} {item.get('date')}\n" \
f"{hbold('304/ /21')} {item.get('number')}"
await message.answer(card)
def main():
executor.start_polling(dp)
if __name__ == "__main__":
main()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question