samp-discord-connector
samp-discord-connector copied to clipboard
DCC_OnMessageDelete doesn't call.
Hi, I try to operate on callback DCC_OnMessageDelete
but it doesn't work.
public DCC_OnMessageDelete(DCC_Message:message)
{
new
lString[128]
;
DCC_GetMessageContent(message, lString);
printf("message deleted! [%d] [%s]", _:message, lString);
}
Callback isn't executed after deleting message.
Are there any errors or warnings in the plugin log? Does your bot have enough permissions to receive message delete events in the channel you expect it to?
I deleted a few messages, the only message I got from discord-connector.log
is [01/05/20 21:28:48] [ERROR] Error while retrieving HTTP POST response from '/api/v6/channels/633370983469678593/messages': end of stream
.
Does your bot have enough permissions to receive message delete events in the channel you expect it to?
I think so. He has a role which has an Administrator privilege, also I gave him manage messages
privilege and still nothing. Callback DCC_OnMessageCreate
works as it should, but DCC_OnMessageDelete
isn't.
Can you help me with this? I don't know what I am doing wrong.
I'll investigate further as soon as I get some free time.
As to why this isn't calling is because every time DCC_OnCreateMessage
finishes, it deletes the message but OnDelete requires the message to stay in memory. You can use DCC_SetMessagePersistent
in DCC_OnCreateMessage to keep the message in memory until they delete it. You can't do this in the current version as of yet (0.3.5) due to DCC_OnCreateMessage ignoring the value of persistence.