Discord 如何删除embed yagpdb自定义命令

Discord 如何删除embed yagpdb自定义命令,discord,Discord,(yagpdb自定义命令)我需要在它发送3秒后删除此嵌入,但是{{{deleteressponse 3}}不起作用 {{ $id := reFind \d` .Cmd | toInt64 }} {{ with (dbGet $id "afk") }} {{ $user := userArg .UserID }} {{ $eta := "" }} {{ if gt .ExpiresAt.Unix 0 }} {{ $eta = huma

(yagpdb自定义命令)我需要在它发送3秒后删除此嵌入,但是
{{{deleteressponse 3}}
不起作用

{{ $id := reFind \d` .Cmd | toInt64 }}
{{ with (dbGet $id "afk") }}
    {{ $user := userArg .UserID }}
    {{ $eta := "" }}
    {{ if gt .ExpiresAt.Unix 0 }} {{ $eta = humanizeDurationSeconds (.ExpiresAt.Sub currentTime) | printf "*%s will be back in around %s.*" $user.Username }} {{ end }}
    {{ sendMessage nil (cembed
        "author" (sdict "name" (printf "%s está AFK" $user.String) "icon_url" ($user.AvatarURL "256"))
        "description" (joinStr "\n\n" $eta .Value)
        "color" (randInt 0 16777216)
        "footer" (sdict "text" "AFK desde")
        "timestamp" .UpdatedAt
    ) }} 

对我来说,将嵌入变量放入一个变量中,然后发送消息,并将消息id存储在另一个变量中。在睡眠了几秒钟之后,我想显示嵌入的部分,我通过ID删除了消息,嵌入的部分也包括在内

您的代码如下所示:

{{ $id := reFind \d` .Cmd | toInt64 }}
{{ with (dbGet $id "afk") }}
    {{ $user := userArg .UserID }}
    {{ $eta := "" }}
    {{ if gt .ExpiresAt.Unix 0 }} {{ $eta = humanizeDurationSeconds (.ExpiresAt.Sub currentTime) | printf "*%s will be back in around %s.*" $user.Username }} {{ end }}
    {{ $embed := cembed
        "author" (sdict "name" (printf "%s está AFK" $user.String) "icon_url" ($user.AvatarURL "256"))
        "description" (joinStr "\n\n" $eta .Value)
        "color" (randInt 0 16777216)
        "footer" (sdict "text" "AFK desde")
        "timestamp" .UpdatedAt
     }} 
{{ $x := sendMessageRetID nil $embed }}
{{ sleep (3) }}
{{ deleteMessage nil $x }}