Giter Site home page Giter Site logo

Comments (5)

YashKandalkar avatar YashKandalkar commented on July 30, 2024

Hey! I came across this repo, I'd like to contribute but have some questions.

Create an array to store IDs of blocked users. This should be stored in the .env file to allow updates without requiring a rebuild.

Will updating the env file be enough? I don't know how the bot is hosted but after every restart/rebuild the ids stored in env file will be lost right? Or is the data preserved?

from becca-lyria.

naomi-lgbt avatar naomi-lgbt commented on July 30, 2024

I'd be happy to assign this to you!

The bot is hosted on Heroku, so .env values are preserved across builds. However, I'm actually thinking a better approach would be to store an array of blocked IDs in the config.json file, then have the bot check if the message author is included in that array. If it is, skip the command (or send a message response explaining the user is blocked).

from becca-lyria.

YashKandalkar avatar YashKandalkar commented on July 30, 2024

AFAIK the heroku restarts it's dynos often (once a day?), so editing files doesn't work, the changes will disappear after restart. And this SO question suggests that the app will rebuild if we update the env vars. The best option is to use a database (heroku has a postgres db with 10k rows limit).

from becca-lyria.

naomi-lgbt avatar naomi-lgbt commented on July 30, 2024

The bot is already configured to a MongoDB instance, so we could leverage that existing database.

However, this does not necessarily need to be a command that a user can call, but a configuration option that can be set manually in the code base (for people running their own instance of the bot).

Adding it as a command would be something to do in #144 - so server admins can lock out users on a per-server basis.

from becca-lyria.

YashKandalkar avatar YashKandalkar commented on July 30, 2024

Oh so for this issue we just have to add IDs in config.json. Got it, will make a PR on 1st 😄

from becca-lyria.

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.