Comments (5)
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.
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.
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.
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.
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)
- [BUG] - Habitica and other optional API keys are erroring out the app
- [BUG] - Localhost does not work as part of the mongo url HOT 1
- [CHORE] - Migrate Custom Configs
- [CHORE] - Migrate to CDN HOT 2
- [FEAT] - Deprecate Habitica Command HOT 2
- [FEAT] - Deprecate Orbit Command HOT 2
- [CHORE] - Tests and Test Coverage HOT 1
- [FEAT] - `/support faq` command HOT 1
- [CHORE] - Clean up old command data logic.
- [FEAT] - `/support data-request` command HOT 3
- [FEAT] - `/support ids` command
- [FEAT] - `userconfig highlight` command HOT 1
- [FEAT] - Convert Activity Context to Ephemeral HOT 4
- [CHORE] - Replace all `user.tag` calls with `user.username` HOT 6
- [FEAT] - Sticky Roles HOT 2
- [BUG] - Link detection doesn't work properly HOT 5
- [DOC] - Join our server link not working on docs page HOT 1
- [BUG] - fix poll duration description HOT 1
- [FEAT] - `/misc echo` command
- MAINTENANCE MODE
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from becca-lyria.