def one_f():#КОНЕЦ ПОКАЗА ВРЕМЕНИ
global time4
global time2
time4 = time.time()
time2 = str(time.ctime(time4).split()[3][:5])
min_start = time1.replace(":", " ").split()
min_end = time2.replace(":", " ").split()
if min_end[1] == '00' and min_start == '00':
timepassed = 0
elif min_end[1] == '00':
timepassed = int(60 - int(min_start[1]))
elif int(min_end[1]) < int(min_start[1]):
timepassed = 60 - int(min_start[1]) + int(min_end[1])
else:
timepassed = int(min_end[1]) - int(min_start[1])
def two_f():#НАЧАЛО ПОКАЗА ВРЕМЕНИ
global time3
global time1
time3 = time.time()
time1 = str(time.ctime(time3).split()[3][:5])
name_bot = ["bot", "!", "@namebot"]
#Здесь имена обязательно маленькими буквами
#отзывается на имена в кавычках
for event in longpoll.listen():
if event.type == VkBotEventType.MESSAGE_NEW and event.from_chat and event.message.get('text') != '':
received_message = event.message.get('text')
sender = event.chat_id
from_id = event.message.get('from_id')
name = get_name(from_id)
if received_message.lower().split()[0] in name_bot:
for name_del in name_bot:
received_message = received_message.replace(name_del, "")
#Дальше твои if..elif на проверку команды (вне цикла for)
if .....
cmd_1 = ['!Вадим', 'Ринат', 'Помощь', 'Люц'] #Для команд с 1 словом
if received_message.split()[0] in cmd_1:
adder(name + received_message)
import time
def day():
month_week = {
'Jan': '01',
'Feb': '02',
'Mar': '03',
'Apr': '04',
'May': '05',
'Jun': '06',
'Jul': '07',
'Aug': '08',
'Sep': '09',
'Oct': '10',
'Nov': '11',
'Dec': '12',
'Mon': 'Понедельник',
'Tue': 'Вторник',
'Wed': 'Среда',
'Thu': 'Четверг',
'Fri': 'Пятница',
'Sat': 'Суббота',
'Sun': 'Воскресенье'
}
time_now = time.time()
i, month_end = 0, None
for x in range(0, 31+1):
date = str(time.ctime(time_now+i)).split()
week, month, day, year = month_week[f"{date[0]}"], month_week[f"{date[1]}"], date[2], date[4]
#День недели, месяц, день, год
if month_end is None:
month_end = month
if month == month_end:
print(f'{week} - {day}/{month}/{year}')
i += 86400
day()
if ans.reply_message.from_id > 0:
user_photo = await bot.api.request("users.get", {"user_ids": ans.reply_message.from_id, "fields": "photo_max_orig"})
else:
user_photo = await bot.api.request("groups.getById", {"user_ids": ans.reply_message.from_id, "fields": "photo_max_orig"})