This commit is contained in:
Alex D
2023-04-24 17:45:20 +03:00
parent 56c1ebefd3
commit 4731006753
18 changed files with 371 additions and 94 deletions
+19
View File
@@ -0,0 +1,19 @@
import disnake
from disnake.ext import commands
class MathCommands(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.slash_command()
async def math(self, ctx: disnake.AppCommandInteraction, *, equation):
try:
result = eval(equation)
await ctx.send(f'Задача: {equation} = {result}')
except:
await ctx.send('Ошибка при выполнении вычислений.')
def setup(bot):
bot.add_cog(MathCommands(bot))