View Single Post
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