mirror of
https://github.com/dizedev/Main-tech.git
synced 2026-09-16 21:58:48 +00:00
edit
This commit is contained in:
@@ -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))
|
||||
Reference in New Issue
Block a user