Skip to content

Instantly share code, notes, and snippets.

@ccev
Last active June 18, 2023 10:50
Show Gist options
  • Save ccev/a5f6c1aebc22f1087fa39b04a244a1c5 to your computer and use it in GitHub Desktop.
Save ccev/a5f6c1aebc22f1087fa39b04a244a1c5 to your computer and use it in GitHub Desktop.
Poracle Fortupdate DTS
// poracle/dts/fort_update.json
[
{
"id": 1,
"type": "fort-update",
"default": true,
"platform": "discord",
"templateFile": "dts/fort_update.txt"
}
]
// poracle/dts/fort_update.txt
{
"avatar_url": "{{#eq fortType 'pokestop'}}https://raw.githubusercontent.com/ccev/stopwatcher-icons/master/stop.png{{else}}https://raw.githubusercontent.com/ccev/stopwatcher-icons/master/gym.png{{/eq}}",
"username": "{{#if isRemoval}}Ein{{#eq fortType 'gym'}}e{{/eq}} {{/if}}{{#if isNew}}Neue{{#eq fortType 'pokestop'}}r{{/eq}} {{/if}}{{#eq fortType 'pokestop'}}Pokéstop{{else}}Arena{{/eq}}{{#if isEdit}} Edit{{/if}}{{#if isRemoval}} wurde entfernt{{/if}}",
"embeds": [
{
"description": "## {{{name}}}\n{{#if description}}{{#isnt description 'unknown'}}*{{{description}}}*\n\n{{/isnt}}{{/if}}{{#if isEditName}}**Alter Name**\n> {{{replace oldName '\n' '> \n'}}}\n\n**Neuer Name**\n> {{{replace newName '\n' '> \n'}}}\n\n{{/if}}{{#if isEditDescription}}**Alte Beschreibung**\n> {{{replace oldDescription '\n' '> \n'}}}\n\n**Neue Beschreibung**\n> {{{replace newDescription '\n' '> \n'}}}\n\n{{/if}}{{#if isEditImgUrl}}**Neues Foto**\n\n{{/if}}",
"thumbnail": {
"url": "{{{imgUrl}}}"
},
"image": {
"url": "{{#if isEditImgUrl}}{{{oldImageUrl}}}{{else}}{{{staticMap}}}{{/if}}"
},
"url": "https://discord.com",
"color": {{#eq fortType 'pokestop'}}1216493{{else}}12239045{{/eq}}
}
{{#if isEditImgUrl}}
,{
"url": "https://discord.com",
"image": {
"url": "{{{newImageUrl}}}"
}
},
{
"image": {
"url": "{{{staticMap}}}"
},
"color": {{#eq fortType 'pokestop'}}1216493{{else}}12239045{{/eq}}
}
{{/if}}
],
"components": [
{
"type": 1,
"components": [
{
"type": 2,
"style": 5,
"emoji": {
"id": "880240407697575986",
"name": "maps"
},
"label": "Google",
"url": "{{{mapurl}}}"
},
{
"type": 2,
"style": 5,
"emoji": {
"id": "1115737806648655885",
"name": "applemaps"
},
"label": "Apple",
"url": "{{{applemap}}}"
}
]
}
]
}
// tileserver template
{
"style": "osm-bright",
"latitude": #if(isEditLocation): #(map_latitude) #else: #(latitude) #endif,
"longitude": #if(isEditLocation): #(map_longitude) #else: #(longitude) #endif,
"zoom": #if(zoom != nil && isEditLocation): #(zoom) #else: 17.5 #endif,
"width": 1000,
"height": 500,
"scale": 1,
"markers": [
#if(isEditLocation):
{
#if(fortType == "pokestop"):
"url": "https://github.com/ccev/stopwatcher-icons/raw/master/tileserver/stop_gray.png",
#else:
"url": "https://github.com/ccev/stopwatcher-icons/raw/master/tileserver/gym_gray.png",
#endif
"latitude": #(oldLatitude),
"longitude": #(oldLongitude),
"width": 48,
"height": 48,
"y_offset": -24
},
#elseif(nearbyStops != nil):
#for(stop in nearbyStops):
{
#if(stop.type == "gym"):
"url": "https://raw.githubusercontent.com/ccev/stopwatcher-icons/master/tileserver/gym_gray.png",
#else:
"url": "https://raw.githubusercontent.com/ccev/stopwatcher-icons/master/tileserver/stop_gray.png",
#endif
"latitude": #(stop.latitude),
"longitude": #(stop.longitude),
"width": 48,
"height": 48,
"y_offset": -24
},
#endfor
#endif
{
#if(fortType == "pokestop"):
"url": "https://github.com/ccev/stopwatcher-icons/raw/master/tileserver/stop_normal.png",
#else:
"url": "https://github.com/ccev/stopwatcher-icons/raw/master/tileserver/gym_normal.png",
#endif
"latitude": #(latitude),
"longitude": #(longitude),
"width": 64,
"height": 64,
"y_offset": -32
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment