# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: Discord-Bot
spec:
    description: The Discord Bot Template is a powerful starting point for creating a feature-rich Discord bot, utilizing modern slash commands.
    variables:
        - key: _BOT_TOKEN
          type: STRING
          name: What is your bot token?
          description: Get your bot token by creating an application on Discord Developer Portal.
        - key: _CLIENT_ID
          type: STRING
          name: What is your discord application client id?
          description: Navigate to "OAuth2" => "General" on your application page to get the client id.
        - key: _OPEN_AI_KEY
          type: STRING
          name: What is your OpenAI api key?
          description: Obtain your OpenAI API key on the account section of OpenAI API Platform.
        - key: _ADMIN_USER_ID
          type: STRING
          name: What is your discord id?
          description: Discord ID of admin user, will be use when unexpected error occurred.
    tags:
        - Bot
        - ChatGPT
        - Tool
    readme: |-
        The Discord Bot Template is a powerful starting point for creating a feature-rich Discord bot that utilizes modern slash commands. It offers several built-in features to enhance the bot's functionality and user experience. The following list listed the features included in this template:

        - ChatGPT: The bot includes a ChatGPT feature that can read chat history and remember users' Discord names, enhancing the interaction experience.
        - Music Player: It has a built-in music player for providing entertainment to users in the Discord server.
        - Tic Tac Toe: A fun and classic game of Tic Tac Toe is included, adding a playful element to the bot.
        - Auto-generated Help Command: The template comes with an auto-generated help command to help users navigate the bot's commands effortlessly.
        - Error Logging: The bot has an integrated error logging feature to keep track of any unexpected errors efficiently.

        Start building your Discord bot with these powerful features using the Discord Bot Template!

        ## For more details, please visit the [Wiki Page](https://github.com/OnCloud125252/Discord-Bot-Template/wiki/)
    services:
        - name: Bot
          template: GIT
          spec:
            source:
                source: GITHUB
                repo: 673599445
                branch: ""
            env:
                ADMIN_USER_ID:
                    default: ${_ADMIN_USER_ID}
                BOT_TOKEN:
                    default: ${_BOT_TOKEN}
                CLIENT_ID:
                    default: ${_CLIENT_ID}
                MONGO_URI:
                    default: ${MONGODB_URI}
                OPEN_AI_KEY:
                    default: ${_OPEN_AI_KEY}
          domainKey: null
        - name: Database
          icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/mongodb.svg
          template: PREBUILT
          spec:
            source:
                image: mongo:7.0
                command:
                    - sh
                args:
                    - -c
                    - sed -i '10,23d' /usr/local/bin/docker-entrypoint.sh && exec docker-entrypoint.sh mongod
            ports:
                - id: database
                  port: 27017
                  type: TCP
            volumes:
                - id: data
                  dir: /data/db
            instructions:
                - title: Command to connect to your MongoDB
                  content: mongosh "mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}"
                - title: MongoDB connection string
                  content: mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}
                - title: MongoDB username
                  content: ${MONGO_USERNAME}
                - title: MongoDB password
                  content: ${MONGO_PASSWORD}
                - title: MongoDB host
                  content: ${PORT_FORWARDED_HOSTNAME}
                - title: MongoDB port
                  content: ${DATABASE_PORT_FORWARDED_PORT}
            env:
                MONGO_CONNECTION_STRING:
                    default: mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@${MONGO_HOST}:${MONGO_PORT}
                    expose: true
                MONGO_HOST:
                    default: ${CONTAINER_HOSTNAME}
                    expose: true
                MONGO_INITDB_ROOT_PASSWORD:
                    default: ${PASSWORD}
                MONGO_INITDB_ROOT_USERNAME:
                    default: mongo
                MONGO_PASSWORD:
                    default: ${MONGO_INITDB_ROOT_PASSWORD}
                    expose: true
                MONGO_PORT:
                    default: ${DATABASE_PORT}
                    expose: true
                MONGO_URI:
                    default: ${MONGO_CONNECTION_STRING}
                    expose: true
                MONGO_USERNAME:
                    default: ${MONGO_INITDB_ROOT_USERNAME}
                    expose: true
