Cui button not calling commandSolved
I've been trying to create a simple UI using CUI. I use the following code to create UI:
CuiElementContainer elements = new CuiElementContainer();
                
elements.Add(new CuiElement
{
    Name = "Button1",
    Parent = "Overlay",
    Components =
    {
        new CuiButtonComponent
        {
            Close = "Button1",
            Color = "0 0 0",
            Command = "command",
        },
        new CuiRectTransformComponent
        {
            AnchorMin = "0.729 0.031",
            AnchorMax = "0.752 0.072",
            OffsetMax = "0 0"
        }
    }
});
elements.Add(new CuiElement {
    Name = "Button1Text",
    Parent = "Button1",
    Components =
    {
        new CuiRectTransformComponent
        {
            AnchorMin = "0.729 0.031",
            AnchorMax = "0.752 0.072",
            OffsetMax = "0 0"
        },
        new CuiTextComponent
        {
            Text = "<",
            Align = TextAnchor.MiddleCenter,
            FontSize = 14,
            Color = "1 1 1",
        }
    }
});

elements.Add(new CuiElement
{
    Name = "Button2",
    Parent = "Overlay",
    Components =
    {
        new CuiButtonComponent
        {
            Close = "Button2",
            Color = "0 0 0",
            Command = "command"
        },
        new CuiRectTransformComponent
        {
            AnchorMin = "0.775 0.031",
            AnchorMax = "0.798 0.072",
            OffsetMax = "0 0"
        }
    }
});
elements.Add(new CuiElement
{
    Name = "Button2Text",
    Parent = "Button2",
    Components =
    {
        new CuiRectTransformComponent
        {
            AnchorMin = "0.775 0.031",
            AnchorMax = "0.798 0.072",
            OffsetMax = "0 0"
        },
        new CuiTextComponent
        {
            Text = ">",
            Align = TextAnchor.MiddleCenter,
            FontSize = 14,
            Color = "1 1 1",
        }
    }
});

CuiHelper.AddUi(player, elements);​
The buttons disappear when clicked but neither of them calls the command. The command is registered via [ChatCommand("command")]. Everything is a part of RustPlugin. Why doesn't it work?
It only works with console commands.
set Command = "chat.say /command"
5df88d179ce26.jpg AVOCoder
set Command = "chat.say /command"

Lol. That's a bad idea for sure.
Just use covalence commands, they work without issues

5ba0b9633e817.png?uid=5ba0b9716c220 2CHEVSKII

Lol. That's a bad idea for sure.
Just use covalence commands, they work without issues

I'm answered to him issue.
But, yes, I'm agree, it's bad practice

Locked automatically