0

I need to make a slash command available on all servers (disnake library). Now I have such code, but it doesn't work:

@bot.slash_command(name="хост", description="Состояние хостинга ботихи")
async def хост(inter):
    emb = disnake.Embed(
    title="Состояние аппарата жизнеобеспечения",
    description=f"""
        > <:cpu:1129080297724588062> Процессор: *`использовано {psutil.cpu_percent()}%`*
        > <:ram:1129080299578466464> Оперативная память: *`использовано {psutil.virtual_memory().percent}%`*
        > <:ping:1129080295069593690> Пинг: *`{round (bot.latency * 1000)} ms`*""",
    color=0x2d2b31)
    await inter.response.send_message(embed=emb)
    print(f'\n{datetime.now()} :: Пользователь {inter.author} вызвал команду "/хостинг".')

The libraries are imported and the bot is configured (this is a code snippet). Sorry for my English.

I want to create slash-command, available to use on all servers. I use disnake

zont
  • 1

1 Answers1

0

Cyrillic characters are not allowed in the names of slash commands (chat input commands).

CHAT_INPUT command names and command option names must match the following regex ^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$ with the unicode flag set. Application Command Object Application Command Naming

Also, the name argument of the decorator is essentially superfluous, so you can do something like this

@bot.slash_command(description="Состояние хостинга ботихи")
async def host(inter): # you can change the name
    emb = disnake.Embed(
    title="Состояние аппарата жизнеобеспечения",
    description=f"""
        > <:cpu:1129080297724588062> Процессор: *`использовано {psutil.cpu_percent()}%`*
        > <:ram:1129080299578466464> Оперативная память: *`использовано {psutil.virtual_memory().percent}%`*
        > <:ping:1129080295069593690> Пинг: *`{round (bot.latency * 1000)} ms`*""",
    color=0x2d2b31)
    await inter.response.send_message(embed=emb)
    print(f'\n{datetime.now()} :: Пользователь {inter.author} вызвал команду "/хостинг".')
waki285
  • 338
  • 1
  • 11
  • And how are slash commands made in Juniper Bat in Russian, for example? How do I make the slash command available on all servers where the bot is installed? JuniperBot cyrillic commands: https://i.yapx.ru/WR41e.png – zont Jul 20 '23 at 03:35