Raised This Month: $32 Target: $400
 8% 

[ANY] Discord/Slack API (CallAdmin, SourceBans, ...)


Post New Thread Reply   
 
Thread Tools Display Modes
ThatOneGuy
Veteran Member
Join Date: Jul 2012
Location: Oregon, USA
Old 06-17-2020 , 00:59   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #161

I was using this to post chat messages to discord. I found that the plugin wasn't escaping things properly for some characters in the include file function Discord_EscapeString.

I replaced the function as follows and it worked.

PHP Code:
stock void Discord_EscapeString(char[] stringint maxlen)
{
    
ReplaceString(stringmaxlen"@""@");
    
ReplaceString(stringmaxlen"'""\\'");

The double quote didnt appear to need escape.
__________________

Last edited by ThatOneGuy; 06-17-2020 at 01:06.
ThatOneGuy is offline
andrept4
Senior Member
Join Date: Dec 2012
Location: Portugal
Old 08-06-2020 , 19:46   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #162

For me the messages only say "@here"...
__________________
andrept4 is offline
SpirT
Senior Member
Join Date: Sep 2018
Location: Portugal
Old 10-31-2020 , 16:03   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #163

When I report someone with this it just mentions the channel with '@here'. If I do !testdiscord "calladmin" "This is the message that we want to sent" it sends the full message.

Any fix?
__________________
SpirT is offline
BlueHairMinerBoy
New Member
Join Date: Jan 2021
Old 01-09-2021 , 15:56   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #164

Trying to set this up on TF2 and it always shows the IP as 0.0.0.0.

I saw the command "discord_calladmin_ip" in the code - trying to set it in a config file results in it resetting back to 0.0.0.0 after the server loads, no matter where it's set. Setting after the server's loaded in the console works fine.

Any ideas? Running Pterodactyl and TF2 so +net_public_adr don't work, +ip is set as 0.0.0.0 and can't change it.
BlueHairMinerBoy is offline
Smikey
New Member
Join Date: Apr 2020
Old 01-22-2021 , 12:08   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #165

Quote:
Originally Posted by BlueHairMinerBoy View Post
Trying to set this up on TF2 and it always shows the IP as 0.0.0.0.

I saw the command "discord_calladmin_ip" in the code - trying to set it in a config file results in it resetting back to 0.0.0.0 after the server loads, no matter where it's set. Setting after the server's loaded in the console works fine.

Any ideas? Running Pterodactyl and TF2 so +net_public_adr don't work, +ip is set as 0.0.0.0 and can't change it.
I'm also using Pterodactyl Panel and after recompiling the source the "discord_calladmin_ip" works perfectly (Attached file). Funnily enough My problem is that discord messages won't send. sm_testdiscord calladmin <message> works fine but when player tries to report someone through the calladmin I get
PHP Code:
[OnRequestCompleteBad RequestError Code: [400]. Check your messagethe API doesn't like it! Message: "{"username":"********", "text":"<@&********>","attachments": [{"color": "#ff9911","title": "************(steam://connect/******) # ZZ-69","fields": [{"title": "Reason","value": "Aimbot","short": true},{"title": "Reporter","value": "*****(STEAM_0:0:***)","short": true},{"title": "Target","value": "****** (STEAM_0:0:****)","short": true}]}]} 
Any ideas how to fix this ?
SOLVED
For anyone wondering either why their messages don't send or why the calladmin is printing only text or only specified discord tag.
Fix
Discord uses (to this date I'm writing this post) different syntax than it used before so you need to change the define for REPORT
PHP Code:
#define REPORT_MSG "{\"username\":\"{BOTNAME}\",\"content\":\"{MENTION}\",\"embeds\":[{\"title\":\"{HOSTNAME} (steam://connect/{SERVER_IP}:{SERVER_PORT}){REFER_ID}\",\"color\": 15105570,\"fields\":[{\"name\":\"**Reason**\",\"value\":\"{REASON}\",\"inline\":true,\"short\":\"true\"},{\"name\":\"**Reporter**\",\"value\":\"{REPORTER_NAME} ({REPORTER_ID})\",\"inline\":true,\"short\":\"true\"},{\"name\":\"**Target**\",\"value\":\"{TARGET_NAME} ({TARGET_ID})\",\"inline\":true,\"short\":\"true\"}]}]}" 
With this change to the sourcecode the message sending works. Also one thing you NEED TO CHANGE the webhook so it DOESN'T include /slack at the end this is simply not a requirement anymore with discord.
If my solution is either crap or bullshit please point out why because I've spent some time trying to figure out why my discord notifs weren't working. This is by far the most simple solution I was able to find.
Also if you use claim messages in game (/claim) you need to modify the #define CLAIM with the coresponding syntax (I have /claim disabled on my servers so figure it out yourself kek).

This plugin is in dire need of implementing unicode filter for the reports

Attachment 186574

Last edited by Smikey; 01-22-2021 at 12:20.
Smikey is offline
Mist8kenGAS
Junior Member
Join Date: Nov 2017
Location: Dubai, United Arab Emira
Old 01-24-2021 , 11:26   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #166

Quote:
Originally Posted by andrept4 View Post
For me the messages only say "@here"...
Add "/slack" at the end of your WebHook URL in the discord.cfg file.
Mist8kenGAS is offline
gerenda110
Member
Join Date: Sep 2013
Old 04-06-2021 , 14:26   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #167

hello!
i have 404 error at download page can u send me a link???
gerenda110 is offline
flawlessmaggot
New Member
Join Date: Mar 2021
Old 04-07-2021 , 16:29   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #168

Quote:
Originally Posted by gerenda110 View Post
hello!
i have 404 error at download page can u send me a link???
You can find it here https://gitlab.com/Zipcore/Discord/
take a look
flawlessmaggot is offline
Jplays
Junior Member
Join Date: Jun 2017
Location: Portugal
Old 04-09-2021 , 05:10   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #169

Hello. I have already used this plugin and it was working. I needed to install it again, so i went to gitlab and downloaded it. i changed the webhook to mine and put /slack at the end, but it still does not send the message and i get this erros spamming in my console:
Code:
L 04/09/2021 - 10:09:28: [discord.smx] SendNextMsg: Failed To Send Message
L 04/09/2021 - 10:09:28: [discord.smx] SendNextMsg: Failed To Send Message
L 04/09/2021 - 10:09:28: [discord.smx] SendNextMsg: Failed To Send Message
L 04/09/2021 - 10:09:28: [discord.smx] SendNextMsg: Failed To Send Message
L 04/09/2021 - 10:09:28: [discord.smx] SendNextMsg: Failed To Send Message
L 04/09/2021 - 10:09:29: [discord.smx] SendNextMsg: Failed To Send Message
__________________
Jplays is offline
Send a message via AIM to Jplays
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 04-12-2021 , 11:47   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #170

I've fixed the download link on the first post. Seems like gitlab changed the url format
__________________
zipcore is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode