# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: Discord Bot Starter
spec:
    description: A discord.js bot template written with TypeScript.
    icon: https://assets-global.website-files.com/6257adef93867e50d84d30e2/636e0a69f118df70ad7828d4_icon_clyde_blurple_RGB.svg
    tags:
        - Bot
    readme: |
        ## Description
        This template was created to give developers a starting point for new Discord bots, so that much of the initial setup can be avoided and developers can instead focus on meaningful bot features. Developers can simply copy this repo, follow the setup instructions below, and have a working bot with many boilerplate features already included!

        ## Features:
        - Basic command structure.
        - Rate limits and command cooldowns.
        - Welcome message when joining a server.
        - Shows server count in bot status.
        - Posts server count to popular bot list websites.
        - Support for multiple languages.

        ## Setup
        ### Copy example config files.
        - Navigate to the config folder of this project.
        - Copy all files ending in .example.json and remove the .example from the copied file names.
        ### Obtain a bot token.
        - You'll need to create a new bot in your Discord Developer Portal.
        ### Modify the config file.
        - Open the config/config.json file.
        - You'll need to edit the following values: client.id - Your discord bot's user ID. client.token - Your discord bot's token.
        ### Install packages.
        - Navigate into the downloaded source files and type npm install.
        ### Register commands.
        - In order to use slash commands, they first have to be registered.
        - Type npm run commands:register to register the bot's commands.
    services:
        - name: Bot
          template: GIT
          spec:
            source:
                source: GITHUB
                repo: 650862496
                branch: master
            configs:
                - path: /app/config/debug.json
                  template: |
                    {
                        "override": {
                            "shardMode": {
                                "enabled": false,
                                "value": "worker"
                            }
                        },
                        "dummyMode": {
                            "enabled": false,
                            "whitelist": ["212772875793334272", "478288246858711040"]
                        }
                    }
                  permission: null
                  envsubst: null
                - path: /app/config/bot-sites.json
                  template: |
                    [
                        {
                            "name": "top.gg",
                            "enabled": false,
                            "url": "https://top.gg/api/bots/<BOT_ID>/stats",
                            "authorization": "<TOKEN>",
                            "body": "{\"server_count\":{{SERVER_COUNT}}}"
                        },
                        {
                            "name": "bots.ondiscord.xyz",
                            "enabled": false,
                            "url": "https://bots.ondiscord.xyz/bot-api/bots/<BOT_ID>/guilds",
                            "authorization": "<TOKEN>",
                            "body": "{\"guildCount\":{{SERVER_COUNT}}}"
                        },
                        {
                            "name": "discord.bots.gg",
                            "enabled": false,
                            "url": "https://discord.bots.gg/api/v1/bots/<BOT_ID>/stats",
                            "authorization": "<TOKEN>",
                            "body": "{\"guildCount\":{{SERVER_COUNT}}}"
                        },
                        {
                            "name": "discordbotlist.com",
                            "enabled": false,
                            "url": "https://discordbotlist.com/api/bots/<BOT_ID>/stats",
                            "authorization": "Bot <TOKEN>",
                            "body": "{\"guilds\":{{SERVER_COUNT}}}"
                        },
                        {
                            "name": "bots.discordlabs.org",
                            "enabled": false,
                            "url": "https://bots.discordlabs.org/v2/bot/<BOT_ID>/stats",
                            "authorization": null,
                            "body": "{\"token\":\"discordlabs.org-<TOKEN>\",\"server_count\":\"{{SERVER_COUNT}}\"}"
                        },
                        {
                            "name": "discords.com",
                            "enabled": false,
                            "url": "https://discords.com/bots/api/bot/<BOT_ID>",
                            "authorization": "<TOKEN>",
                            "body": "{\"server_count\":{{SERVER_COUNT}}}"
                        },
                        {
                            "name": "disforge.com",
                            "enabled": false,
                            "url": "https://disforge.com/api/botstats/<BOT_ID>",
                            "authorization": "<TOKEN>",
                            "body": "{\"servers\":{{SERVER_COUNT}}}"
                        }
                    ]
                  permission: null
                  envsubst: null
                - path: /app/config/config.json
                  template: |-
                    {
                        "developers": ["<YOUR_DISCORD_ID>"],
                        "client": {
                            "id": "<DISCORD_BOT_ID>",
                            "token": "<DISCORD_BOT_TOKEN>",
                            "intents": [
                                "Guilds",
                                "GuildMessages",
                                "GuildMessageReactions",
                                "DirectMessages",
                                "DirectMessageReactions"
                            ],
                            "partials": ["Message", "Channel", "Reaction"],
                            "caches": {
                                "BaseGuildEmojiManager": 0,
                                "GuildBanManager": 0,
                                "GuildInviteManager": 0,
                                "GuildStickerManager": 0,
                                "MessageManager": 0,
                                "PresenceManager": 0,
                                "StageInstanceManager": 0,
                                "ThreadManager": 0,
                                "ThreadMemberManager": 0,
                                "VoiceStateManager": 0
                            }
                        },
                        "api": {
                            "port": 3001,
                            "secret": "00000000-0000-0000-0000-000000000000"
                        },
                        "sharding": {
                            "spawnDelay": 5,
                            "spawnTimeout": 300,
                            "serversPerShard": 1000
                        },
                        "clustering": {
                            "enabled": false,
                            "shardCount": 16,
                            "callbackUrl": "http://localhost:3001/",
                            "masterApi": {
                                "url": "http://localhost:5000/",
                                "token": "00000000-0000-0000-0000-000000000000"
                            }
                        },
                        "jobs": {
                            "updateServerCount": {
                                "schedule": "0 */10 * * * *",
                                "log": false
                            }
                        },
                        "rateLimiting": {
                            "commands": {
                                "amount": 10,
                                "interval": 30
                            },
                            "buttons": {
                                "amount": 10,
                                "interval": 30
                            },
                            "triggers": {
                                "amount": 10,
                                "interval": 30
                            },
                            "reactions": {
                                "amount": 10,
                                "interval": 30
                            }
                        },
                        "logging": {
                            "pretty": true,
                            "rateLimit": {
                                "minTimeout": 30
                            }
                        }
                    }
                  permission: null
                  envsubst: null
