AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] Discord/Slack API (CallAdmin, SourceBans, ...) (https://forums.alliedmods.net/showthread.php?t=292663)

zipcore 01-11-2017 09:59

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

A pretty simple plugin that allows you to send JSON messages to Discord and Slack.

Features
  • Command to test the API: sm_testdiscord <webhook> <message>
  • Auto format plain text into JSON for slack & discord
  • Auto resend msg if the API is busy

Requires: SteamWorks

Installation

discord.smx -> addons/sourcemod/plugins/
discord.cfg -> addons/sourcemod/configs/

Add your WebHook URLs to discord.cfg, if you are using Discord don't forget to add /slack to the end of the webhook url.
DO NOT add your webhook URL inside any module config unless you know what you are doing...
WebHook URLs can be created in your channel settings on discord.

Module: CallAdmin

Requires: Calladmin (sm_calladmin_admin_action has to be set to 0 or 2)

discord_calladmin.smx -> addons/sourcemod/plugins/

Admin-Commands:
  • sm_claim - Sends a message to your calladmin channel informing everyone you are on the server taking care about reports.

discord_calladmin.cfg


Module: SourceBans/SourceComms

Requires: SourceBans++ (edited version, original sourcebans has no ban forwards, feel free to request compability for other sourcebans versions)

discord_sourcebans.smx -> addons/sourcemod/plugins/
discord_sourcecomms.smx -> addons/sourcemod/plugins/

discord_sourcebans.cfg

discord_sourcecomms.cfg


Download

gitlab.com/Zipcore/Discord/





Quote:

Originally Posted by blackhawk74 (Post 2486023)
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!


hakan9878 01-11-2017 10:04

Re: Discord/Slack API (CallAdmin, Sourcebans, ...)
 
Running it on my server! works pretty well

darkyy1994 01-11-2017 10:18

Re: Discord/Slack API (CallAdmin, Sourcebans, ...)
 
nice work! i will install it on my server too :)

thank you :)



EDIT: i installed it works without problems thank you :)

evgShuter 01-11-2017 10:19

Re: Discord/Slack API (CallAdmin, Sourcebans, ...)
 
nice release buddy!

Great work

Simon. 01-11-2017 10:48

Re: Discord/Slack API (CallAdmin, Sourcebans, ...)
 
nice one!

Addicted. 01-11-2017 15:07

Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
 
Great idea! Another nice release!

SHUFEN 01-11-2017 20:27

Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
 
good well!!
try that in my one.

zipcore 01-12-2017 02:38

Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
 
Update
Added !claim command for discord_calladmin module.

Bchewy 01-12-2017 07:55

Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
 
Niceeeeee!

T1MOXA 01-12-2017 18:55

Re: [ANY] Discord/Slack API (CallAdmin, SourceBans, ...)
 
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)


All times are GMT -4. The time now is 11:14.

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