Git Product home page Git Product logo

Comments (2)

Aavild avatar Aavild commented on July 28, 2024 1

The idea is this:

  1. Projectowner/whoever wants to add the discord server gets directed to the first link being a server template for example https://discord.new/dQCDNNwCPuhE
  2. Then the server owner confirms to create the server using the template and can close down the webtab
  3. Now he needs to add the server to the project hub to do this the bot needs to be added via a link example: https://discord.com/api/oauth2/authorize?client_id=959004457205637131&permissions=2684611713&redirect_uri=http%3A%2F%2Flocalhost%3A3000&scope=bot%20applications.commands (link describes all the permisions the bot needs)
  4. Neither the create server template link nor the add bot link can connect the discordserver and our webapp/discordbot. This can be solved in 2 ways:
    4.a We need to authenticate at least the projectowner/whoever added the bot on the website with discord. This is done by a simple OAuth request which can be handled entirely between client side and discord. After auth the client can send it's own clientid/clienttoken in a POST request. A guide for that here: https://github.com/discordjs/guide/tree/main/code-samples/oauth/simple-oauth-webserver https://discordjs.guide/oauth2/#getting-started-with-oauth2 (remember to setup redirect for auth). Now the discordbot can fetch the user adding it to the server and the user can provide it's userid on the ProjectHub and thus the bot can be connected to a project. In the start we can just assume that the person only wants to add discord to it's newest project, but later on we need to give the user a choice which project the server can be added to.
    4.b Alternatively we could provide the UUID for the project and then the user can type a command in discord to connect the server and the projecthub. Something like /connect 7wad8d7wd78-7ywd7-dw7 and the user can quickly copy-paste this into the discord server.
    Both 5.a and 5.b makes sense. The benefit of 5.a is provide proper authentication and if you're authenticated on the webserver the bot will always recognize the user if the user adds the bot to more discordservers allowing for many projects to be created quicker in the long run. The benefit of 5.b is that it is more intuitive to do for the user, we need to store less in the database and no need to worry about multiple projects for the same user. On 5.b it will however never get easier to setup discord.
  5. There might be a little prework needed for webhook so that the discordbot have a main TextChannel to work in.

Quick afterthought after writing this: We could seperate the option of creating a server into 2 seperate options: create discordserver from template, connect discordserver to a specific project. This is so that if the user already has their own defined discordserver they can add the bot to that one

from astro.

Decode84 avatar Decode84 commented on July 28, 2024

The idea is this:
~

This is 🔥

from astro.

Related Issues (20)

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.