Skip to content

ggggg/Ghooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ghooks

Codacy Badge

Table of Contents

About The Project

This plugin allows you to connect a Broke Protocol server to discord webhooks without any 3rd party api or any other programs.

Things you can do with it:

  • Make logs in your discord for easier moderation.
  • Send messages to players
  • Hook to custom events and send messages

Getting Started

Installation

  1. Download the plugin from the steam workshop or from the latest release.
  2. Run the server once in order to get the needeed files.
  3. Open the newly created folder named "GHooks" and edit the settings.json.

Usage

Basic usage:

This is an example on how to change an existing event. (We are using the server start event)

"ServerStart": "",

This is where the webhook link should be, if you don't want this event to run just leave it empty.

"ServerStartMessage": "Server started",

This is the message that will be sent to the webhook. In other events you can use {0} and {1} to add player name and message they are sending.

"ServerStartUseEmbed": true,

This is the option that enables or disables embeds for the webhook; it can be either true or false.

Embeds:

Embeds allow you to give a nice style and color to your webhook messages. You can use up to 10 embeds to send your message. I only recommend adding new embeds if you understand what you're doing, else you can edit the default ones as you want.

"ServerStartEmbed": [{
  //Here will be Embed #1
}]

Embeds will be inside this option as a list, to add a new embed you need to add a comma (,) after the closing bracket and open a new one where you'll place the same settings:

"ServerStartEmbed": [{
  //Here will be Embed #1
},
{
  //Here will be Embed #2
}]

Inside each embed there should be the next options:

"title": "Server Started",
"type": "rich",
"description": "Server has started",
"url": null,
"timestamp": null,
"color": 15158332,
"footer": {
   "text": "Example footer",
   "icon_url": null,
   "proxy_icon_url": null
},
"image": {
   "height": 0,
   "width": 0,
   "proxy_url": null,
   "url": null
},
"thumbnail": {
   "height": 0,
   "width": 0,
   "proxy_url": null,
   "url": null
},
"video": {
   "height": 0,
   "width": 0,
   "url": null
},
"provider": {
   "name": null,
   "url": null
},
"author": {
   "name": "Example author",
   "icon_url": "https://emoji.gg/assets/emoji/5812_yeetus.png",
   "proxy_icon_url": null,
   "url": null
},
"fields": [{
   "name": "Example field",
   "value": "Example field description",
   "inline": false
}]

Notes:

  • Titles can only have 256 characters.
  • Description can only have 2048 characters.
  • There can be up to 25 fields.
  • Color uses decimal value.

Events:

You can hook your webhook to a custom event. To do that you must edit the customEvents.json file following this format:

[
    {
        "SenderName" : "{0}", // {0} is the user name

        "Event" : "EXAMPLE_EVENT", // This is the name of the event you'll be hooking to

        "webhookLink" : "", // Here goes the webhook link

        "Response" : "{0} has went in the triggerbox" 
        //This is the message that will be sent
    }
    
]

Contact

The-g - GitHub - Discord: The-g#7731

xiluisx - GitHub - Discord: xiluisx#1092

About

Discord webhook suport for bp

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages