Raised This Month: $404 Target: $400
 101% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 01-12-2017 , 21:43   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #11

Nice plugin zipcore, thank you!

For anyone wondering how to mention specific roles besides @here or @everyone, let's use an example:

You want to mention the @admins role. First we need to get the Role ID. You can do this by typing \@admins in your discord server, this will output a string similar to this: <@&164103385761892222>

So then in discord_calladmin.cfg we'll have this:
discord_calladmin_mention "<@&164103385761892222>"

and ta-da, you're done! Figured that would be helpful since it took me a little while to figure out how to do this, d'oh!
__________________

Last edited by sneaK; 01-12-2017 at 21:43.
sneaK is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 01-13-2017 , 06:16   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #12

Quote:
Originally Posted by T1MOXA View Post
I have an error.

[discord.smx] [OnRequestComplete] Bad Request! Error Code: [400]. Check your message, the API doesn't like it! Message: "{"attachments": [{"color": "#ff2222","title": "View on Sourcebans","title_link": "http://***/index.php?p=banlist&searchText=STEAM_1:1:***" ,"fields": [{"title": "Player","value": "T1MOXA ( STEAM_1:1:*** )","short": true},{"title": "Admin","value": "T1MOXA","short": true},{"title": "Ban Length","value": "1 min","short": true},{"title": "Reason","value": "1","short": true}]}]}"

Where in this query error ?
(I have my own alteration of sourcebans, maybe that's the reason)
Maybe you miss the /slack at the end of your webhook url in case you are using discord.
And if you are using your own sourcebans version the sorucecommsn/-bans modules can't work.
As already written on the main post the original sourcebans plugins don't have ban forwards, but if you link me the sourcebans code you are using I can add those forwards for you (Thats not much work).
__________________

Last edited by zipcore; 01-13-2017 at 06:22.
zipcore is offline
MrDanne
Member
Join Date: Jan 2017
Location: Stockholm, Sweden
Old 01-13-2017 , 08:24   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #13

Very nice!
But I can't find discord_calladmin.cfg
Where should this one be?
MrDanne is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 01-13-2017 , 08:32   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #14

Quote:
Originally Posted by MrDanne View Post
Very nice!
But I can't find discord_calladmin.cfg
Where should this one be?
It's auto. generated when the plugin is loaded under cfg/sourcemod/
__________________
zipcore is offline
MrDanne
Member
Join Date: Jan 2017
Location: Stockholm, Sweden
Old 01-13-2017 , 09:29   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #15

Well, I see now that I get some errors...

Errors:
discord_sourcecomms.smx (Discord: SourceComms): Library not found: discord
calladmin.smx (CallAdmin): Required extension "Client Preferences" file("clientprefs.ext") not running
discord_sourcebans.smx (Discord: SourceBans): Library not found: discord
simplecsgoantilagger.smx (SimpleCSGOAntiLagger): Required extension "Client Preferences" file("clientprefs.ext") not running
discord_calladmin.smx (Discord: CallAdmin): Could not find required plugin "calladmin"
discord.smx (Discord API): Required extension "SteamWorks" file("SteamWorks.ext") not running
clientprefs.smx (Client Preferences): Required extension "Client Preferences" file("clientprefs.ext") not running
sbchecker.smx (SourceBans Checker): Failed to connect to SourceBans DB, Could not find driver "mysql"

Not sure where to start to solve this.
I have installed SteamWorks and put the 3 files in /bin , but there was no extensions in the file that I downloaded...

And the Required extension "Client Preferences" file("clientprefs.ext") not running I do not understand either.

Any good ideas for me to solve this?
MrDanne is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 01-13-2017 , 10:17   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #16

Quote:
Originally Posted by MrDanne View Post
Well, I see now that I get some errors...

Errors:
discord_sourcecomms.smx (Discord: SourceComms): Library not found: discord
calladmin.smx (CallAdmin): Required extension "Client Preferences" file("clientprefs.ext") not running
discord_sourcebans.smx (Discord: SourceBans): Library not found: discord
simplecsgoantilagger.smx (SimpleCSGOAntiLagger): Required extension "Client Preferences" file("clientprefs.ext") not running
discord_calladmin.smx (Discord: CallAdmin): Could not find required plugin "calladmin"
discord.smx (Discord API): Required extension "SteamWorks" file("SteamWorks.ext") not running
clientprefs.smx (Client Preferences): Required extension "Client Preferences" file("clientprefs.ext") not running
sbchecker.smx (SourceBans Checker): Failed to connect to SourceBans DB, Could not find driver "mysql"

Not sure where to start to solve this.
I have installed SteamWorks and put the 3 files in /bin , but there was no extensions in the file that I downloaded...

And the Required extension "Client Preferences" file("clientprefs.ext") not running I do not understand either.

Any good ideas for me to solve this?
It seems like you have more problems than just installing this plugin.

Your problems are related to problems with multiple extensions:

1. dbi.mysql.ext
2. clientprefs.ext
3. SteamWorks.ext

So this meight not be the right thread for this kind of the support (since your problems have nothing todo with the plugins or plugins at all), but "sm exts list" may gives you a hint whats wrong.
__________________
zipcore is offline
rogeraabbccdd
Veteran Member
Join Date: Jun 2015
Location: de_dust2
Old 01-13-2017 , 10:25   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #17

Bug report:
I will not recieve message in discord if the mute/gag/silence duration is "Session".
__________________

Please comment on my profile, or I will ignore your friend request.

GitHub | Steam | WARMOD+ | Discord:Kento#2118
rogeraabbccdd is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 01-13-2017 , 10:38   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #18

Quote:
Originally Posted by rogeraabbccdd View Post
Bug report:
I will not recieve message in discord if the mute/gag/silence duration is "Session".
Update your sourcecomms.smx and it's fixed.
__________________
zipcore is offline
rogeraabbccdd
Veteran Member
Join Date: Jun 2015
Location: de_dust2
Old 01-13-2017 , 11:08   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #19

I don't think it's sourcecomms's problem.
If time duration is "Session", the time is "-1".

So I add this in "PrePareMsg" in "discord_sourcecomms.sp", and it works.
PHP Code:
if (time == -1
    {
        
sLength "Session";
    } 
__________________

Please comment on my profile, or I will ignore your friend request.

GitHub | Steam | WARMOD+ | Discord:Kento#2118

Last edited by rogeraabbccdd; 01-13-2017 at 11:08.
rogeraabbccdd is offline
T1MOXA
Member
Join Date: Aug 2016
Old 01-13-2017 , 12:48   Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
Reply With Quote #20

Quote:
Originally Posted by zipcore View Post
Maybe you miss the /slack at the end of your webhook url in case you are using discord.
And if you are using your own sourcebans version the sorucecommsn/-bans modules can't work.
As already written on the main post the original sourcebans plugins don't have ban forwards, but if you link me the sourcebans code you are using I can add those forwards for you (Thats not much work).
I added the missing callbacks in my plugin.

new Handle:g_OnBanPlayer;
g_OnBanPlayer = CreateGlobalForward("OnSBBanPlayer", ET_Ignore, Param_Cell, Param_Cell, Param_Cell, Param_String);
And
Call_StartForward(g_OnBanPlayer);
Call_PushCell(client);
Call_PushCell(target);
Call_PushCell(time);
Call_PushString(reason);
Call_Finish();

With sourcecomms the same nonsense!
[discord.smx] [OnRequestComplete] Bad Request! Error Code: [400]. Check your message, the API doesn't like it! Message: "{"attachments": [{"color": "#ffff22","title": "View on Sourcebans","title_link": "http://***/index.php?p=commslist&searchText=STEAM_1:1:** *","fields": [{"title": "Player","value": "T1MOXA ( STEAM_1:1:*** )","true": false},{"title": "Admin","value": "T1MOXA","short": true},{"title": "Gag Length","value": "1 min","short": true},{"title": "Reason","value": "1","short": true}]}]}"

Last edited by T1MOXA; 01-13-2017 at 13:30.
T1MOXA 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 08:46.


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