help me pls
# support-forum
b
try _:embed in SetTimerEx, should remove the warning but not deleted, no idea why
g
i dont think embed is a integer sir
try to set DCC_Embed:embed in the timerex
or see in a printf what returns in the "embed"
s
ok
printed as integer and got "1", as float got "0.0000", as "%e" got "e", as string got weird characters.
g
put DCC_Embed:embed in the settimer then
or as victor said _:embed
s
not work
w
SetTimerEx("DeleteEmbed", 2000, false, "i", _:embed);
It should work!
s
not work
the log " invalid embed id "1" "
w
try deleting the whole message
d
Delete embed is for the internal embed ID (which is done automatically), you'd want to edit the message if you want to remove the embed.
b
so, in this delete embed shouldnt be used?
d
correct it is just to delete the embed from memory not discord
b
i am dcc pro player mf i knew it without knewing it 💪
d
well it is obvious, there is no message i’d you give it
so it wouldn’t know what to delete
g
how would it be then
i'm kinda confused ngl
b
when he sends the embed, embed it is not more used
now he need to get the id of the message to delete it, it uses other func iirc
g
oo
b
oo
s
Copy code
c++
public OnDiscordCommandAttempt(DCC_User:user, DCC_Channel:channel, cmdtext[]){
    new DCC_Embed:embed;
    if(channel != DCC_FindChannelById(CHANNEL_CMDBOT)){
        embed = DCC_CreateEmbed("ERRO:", "test", .color = 15548997);
        DCC_SendChannelEmbedMessage(channel, embed);
    SetTimerEx("DeleteEmbed", 2000, false, "i", _:embed);
        return 0;
    }
    return 1;
}

forward DeleteEmbed(DCC_Embed:embed);
public DeleteEmbed(DCC_Embed:embed){
    DCC_DeleteEmbed(embed);
    return 1;
}

[04/24/23 19:14:27] [ERROR] DCC_DeleteEmbed: invalid embed id '1'
here
d
.
s
How?
g
i think its this way
the victor's way is correct? @dazzling-translator-76954
d
you can specify a callback in DCC_SendChannelEmbedMessage that will be called when the message is created and you will get a DCC_Message value, then set a timer and use DCC_DeleteMessage
s
Copy code
c++
[04/25/23 06:26:32] [ERROR] DCC_DeleteMessage: invalid message id '1'

public OnDiscordCommandAttempt(DCC_User:user, DCC_Channel:channel, cmdtext[]){
    new DCC_Embed:embed;
    if(channel != DCC_FindChannelById(CHANNEL_CMDBOT)){
        embed = DCC_CreateEmbed("ERRO:", "test.", .color = 15548997);
        DCC_SendChannelEmbedMessage(channel, embed, _, "OnEmbedErrorCreated");
        return 0;
    }
    return 1;
}

forward OnEmbedErrorCreated();
public OnEmbedErrorCreated(){
    new DCC_Message:message = DCC_GetCreatedMessage();
    SetTimerEx("DeleteEmbedMessage", 2000, false, "i", _:message);
    return 1;
}

forward DeleteEmbedMessage(DCC_Message:message);
public DeleteEmbedMessage(DCC_Message:message){
    DCC_DeleteMessage(message);
    return 1;
}
b
cara, acho q DCC message e embed são diferentes, não entendi qq ce ta querendo fazer
s
quero deletar este embed enviado (DCC_SendChannelEmbedMessage(channel, embed, _, "OnEmbedErrorCreated");) apos 2 segundos
ja tentei deletar o embed e nada, fiz o que o mike falou e nada
d
you need to use DCC_SetMessagePersistent(message, true) else the ID will get deleted when OnEmbedErrorCreated is finished
s
should i do something like:
Copy code
py
new DCC_Message:message = DCC_SendChannelEmbedMessage...

DCC_SetMessagePersistent(message, true);
?
g
yes
d
no, use the function in the callback where you useDCC_GetCreatedMessage.
s
ok