Warm tip: This article is reproduced from serverfault.com, please click

Customizing features within my Discord.py bot through it's website

发布于 2020-11-28 09:44:19

I have many features that can be customized within the bot and using the commands itself, but this can get confusing and may be bugged at times.

Would there be a way to allow users log into the website using Discord's API and to customize the bot from there?

It's similar to how MEE6 or carl and these bots allow users to customize or buy a premium version, but just can't seem to find how I can do this myself.

An example is, a user can head onto the website and can turn on the moderation module through their account they have signed in with. This would then connect with the bot in my python file, or change the config json file with the user id, setting moderation = "True".

Questioner
Cohen
Viewed
0
pjones123 2020-11-29 00:36:03

First of all, to "log in with discord" on your site you'll need to use discord's OAuth2. If you're storing your data in a json file (which I wouldn't recommend for scalability anyway), then you'll have to run you site from the same server as your bot and edit it there. However, you'd be better of in both ways using a cloud-hosted database such as PostgreSQL (SQL) or MongoDB (noSQL). Both of those can either be hosted locally on your machine, or by them in the cloud for free. Personally, I prefer MongoDB. That way you can run your site from wherever and update your database.