08/11/2023 19:22
Estou criando um status que atualiza de tempo em tempo, mas a mensagem não atualiza, já tentei usar a callback DCC_OnMessageCreate(DCC_Message:message), mas nada.
Código PHP:
//topo da gm
new DCC_Message:StatusMessage = DCC_Message:0; //mensagem status
new DCC_Channel:DCC_StatusChannel = DCC_INVALID_CHANNEL;
#define DCC_STATUS_CHANNEL "1149545004600143902"
public OnGameModeInit()
{
DCC_StatusChannel = DCC_FindChannelById(DCC_STATUS_CHANNEL);
SetTimer ("CreateStatusDiscordMessage", segundos(60), true);
return 1;
}
forward CreateStatusDiscordMessage();
public CreateStatusDiscordMessage()
{
new DCC_Embed:Embed, UTF[144], str[144];
new hora, minuto, ano, mes, dia, hms[144];
Embed = DCC_CreateEmbed("\t\t**Gueto Academy**", "\n", .color=8359053);
format(UTF, sizeof(UTF), "```js\n[%d/50]```", ContarJogadores());
DCC_AddEmbedField(Embed, "\t\t**Players:**", UTF, true);
gettime(hora, minuto);
getdate(ano, mes, dia);
format(hms, 144, "Gueto Academy | %02d/%02d/%04d %02d:%02d", dia, mes, ano, hora, minuto);
utf8encode(str, hms, sizeof(str));
DCC_SetEmbedFooter(Embed, str, IMAGEM_FOOTER);
DCC_SetEmbedThumbnail(Embed, IMAGEM_FOOTER);
if(StatusMessage != DCC_Message:0)
{
DCC_EditMessage(StatusMessage, "", Embed);
}
else
{
DCC_SendChannelEmbedMessage(DCC_StatusChannel, Embed, "", "GetMessageID");
}
return 1;
}
forward GetMessageID();
public GetMessageID()
{
new DCC_Message:message = DCC_GetCreatedMessage();
if(StatusMessage != DCC_Message:0)
{
DCC_DeleteInternalMessage(StatusMessage);
}
StatusMessage = message;
return 1;
}