bot.on.chat_message(text="!пи")
async def wrapper(ans: Message):
p = str(math.pi * (1 + 1 - 1))
r = p.replace(".", ",")
await ans("Число пи = {0}".format(r))
@bot.on.chat_message(text="!син <num>")
async def wrapper(ans: Message, num):
if num.isdigit():
sinus = str(math.sin(int(num)))
rad = str(math.degrees(math.sin(int(num))))
deg = str(math.sin(int(num)))
answerR = rad.replace(".", ",")
answerD = deg.replace(".", ",")
await ans("Синус числа {0}: \n Градусы: {1}\n Радианы: {2}".format(num, answerD, answerR))
else:
await ans("✖️ Ошибка Пип-Пип-Пип")
@bot.on.chat_message(text="!кос <num>")
async def wrapper(ans: Message, num):
if num.isdigit():
rad = str(math.degrees(math.cos(int(num))))
deg = str(math.cos(int(num)))
answerR = rad.replace(".", ",")
answerD = deg.replace(".", ",")
await ans("Косинус числа {0}: \n Градусы: {1}\n Радианы: {2}".format(num, answerD, answerR))
else:
await ans("✖️ Ошибка Пип-Пип-Пип")