Open sbenthall opened 3 years ago
What would it be better to replace this with @benheller ?
The way to "fix" this is to refactor the code such that the handlers are independent functions that can be called both from Discord actions and Express routes.
I'd like to tackle this. I'm wondering if there's a standard place to include helper functions in an Express directory/filesystem hierarchy.
I see:
app/
models/
routes/
services/
discord/
I'm thinking after reading a few blog posts about it that maybe discord/
should be popped up to the same level as routes/
and the handlers moved to services
. But I defer to you.
I agree that discord/
should be at the same level as routes/
. I'd move the handlers to a new folder at app/controllers
or app/handlers
that's shared between app/routes/
and app/discord/
. If you need other helper functions (for things like array manipulation, sorting, etc) those could go in a new app/utils
folder.
Thank you @benheller ! I will prioritize this ticket.
The supertest mechanic in the discord bot is an outrage. OUTRAGE!