import discord
from discord import ext
from discord.ext import commands
from discord import app_commands
TOKEN =
bot = commands.Bot(command_prefix="/", intents=discord.Intents.all())
@bot.hybrid_command(name="заказ")
async def order(ctx, Цель, количество, Тип):
embed = discord.Embed(colour=discord.Colour.green(), title="Новый заказ от" + str(ctx.author),
description="Цель:" + str(Цель) + " \n Нужное количество работников: " + str(количество))
if Тип == "Билдер":
channel = bot.get_channel(1218449220487352421)
await channel.send(embed=embed)
await ctx.send("Заказ успешно сформирован")
if Тип == "Скриптер":
channel = bot.get_channel(1218449286388387881)
await channel.send(embed=embed)
await ctx.send("Заказ успешно сформирован")
if Тип == "Моделер":
channel = bot.get_channel(1218449340050309120)
await channel.send(embed=embed)
await ctx.send("Заказ успешно сформирован")
@order.autocomplete("Тип")
async def fruits_autocomplete(
interaction: discord.Interaction,
current: str,
) -> list[app_commands.Choice[str]]:
types = ['Билдер', 'Скриптер', 'Моделер']
return [
app_commands.Choice(name=Type, value=Type)
for Type in types if current.lower() in Type.lower()
]
@bot.event
async def on_ready():
await bot.tree.sync()
bot.run(token=TOKEN)