Here I have a code, it works. But I want it to work only only one time on friday:
import logging
from aiogram import Bot, Dispatcher, executor, types
from aiogram.types.message import ContentType
from aiogram.types import ReplyKeyboardRemove, \
ReplyKeyboardMarkup, KeyboardButton, \
InlineKeyboardMarkup, InlineKeyboardButton
import json
from oop import Shop
import requests
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.dispatcher import FSMContext
from datetime import datetime, date, time
@dp.message_handler(text_contains='To get prize')
async def get_prize(message: types.Message):
if datetime.today().weekday() == 4:
await bot.send_message(message.from_user.id, 'You successfuly got your prize, come next friday to get one more✅')
else:
await bot.send_message(message.from_user.id, 'You can get your prize only on fridays.\nToday is no friday :)')
It doesn't work on other days and it works only on friday but it also works a lot of time on friday but I want to make it work only one time on friday. Thanks in advance!