maddinat0r / samp-discord-connector

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

How to pass interaction value? #243

Open Locky0 opened 1 year ago

Locky0 commented 1 year ago

Before, I could easily pass the value of channels, users through mysql_tquery, but when I do the same with the interaction value, I get the error

"[ERROR] DCC_SendInteractionEmbed: invalid interaction id '23733572'"

Example of use mysql_tquery(mysql_conexao, "SELECT Nick,Conectado,Experiencia,NivelExperiencia FROM contas WHERE Suspensa !='Sim' AND TempoBan < UNIX_TIMESTAMP() ORDER BY Experiencia DESC, NivelExperiencia DESC, Nick ASC LIMIT 30", "MySQL_ShowRankingOnDiscord", "drd", _:user, _:interaction, RankID);

I already tried mysql_tquery(mysql_conexao, "SELECT Nick,Conectado,REP,REPTemp FROM contas WHERE Suspensa !='Sim' AND TempoBan < UNIX_TIMESTAMP() ORDER BY REP DESC LIMIT 30", "MySQL_ShowRankingOnDiscord", "ddd", _:user, _:interaction, RankID);

the function of receiving the command forward DCC_CmdRanking(DCC_Interaction:interaction, DCC_User:user); public DCC_CmdRanking(DCC_Interaction:interaction, DCC_User:user)

mysql forward MySQL_ShowRankingOnDiscord(DCC_User:author, DCC_Interaction:interaction, ranking_type); public MySQL_ShowRankingOnDiscord(DCC_User:author, DCC_Interaction:interaction, ranking_type)

just an example of how I used it before with a command processor. DCCMD:ranking(DCC_Channel:channel, DCC_User:author, params[]) { ... mysql_tquery(mysql_conexao, "SELECT Nick,Conectado,Experiencia,NivelExperiencia FROM contas WHERE Suspensa !='Sim' AND TempoBan < UNIX_TIMESTAMP() ORDER BY Experiencia DESC, NivelExperiencia DESC, Nick ASC LIMIT 30", "MySQL_ShowRankingOnDiscord", "ddd", _:author, _:channel, RankID); ...

Locky0 commented 1 year ago

I also ask you to take advantage, and see if DCC_SendChannelEmbedMessage is working, because I don't have any return when I use the function.