fuma-nama / discord-bot-dashboard-next

The Most Powerful Discord bot Dashboard Template
https://demo-bot.vercel.app
MIT License
178 stars 61 forks source link

Backend Development #48

Open Easy-TX opened 4 months ago

Easy-TX commented 4 months ago

I don't know how to use Backend Development. Is there any support or documentation to help me?

vladyxd commented 2 months ago

You have to build your own. I am using express.js for example.

You just need a way to handle your endpoints.

example:

 app.get('/guilds/:guildId', async (req, res) => {
        if(!await checkSession(req)) return res.status(401).json({error: 'Unauthorized'});

        const guild = client.guilds.cache.get(req.params.guildId);
        console.log('called')
        if (!guild) {
            return res.status(404).json({ error: 'Guild not found' });
        }
        guild.enabledFeatures = ['welcome-message']
        res.json(guild).status(200);
    });

Not sure if it still helps you, since it's been almost 3 months since then, but hey :)

fuma-nama commented 2 months ago

In the backend section there's a link for the example written in typescript, you can start off from that.