mirror of
https://github.com/dizedev/Main-tech.git
synced 2026-09-16 21:58:48 +00:00
20 lines
521 B
Python
20 lines
521 B
Python
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))
|