last code from server

This commit is contained in:
Alex D
2023-04-25 04:47:00 +03:00
parent cb8fb7d359
commit 5cca85686e
12 changed files with 31 additions and 24 deletions
+2 -2
View File
@@ -6,11 +6,11 @@ class MathCommands(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.slash_command(name="math")
@commands.slash_command(name="калькулятор", description="Помогает решить любой пример")
async def math(self, ctx: disnake.AppCommandInteraction, *, equation):
try:
result = eval(equation)
await ctx.send(f'Задача: {equation} = {result}')
await ctx.send(f'Задача: {equation} = {result}')
except:
await ctx.send('Ошибка при выполнении вычислений.')