Giter VIP home page Giter VIP logo

Comments (8)

Katreque avatar Katreque commented on July 30, 2024

A JSON idea for Template Configuration:

{
  "id": 1,
  "name": "Default Template",
  "channels": [{
    "id": 0,
    "name": "Bem Vindo",
    "type": 0,
    "permissions": [],
    "child": [],
  }],
  "roles": [],
  "modules": []
}

from bottotherobot.

Katreque avatar Katreque commented on July 30, 2024

Default Template example: (?)

{
    "id": 1,
    "name": "Default Template",
    "channels": [
        {
            "id": "0",
            "name": "Informações",
            "type": 0,
            "permissions": [],
            "child": [
                {
                    "id": "0.1",
                    "name": "bem-vindo",
                    "type": 1,
                    "permissions": []
                },
                {
                    "id": "0.2",
                    "name": "regras",
                    "type": 1,
                    "permissions": []
                },
                {
                    "id": "0.3",
                    "name": "duvidas",
                    "type": 1,
                    "permissions": []
                },
                {
                    "id": "0.4",
                    "name": "anuncios",
                    "type": 3,
                    "permissions": []
                }
            ]
        },
        {
            "id": "1",
            "name": "Lobby",
            "type": 0,
            "scalable": true,
            "permissions": [],
            "child": [
                {
                    "id": "1.1",
                    "name": "lobby-generico-1",
                    "type": 1,
                    "permissions": []
                },
                {
                    "id": "1.2",
                    "name": "lobby-generico-2",
                    "type": 1,
                    "permissions": []
                },
                {
                    "id": "1.3",
                    "name": "lobby-generico-3",
                    "type": 1,
                    "permissions": []
                },
                {
                    "id": "1.4",
                    "name": "Sala de Áudio",
                    "type": 2,
                    "permissions": []
                }
            ]
        },
        {
            "id": "2",
            "name": "Moderation",
            "type": 0,
            "permissions": [],
            "child": [
                {
                    "id": "2.1",
                    "name": "usuarios-entraram",
                    "type": 1,
                    "permissions": []
                },
                {
                    "id": "2.2",
                    "name": "usuarios-sairam",
                    "type": 1,
                    "permissions": []
                },
                {
                    "id": "2.3",
                    "name": "chat-moderadores",
                    "type": 1,
                    "permissions": []
                },
                {
                    "id": "2.4",
                    "name": "Sala de Reuniões",
                    "type": 2,
                    "permissions": []
                }
            ]
        }
    ],
    "roles": [
        {
            "name": "Moderação",
            "permissions": []
        },
        {
            "name": "Membro",
            "permissions": []
        }
    ],
    "modules": [
        {
            "id": 5,
            "config": {}
        }
    ]
}

from bottotherobot.

Katreque avatar Katreque commented on July 30, 2024

Items to check:

  • Command to use template
  • Channel's name language
  • Permission handler

from bottotherobot.

Katreque avatar Katreque commented on July 30, 2024

Issues #8, #9 and #10 are related.

from bottotherobot.

Katreque avatar Katreque commented on July 30, 2024

Maybe the channel's name should be a object with the available options:

{
    "id": "0.1",
    "name": {
        "PT_BR": "bem-vindo",
        "EN": "Welcome",
    },
    "type": 1,
    "permissions": []
}

from bottotherobot.

Katreque avatar Katreque commented on July 30, 2024

Based on the execution of the #17, I did some adustments to help the implementation.

  • Roles should be created first.
  • Roles now have the constructor props from the Discord API per default.
  • Roles permission value is calculated based on Discord Permission Calculator.
  • Each channel has permissionOverwrites now. All flags are described here.
  • Channels' ids were removed.
  • Channels' type were changed to match the Discord API Enum.

The actual default template:

{
    "id":1,
    "name":"Default Template",
    "roles":[
        {
            "name":{
                "PT_BR":"Moderação",
                "EN":"Mods"
            },
            "color":"#0985c5",
            "position":1,
            "permissions":4260888183,
            "hoist":true,
            "mentionable":false
        },
        {
            "name":{
                "PT_BR":"Membro",
                "EN":"Member"
            },
            "color":"#1e8f36",
            "position":0,
            "permissions":70372929,
            "hoist":false,
            "mentionable":true
        }
    ],
    "channels":[
        {
            "name":{
                "PT_BR":"Informações",
                "EN":"Info"
            },
            "type":"category",
            "permissionOverwrites":[
                {
                    "name":{
                        "PT_BR":"Membro",
                        "EN":"Member"
                    },
                    "allow":[
                        
                    ],
                    "deny":[
                        "SEND_MESSAGES"
                    ]
                },
                {
                    "name":{
                        "PT_BR":"Moderação",
                        "EN":"Mods"
                    },
                    "allow":[
                        "SEND_MESSAGES"
                    ],
                    "deny":[
                        
                    ]
                }
            ],
            "child":[
                {
                    "name":{
                        "PT_BR":"bem-vindo",
                        "EN":"welcome"
                    },
                    "type":"text",
                    "permissionOverwrites":[
                        
                    ]
                },
                {
                    "name":{
                        "PT_BR":"regras",
                        "EN":"rules"
                    },
                    "type":"text",
                    "permissionOverwrites":[
                        
                    ]
                },
                {
                    "name":{
                        "PT_BR":"ajuda",
                        "EN":"need-help"
                    },
                    "type":"text",
                    "permissionOverwrites":[
                        
                    ]
                },
                {
                    "name":{
                        "PT_BR":"anúncios",
                        "EN":"announcements"
                    },
                    "type":"text",
                    "permissionOverwrites":[
                        
                    ]
                }
            ]
        },
        {
            "name":{
                "PT_BR":"Lobby-1",
                "EN":"Lobby-1"
            },
            "type":"category",
            "scalable":true,
            "permissionOverwrites":[
                
            ],
            "child":[
                {
                    "name":{
                        "PT_BR":"nome-temporario-1",
                        "EN":"temporary-name-1"
                    },
                    "type":"text",
                    "permissionOverwrites":[
                        
                    ]
                },
                {
                    "name":{
                        "PT_BR":"nome-temporario-2",
                        "EN":"temporary-name-2"
                    },
                    "type":"text",
                    "permissionOverwrites":[
                        
                    ]
                },
                {
                    "name":{
                        "PT_BR":"nome-temporario-3",
                        "EN":"temporary-name-3"
                    },
                    "type":"text",
                    "permissionOverwrites":[
                        
                    ]
                },
                {
                    "name":{
                        "PT_BR":"nome-temporario-audio",
                        "EN":"temporary-name-audio"
                    },
                    "type":"voice",
                    "permissionOverwrites":[
                        
                    ]
                }
            ]
        },
        {
            "name":{
                "PT_BR":"Moderação",
                "EN":"Moderation"
            },
            "type":"category",
            "permissionOverwrites":[
                {
                    "name":{
                        "PT_BR":"Membro",
                        "EN":"Member"
                    },
                    "allow":[
                        
                    ],
                    "deny":[
                        "VIEW_CHANNEL"
                    ]
                },
                {
                    "name":{
                        "PT_BR":"Moderação",
                        "EN":"Mods"
                    },
                    "allow":[
                        "VIEW_CHANNEL"
                    ],
                    "deny":[
                        
                    ]
                }
            ],
            "child":[
                {
                    "name":{
                        "PT_BR":"usuarios-entraram",
                        "EN":"users-joined"
                    },
                    "type":"text",
                    "permissionOverwrites":[
                        
                    ]
                },
                {
                    "name":{
                        "PT_BR":"usuarios-sairam",
                        "EN":"users-left"
                    },
                    "type":"text",
                    "permissionOverwrites":[
                        
                    ]
                },
                {
                    "name":{
                        "PT_BR":"chat-moderadores",
                        "EN":"chat-mods"
                    },
                    "type":"text",
                    "permissionOverwrites":[
                        
                    ]
                },
                {
                    "name":{
                        "PT_BR":"sala-de-reuniões",
                        "EN":"meeting-room"
                    },
                    "type":"voice",
                    "permissionOverwrites":[
                        
                    ]
                }
            ]
        }
    ],
    "modules":[
        {
            "id":5,
            "config":{
                
            }
        }
    ]
}

from bottotherobot.

Katreque avatar Katreque commented on July 30, 2024

The modules are the next step to think about.

from bottotherobot.

Katreque avatar Katreque commented on July 30, 2024

The template should follow the default.json format.

from bottotherobot.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.