maddinat0r / samp-discord-connector

SA:MP plugin which controls a Discord bot
MIT License
112 stars 57 forks source link

DCC_OnMessageReaction doesn't call. #179

Open LeonardoClark opened 3 years ago

LeonardoClark commented 3 years ago
public DCC_OnMessageReaction(DCC_Message:message, DCC_User:reaction_user, DCC_Emoji:emoji, DCC_MessageReactionType:reaction_type)
{
    new DCC_Channel:channel;

    if(reaction_user == DCC_INVALID_USER)
        return 1;

    DCC_GetMessageChannel(message, channel);
    if(g_ChatSugestoes == channel)
    {
        if(reaction_user == DCC_User://)
        {
            if(reaction_type == REACTION_ADD)
            {
                new string[2000];
                new string2[150];

                new emoji_name[DCC_EMOJI_NAME_SIZE];
                DCC_GetEmojiName(emoji, emoji_name);

                if(!strcmp(":heart:", emoji_name))
                {
                    new DCC_User:author;
                    new username[DCC_USERNAME_SIZE];

                    DCC_GetMessageContent(message, string);
                    DCC_GetMessageAuthor(message, author);
                    DCC_GetUserName(author, username);

                    new DCC_Embed:embed = DCC_CreateEmbed();

                    format(string2, sizeof(string2), "@%s", username);
                    DCC_SetEmbedTitle(embed, string2);
                    DCC_SetEmbedColor(embed, 0xFF0000);
                    DCC_SetEmbedDescription(embed, string);
                    DCC_EditMessage(message, "", embed);
                    //
                    DCC_SendChannelEmbedMessage(DCC_Channel:803466962020597791, embed);
                }
            }
        }
    }
    return 1;
}
DEntis-T commented 1 year ago

I am facing the same issue still.