Webhooks
Important
Make sureenable-web-hooks
is set to true in theconfig.yml
otherwise all the following will not work!
Important
This feature requires knowledge of Discord Webhooks to use. If you don't know what those are, start here: https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks
Then you need to create a webhooks
directory in the same folder as the config (i.e. config/EnvyGTS/webhooks/
)
In this directory you will add the JSON files for each different type of WebHook.
There are three different types of event that have a related webhook:
publisher
- For when trades are createdpurchaser
- For when trades are purchasedremover
- For when trades are removed
For each of these you'll need two files. One for the items and one for the Pokemon.
Which means if you had all enabled your file system would look like this:
config/
EnvyGTS/
webhooks/
publisher-pokemon.json
publisher-item.json
purchaser-pokemon.json
purchaser-item.json
remover-pokemon.json
remover-item.json
config.yml
locale.yml
guis.yml
Each JSON file contains the embed information.
Here is an example for the publisher-pokemon.json file:
{
"url": "WEBHOOK-URL-HERE",
"username":"EnvyGTS",
"avatar_url": "https://play.pokemonshowdown.com/sprites/ani/%species_lower%.gif",
"tts": false,
"icon_url":"https://play.pokemonshowdown.com/sprites/ani/%species_lower%.gif",
"embeds":[
{
"title":"NEW LISTING",
"description": "By %seller%",
"url": "https://google.com",
"color":65280,
"footer":{
"icon_url":"",
"text":"Reforged GTS"
},
"thumbnail":{
"url":"https://play.pokemonshowdown.com/sprites/ani/%species_lower%.gif"
},
"author":{
"name":"Reforged GTS - New Listing",
"url":"https://discordapp.com",
"icon_url":"https://pixelmonmod.com/w/images/logo/Fullcolor-50x50.png"
},
"fields":[
{
"name":"Listing Information -",
"value":"Seller: **%seller%** \\nPrice: **$%price%** \\nExpiration: %expires_in%",
"inline":false
},
{
"name":"Info:",
"value":"Pokemon: %species%\\nGender: %gender%\\nLevel: %level%\\nAbility: %ability%\\nUntradeable: %untradeable%\\nUnbreedable: %unbreedable%",
"inline":true
},
{
"name":"Stats:",
"value":"Level: %level%\\nForm: %form%\\nShiny: %shiny%\\nNature: %nature%\\nFriendship: %friendship%",
"inline":true
},
{
"name":"----",
"value":"----",
"inline":false
},
{
"name":"IVs:",
"value":"%iv_hp%/%iv_attack%/%iv_defence%/%iv_spattack%/%iv_spdefence%/%iv_speed% (%iv_percentage%%) ",
"inline":true
},
{
"name":"EVs:",
"value":"%ev_hp%/%ev_attack%/%ev_defence%/%ev_spattack%/%ev_spdefence%/%ev_speed%",
"inline":true
}
]
}
]
}