Post content
Set Bed Time / Restrictions For Command Use Between 12 AM To 6 AM Bangladesh Time π TBC PYTHON CODEπ€ Command Name : YOUR COMMAND NAME Code : JS_Organizations = libs.dateandtime.now('Asia/Dhaka') hours = int(JS_Organizations['time'].split(':')[0]) minutes = int(JS_Organizations['time'].split(':')[1]) seconds = int(JS_Organizations['time'].split(':')[2]) bed_time_start = 0 # 12 AM in 24-hour format bed_time_end = 6 # 6 AM in 24-hour format if hours >= bed_time_start and hours < bed_time_end: remaining_hours = bed_time_end - hours - 1 remaining_minutes = 60 - minutes remaining_seconds = 60 - seconds ampm = 'AM' if hours < 12 else 'PM' hours12 = hours % 12 if hours12 == 0: hours12 = 12 remaining_time = f"<b>{remaining_hours} hours, {remaining_minutes} minutes, {remaining_seconds} seconds</b>" user_first_name = message.from_user.first_name message = ( f"<b>π Hey {user_first_name}</b>\n" f"<b>βββββββββ’β β’Β°β’ββ’Β°β’β β’ββββββββ\n" f"It is Bed Time ποΈ\n" f"So You Cannot Use This Button From 12:00 AM To 6:00 AM in Bangladesh Time\n" f"Current Time: {hours12}:{minutes:02} {ampm}</b>\n" f"<b>βββββββββ’β β’Β°β’ββ’Β°β’β β’ββββββββ\n" f"Come Back After: {remaining_time}</b>\n" f"<b>βββββββββ’β β’Β°β’ββ’Β°β’β β’ββββββββ</b>" ) bot.sendMessage(chat_id=message.chat.id, text=message, parse_mode="HTML") else: #YOUR COMMAND Main CODE IS HERE, Or bot.sendMessage("Now Up Time") Paste this code above the code of your command! And enter your code below! You Can Change Your Timezone And Bed Time β± If You Post This In Your Channel. please Mention Our Channel Name For Credit #BedTime#RestrictionTime#Time#TBC#JSOrganization Β© Copyright : @JSOrganization β Question/Error : @itsSowrov